<?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:00:44 -0800</pubDate>
				<lastBuildDate>Mon, 01 Dec 2008 13:00:44 -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>ARM-7TDMI tutorial - Working with GPIOs (LPC21xx)</title>
<link>http://www.8051projects.net/forum-t4150.html</link>
<description><![CDATA[consider the following example replace wait() with any delay routine....<br /><br /><div class='code_box'>CODE:</div><div class='code_highlight' style='unicode-bidi: embed; direction: ltr'><div class="c" style="font-family: monospace;"><span style="color: #993333;">int</span> main <span style="color: #66cc66;">&#40;</span><span style="color: #993333;">void</span><span style="color: #66cc66;">&#41;</span> &nbsp;<br /><span style="color: #66cc66;">&#123;</span><br />&nbsp; <span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> j; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #808080; font-style: italic;">/* LED var */</span><br /><br />&nbsp; IODIR1 = 0xFF0000; &nbsp; &nbsp;<span style="color: #808080; font-style: italic;">/* P1.16..23 defined as Outputs */</span><br /><br />&nbsp; init_timer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br /><br />&nbsp;<span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> &nbsp;<br /><span style="color: #66cc66;">&#123;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #808080; font-style: italic;">/* Loop forever */</span><br />&nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span>j = 0x010000; j &lt; 0x800000; j &lt;&lt;= <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #808080; font-style: italic;">/* Blink LED 0,1,2,3,4,5,6 */</span><br />&nbsp; &nbsp; &nbsp; IOSET1 = j; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/* Turn on LED */</span><br />&nbsp; &nbsp; &nbsp; wait <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #808080; font-style: italic;">/* call wait function */</span><br />&nbsp; &nbsp; &nbsp; IOCLR1 = j; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #808080; font-style: italic;">/* Turn off LED */</span><br />&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />&nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span>j = 0x800000; j &gt; 0x010000; j &gt;&gt;=<span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #808080; font-style: italic;">/* Blink LED 7,6,5,4,3,2,1 */</span><br />&nbsp; &nbsp; &nbsp; IOSET1 = j; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #808080; font-style: italic;">/* Turn on LED */</span><br />&nbsp; &nbsp; &nbsp; wait <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/* call wait function */</span><br />&nbsp; &nbsp; &nbsp; IOCLR1 = j; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/* Turn off LED */</span><br />&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />&nbsp; <span style="color: #66cc66;">&#125;</span><br /><span style="color: #66cc66;">&#125;</span></div></div><br /><br /><br />this is a very simple code but tells the main differences between 51 and arm.....]]></description>
<pubDate>Sun, 23 Dec 2007 02:36:37 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4150.html</guid>
</item>
						<item>
						<title>Re: ARM-7TDMI tutorial - Working with GPIOs (LPC21xx)</title>
<link>http://www.8051projects.net/forum-t4150.html</link>
<description><![CDATA[<div class='indent'><strong class='bbcode bold'>Important for reading:</strong><br />just download lpc2148 usermanual user.manual.lpc2141.lpc2142.lpc2144.lpc2146.lpc2148.pdf<br />n<br />lpc-arm-book_srn.pdf </div><br /><br /><div class='indent'>IOSETx<br />x can be 0 1 ur choice of port<br /><br />GPIO Port Output Set register. This register<br />controls the state of output pins in<br />conjunction with the IOCLR register. Writing<br />ones produces highs at the corresponding<br />port pins. Writing zeroes has no effect.<br /><br />IOCLR GPIO Port Output Clear register. This<br />register controls the state of output pins.<br />Writing ones produces lows at the<br />corresponding port pins and clears the<br />corresponding bits in the IOSET register.<br />Writing zeroes has no effect.</div><br /><br /><br />IOSET n IOCLR are both 32 bit registers....<br /><br />the above code snippet says value of j will be sent to IOSET now in the IOSET register wherever there is a 1 there will be a high on the corresponding bit of the corresponding port...<br /><br />ex.<br />IOSET1 =0x01 => P1.0 is high<br />IOSET1 = 0x02 => P1.1 high<br />IOSET1 = 0x03 => P1.0 and P1.1 are high<br />IOSET1 = 0x80000000 => P1.31 high ...........<br /><br />important point.......<br /><br />suppose the following sequence<br /><br />IOSET1=0x01;<br />IOSET1 =0x00;<br /><br />what is the output??<br /><br />P1.1 is still high because Writing zeroes has no effect.<br /><br />-----------------------------------------------------<br /><br />all this while we have been trying to use IOs as output pins......<br /><br />but we require them as inputs too.....<br /><br />this is where IOPIN comes in<br /><br />IOPIN ==> GPIO Port Pin value register. The current<br />state of the GPIO configured port pins can<br />always be read from this register, regardless<br />of pin direction.<br /><br />thus consider the sequence....<br /><div class='code_box'>CODE:</div><div class='code_highlight' style='unicode-bidi: embed; direction: ltr'><div class="c" style="font-family: monospace;">IODIR1 =0xFF;<br />IOSET1 = 0x0F;<br />IOCLR1 = 0x02;<br />Int_Buffer = IOPIN1;</div></div><br />value of Int_Buffer = 0x0D...<br /><br /><strong class='bbcode bold'>imp note =></strong><br /><br />IODIR1 =0xFF;<br />=> P1.0 - P1.7 has been configured as output pins......<br />we can not take input at these input...<br /><br />thus look again at the above stated sequence...<br /><br />now if i have a press-2-on switch on pin P1.0... can i read the status????<br /><br /><br />no....<br /><br />the IOPIN1 will still return 0x0D..<br /><br />there fore the IODIR1 shud be written<br />IODIR1 = 0xFE;<br /><br /><strong class='bbcode bold'>Points to remember.....</strong><br /><br /><ol class='bbcode' style='list-style-type: decimal'><li class='bbcode'>status of port pins can only be read thru IOPIN register.....<br /></li><li class='bbcode'>IODIR has a default value of 0x00 so by default port pins are configured as input.<br /></li><li class='bbcode'>change in IOSET register has no effect on IOCLR and vice versa..<br /></li><li class='bbcode'>IODIR IOSET IOCLR IOPIN are all individual 32 bit registers..<br /></li><li class='bbcode'>a pin once configured as output can not be used as input unless the value of corresponding IODIR register is changed.<br /></li><li class='bbcode'>ports in LPC/arm are not bit addressable!!</li></ol><br />this is all about writing to a pin and reading from pins<br /><br />next we will discuss the PINSEL register....]]></description>
<author>shyam&lt;shyam@nospam.com&gt;</author>
<pubDate>Sun, 23 Dec 2007 02:41:31 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4150.html</guid>
</item>
						<item>
						<title>Re: ARM-7TDMI tutorial - Working with GPIOs (LPC21xx)</title>
<link>http://www.8051projects.net/forum-t4150.html</link>
<description><![CDATA[further discussion will be over here..<br /><strong class='bbcode bold'><a class='bbcode' href='http://www.8051projects.net/forum-t4128.html' rel='external'  target='_blank'>http://www.8051projects.net/forum-t4128.html</a></strong>]]></description>
<author>Ajay&lt;contact@nospam.com&gt;</author>
<pubDate>Fri, 28 Dec 2007 11:00:58 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4150.html</guid>
</item>
				</channel>
				</rss>