<?xml version="1.0" encoding="utf-8"?>
				<!-- generator="e107" -->
				<!-- content type="Forum / topic" -->
				<rss  version="2.0">
				<channel>
				<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>

<language>en-gb</language>
				<copyright><a rel="license" href="http://creativecommons.org/licenses/by-nc/2.5/in/" target="_blank"><img alt="Creative Commons License" width="80" height="15" style="border-width:0" src="http://i.creativecommons.org/l/by-nc/2.5/in/80x15.png" target="_blank" /></a>This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc/2.5/in/" target="_blank">Creative Commons Attribution-Noncommercial 2.5 India License</a>.<a href='http://www.8051projects.net/disclaimer.htm' target='_blank' />Rickey's World Disclaimer</a></copyright>
				<managingEditor>Ajay Bhargav - contact@nospam.com</managingEditor>
				<webMaster>contact@nospam.com</webMaster>
				<pubDate>Mon, 01 Dec 2008 13:25:21 -0800</pubDate>
				<lastBuildDate>Mon, 01 Dec 2008 13:25:21 -0800</lastBuildDate>
				<docs>http://backend.userland.com/rss</docs>
				<generator>e107 (http://e107.org)</generator>
				<ttl>60</ttl>
				<textInput>
				<title>Search</title>
				<description>Search 8051 Microcontroller Projects AVR PIC Projects Tutorials Ebooks Libraries codes</description>
				<name>query</name>
				<link>http://www.8051projects.net/search.php</link>
				</textInput>
						<item>
						<title>Need a simple answer for a simple question</title>
<link>http://www.8051projects.net/forum-t10130.html</link>
<description><![CDATA[hi,<br />thanks for looking...<br /><br />i wan to keep decrease a number till 0 in ASM mode...<br />how i know it is already 0 or it decreased more than 0 ...<br />how to stop it from substract more than 0 ...?<br /><br />same question goes to....i have a number , i wan to increase it till 255 in ASM mode too..<br />how i know it is already 255 or it increased more than 255 ...<br />how to stop it from adding more than 255 ...?<br /><br />thanks...<br /><br />need some suggestion...please...either it will affect the Carry in STATUS REGISTER, or...<br />thanks...]]></description>
<pubDate>Thu, 19 Jun 2008 01:49:40 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10130.html</guid>
</item>
						<item>
						<title>Re: Need a simple answer for a simple question</title>
<link>http://www.8051projects.net/forum-t10130.html</link>
<description><![CDATA[hi nic,<br />well, if u are using 8051<br />;<br />if the numberwhich is stored in say register r5 is decremented,then use the following code:<br /><br />mov a,r5<br />jz label1<br />.                        ;here add the code for decrementing the variable<br />.<br />.<br />ret<br />label: <br />.                      ;here the counter has reached zero.<br />.<br />.<br />.<br />ret<br /><br />the 'jz' instuction checks if the value in accumulator is zero and jumps accordingly.<br /><br />For incremented variable use the JC  instruction like below (here r5 is limited to 16):<br /><br />mov a, r5<br />cjne a,#10,label1<br />.                        ;here r5 =10h<br />.<br />ret<br />label1: <br />.                  ;here r5 not equal to 5<br />.<br />ret<br /><br />Note:<br />if the register has a value 0, then the instructions<br />subb r5,#01h and dec r5<br />will set the carry flag. u can then check the carry flag using the instruction 'jc label'<br />]]></description>
<author>pdi33&lt;islurpundalik@nospam.com&gt;</author>
<pubDate>Thu, 19 Jun 2008 03:46:44 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10130.html</guid>
</item>
						<item>
						<title>Re: Need a simple answer for a simple question</title>
<link>http://www.8051projects.net/forum-t10130.html</link>
<description><![CDATA[please confirm the controller u want to use??<br /><br />any way PSW flags can be compared  for the above operations!]]></description>
<author>shyam&lt;shyam@nospam.com&gt;</author>
<pubDate>Thu, 19 Jun 2008 02:58:27 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10130.html</guid>
</item>
						<item>
						<title>Re: Need a simple answer for a simple question</title>
<link>http://www.8051projects.net/forum-t10130.html</link>
<description><![CDATA[hi i m using pic12f629 !<br /><br />i m so confused about this 1...<br /><br />can some1 explain it..thanks]]></description>
<author>nicholastyc&lt;thamyc_2000@nospam.com&gt;</author>
<pubDate>Thu, 19 Jun 2008 05:16:49 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10130.html</guid>
</item>
						<item>
						<title>Re: Need a simple answer for a simple question</title>
<link>http://www.8051projects.net/forum-t10130.html</link>
<description><![CDATA[hello pdi33<br /><br /><div class='indent'>For incremented variable use the JC instruction like below (here r5 is limited to 16):<br /><br />mov a, r5<br />cjne a,#10,label1<br />. ;here r5 =10h<br />.<br />ret<br />label1:<br />. ;here r5 not equal to 5<br />.<br />ret<br /></div><br /><br /><br />i am unable to see where you are using JC instr in  the above example <br /><br /> nic  you have used two different terms here : <br /><br />Incrementing and adding, both look similar but differ in usage, you can increment in the multiples of 1 but you can add any two values<br /><br />if you are starting from say 0 and incrementing then you can know if you have reached 255 by <br />simple CJNE A,#0FFH,xxxx  instr, but when you are adding and the result is more than 255 then you have to subb  0FFH and check the Carry flag.<br /><br /><br />Arun]]></description>
<author>Arun Kumar V&lt;nura1002003@nospam.com&gt;</author>
<pubDate>Thu, 19 Jun 2008 05:33:58 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10130.html</guid>
</item>
						<item>
						<title>Re: Need a simple answer for a simple question</title>
<link>http://www.8051projects.net/forum-t10130.html</link>
<description><![CDATA[H Arun, Can u please explain it in PIc languague (ASM)<br />because i dunno about the language u used ...sorry<br /><br />i wan to INCF a register to 255  or DECF to 0 but i donwan them to exceed the value...<br />thanks...<br />but how can i check for that? ...]]></description>
<author>nicholastyc&lt;thamyc_2000@nospam.com&gt;</author>
<pubDate>Thu, 19 Jun 2008 05:54:26 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10130.html</guid>
</item>
						<item>
						<title>Re: Need a simple answer for a simple question</title>
<link>http://www.8051projects.net/forum-t10130.html</link>
<description><![CDATA[hi arun,<br />thanks for pointing out my errors  <img src='http://www.8051projects.net/e107_images/emotes/yahoo/1.gif' alt='' style='vertical-align:middle; border:0' /> <br />actually i noticed it too so i added the last statement. anyways nic needs it in PIC for which i am as newbee as him <img src='http://www.8051projects.net/e107_images/emotes/yahoo/3.gif' alt='' style='vertical-align:middle; border:0' />   <br />]]></description>
<author>pdi33&lt;islurpundalik@nospam.com&gt;</author>
<pubDate>Thu, 19 Jun 2008 10:42:42 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10130.html</guid>
</item>
						<item>
						<title>Re: Need a simple answer for a simple question</title>
<link>http://www.8051projects.net/forum-t10130.html</link>
<description><![CDATA[<div class='quote_top'>nicholastyc wrote ...</div><div class='quote'><br />H Arun, Can u please explain it in PIc languague (ASM)<br />because i dunno about the language u used ...sorry<br /><br />i wan to INCF a register to 255  or DECF to 0 but i donwan them to exceed the value...<br />thanks...<br />but how can i check for that? ...<br /></div><br />You can use the instruction DECFSZ to decrement and check for zero.It has 2 parameters.. a register and a 0 or 1.The register contains the value to be deremented and the "1" puts the decremented result back in the register(a " 0 " puts the result in the W register).As long as the result is not 0,the very next instruction is executed.If the result is 0,the very next instruction is skipped and the one after that is executed.<br /><br />So you employ the instruction in this way...<br /><br /> <div class='code_asm'>CODE:</div><div class='code_highlight' style='unicode-bidi: embed; direction: ltr'><div class="asm" style="font-family: monospace;">Not_Zero &nbsp;decfsz MyVal,<span style="color: #ff0000;">1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">goto</span> Not_Zero<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;other instructions....</div></div> <br /><br />As long as MyVal is not zero ' goto Not_Zero' is executed,forming a loop.Once MyVal becomes 0,the goto instruction is skipped and execution starts from 'other instructions'.<br /><br />For incrementing to 255 you can do it this way..<br /><br /> <div class='code_asm'>CODE:</div><div class='code_highlight' style='unicode-bidi: embed; direction: ltr'><div class="asm" style="font-family: monospace;">Not_255 &nbsp; &nbsp;Incf MyVal,<span style="color: #ff0000;">1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Decfsz Countdown,<span style="color: #ff0000;">1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">goto</span> Not_255<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;other instructions...</div></div>   <br /><br />Countdown = 255 (assuming MyVa l= 0)<br /><br />Strange..not even a compare instruction is available for the 12fxxx.]]></description>
<author>sashijoseph&lt;sashijoseph@nospam.com&gt;</author>
<pubDate>Thu, 19 Jun 2008 12:16:11 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10130.html</guid>
</item>
						<item>
						<title>Re: Need a simple answer for a simple question</title>
<link>http://www.8051projects.net/forum-t10130.html</link>
<description><![CDATA[thanks for info...<br /><br />i really having problem for the encoder part...<br /><br />i try to use incf and decf and then btfss/btfsc STATUS,Z to check for the max 255 and min 0 !it works...but the encoder part really having big problem..its cant determine which direction correctly...Shyam can u provide me a code of encoder? thanks]]></description>
<author>nicholastyc&lt;thamyc_2000@nospam.com&gt;</author>
<pubDate>Thu, 19 Jun 2008 14:53:07 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10130.html</guid>
</item>
						<item>
						<title>Re: Need a simple answer for a simple question</title>
<link>http://www.8051projects.net/forum-t10130.html</link>
<description><![CDATA[actually u people are working on assembly...<br /><br />i didnt use assembly for years   <img src='http://www.8051projects.net/e107_images/emotes/yahoo/10.gif' alt='' style='vertical-align:middle; border:0' />   <br />so cant help on asm parts..<br /><br />have interfaced encoder on lpc21xx controllers  working fine but inc<br /><br />the procedure is the same as i explained...<br />keep trying for a couple more days  ..  may be this weekend i'll make a code fr ya...<br /><br />will do it fr the 51 uC in asm..<br />till then keep trying and have us informed.<br />]]></description>
<author>shyam&lt;shyam@nospam.com&gt;</author>
<pubDate>Thu, 19 Jun 2008 23:08:37 -0700</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t10130.html</guid>
</item>
				</channel>
				</rss>