<?xml version="1.0" encoding="utf-8" ?>
				<!-- generator="e107" -->
				<!-- content type="Forum / topic" -->
				<rdf:RDF xmlns="http://purl.org/rss/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
				<channel rdf:about="http://www.8051projects.net/">
				<title>8051 Microcontroller Projects AVR PIC Projects Tutorials Ebooks Libraries codes : Forum / topic</title>
				<link>http://www.8051projects.net/</link>
				<description>Learn to make simple microcontroller projects, pic, 8051, avr and arm projects. download 8051 projects, tutorials, libraries, sample codes. join the microcontroller discussion forum and ask doubts regarding electronics. the best source for 8051 over internet.</description>
				<dc:language>en-gb</dc:language>
				<dc:date>2009-01-07T21:41:12-08:00</dc:date>
				<dc:creator>contact@nospam.com</dc:creator>
				<admin:generatorAgent rdf:resource="http://e107.org" />
				<admin:errorReportsTo rdf:resource="mailto:contact@nospam.com" />
				<sy:updatePeriod>hourly</sy:updatePeriod>
				<sy:updateFrequency>1</sy:updateFrequency>
				<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
				<items>
				<rdf:Seq>
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t622.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t622.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t622.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t622.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t622.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t622.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t622.html" />
				</rdf:Seq>
				</items>
				</channel>
						<item rdf:about="http://www.8051projects.net/forum-t622.html">
						<title>Count Down Counter</title>
						<link>http://www.8051projects.net/forum-t622.html</link>
						<dc:date>2009-01-07T21:41:12-08:00</dc:date>
						<dc:creator></dc:creator>
						<dc:subject></dc:subject>
						<description>Hi all, I'm newbie in microcontroller and try to write a code for 4 digit count down counter with AT89S51. Here are portion of the code.count_down: mov a,count1 dec a mov count1,a cjne a,#-1,exit_count mov count1,#9 mov a,count2 dec a mov count2,a cjne a,#-1,exit_count mov count2,#9 mov a,count3 dec a mov count3,a cjne a,#-1,exit_count mov count3,#9 mov a,count4 dec a mov count4,a cjne a,#-1,exit_count mov count4,#0 exit_count: ret The problem were if I put in following value, count1 = 0, count2 = 0, count3 = 1 and count4 = 0, it dosn't display correctly as everytime the 'dec' command was execute it fill in number 9 to previous count varible. How to fix this problem ?. One more thing, at the end of count down, it doesn't display 0000, instead it display 9990.Thanks all.SGH</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t622.html">
						<title>Re: Count Down Counter</title>
						<link>http://www.8051projects.net/forum-t622.html</link>
						<dc:date>2009-01-07T21:41:12-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>Well making a down counter is little tricky, i mean.. its not like simple decrement you need to check and wait till all zero and then exit.cjne a,#-1,exit_countmov count1,#9this will surely make count 1 = 9 coz, after you dec count1 it will become -1 from 0. so according to statement, cjne(compare and jump if not equal) it will exit only if its not equal, but here its equal so, it will execute the next statement, so 9 is loaded in count1. so u are getting that result.I made a program, but i want you to try it first, so giving you hint, you need to decrement the last digit, untill it become zero and when it become zero decrement the second digit, keep on doing this, utill u end up with all zeros!i hope you got some idea, how to implement it, there are lot of compare jumps to be made i think, try it, if you don't get result, i will help you</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t622.html">
						<title>Re: Count Down Counter</title>
						<link>http://www.8051projects.net/forum-t622.html</link>
						<dc:date>2009-01-07T21:41:12-08:00</dc:date>
						<dc:creator>SGH</dc:creator>
						<dc:subject></dc:subject>
						<description>Rickey, thanks for the hint. I'll try to rewrite the code.</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t622.html">
						<title>Re: Count Down Counter</title>
						<link>http://www.8051projects.net/forum-t622.html</link>
						<dc:date>2009-01-07T21:41:12-08:00</dc:date>
						<dc:creator>SGH</dc:creator>
						<dc:subject></dc:subject>
						<description>I'm still trying to rewrite the code. I solved one problem but create another problem in the code.So my progress in this code is slow. It is ok for me as this is part of the learning process.SGH</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t622.html">
						<title>Re: Count Down Counter</title>
						<link>http://www.8051projects.net/forum-t622.html</link>
						<dc:date>2009-01-07T21:41:12-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>good keep trying.. you will reach to the target soon  for any assistance i am here.</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t622.html">
						<title>Re: Count Down Counter</title>
						<link>http://www.8051projects.net/forum-t622.html</link>
						<dc:date>2009-01-07T21:41:12-08:00</dc:date>
						<dc:creator>SGH</dc:creator>
						<dc:subject></dc:subject>
						<description>Rickey,More hints please.Thanks,SGH</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t622.html">
						<title>Re: Count Down Counter</title>
						<link>http://www.8051projects.net/forum-t622.html</link>
						<dc:date>2009-01-07T21:41:12-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>you first tell me what you've done.. so i can tell you.. next..</description>
						</item>
				</rdf:RDF>