<?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>2008 Rickey's World</copyright>
				<managingEditor>contact@nospam.com (Ajay Bhargav)</managingEditor>
				<webMaster>contact@nospam.com (Ajay Bhargav)</webMaster>
				<pubDate>Thu, 08 Jan 2009 20:17:58 -0800</pubDate>
				<lastBuildDate>Thu, 08 Jan 2009 20:17:58 -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 Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[consider the following example  replace wait() with any delay routine....<br /><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;"><br /><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 />this is  a very simple code but tells  the main differences  between 51 and arm.....<br />we will discuss  it further till then waiting for ur querries...... <img src='http://www.8051projects.net/e107_images/emotes/yahoo/103.gif' alt='' style='vertical-align:middle; border:0' />  <br />]]></description>
<pubDate>Sat, 22 Dec 2007 10:03:00 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[thnks ajay u r right......<br />i'll edit it..<br /><br /><br />now read....<br /><br />thus IODIR1 = 0xFF000000 => pins P1.24 - P1.31 are configured as output<br /><br />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 22 Dec 2007 11:11:46 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[got it <img src='http://www.8051projects.net/e107_images/emotes/yahoo/1.gif' alt='' style='vertical-align:middle; border:0' />  thank you... <img src='http://www.8051projects.net/e107_images/emotes/yahoo/4.gif' alt='' style='vertical-align:middle; border:0' /> <br />have to click thanks button.. forgot it <img src='http://www.8051projects.net/e107_images/emotes/yahoo/4.gif' alt='' style='vertical-align:middle; border:0' />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 22 Dec 2007 11:15:33 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[would you refer anything to read? anything specific.. <br />about compiler and stuff..]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 22 Dec 2007 10:08:48 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[Also i do not understand this...<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: #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></div></div><br />and <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: #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> &nbsp;</div></div><br /><br />code is really confusing..  <img src='http://www.8051projects.net/e107_images/emotes/yahoo/17.gif' alt='' style='vertical-align:middle; border:0' />  <br />can you give a little insight of various macros like<br />"IOSET1", "IOCLR1" what other options are there..]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 22 Dec 2007 10:17:16 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[is there any thing in the above code that u feel problem in.... <img src='http://www.8051projects.net/e107_images/emotes/yahoo/7.gif' alt='' style='vertical-align:middle; border:0' />  <br />if not then relax......<br />else practice bitwise operations... <img src='http://www.8051projects.net/e107_images/emotes/yahoo/1.gif' alt='' style='vertical-align:middle; border:0' />  <br /><br />imp: <br />just download lpc2148 usermanual     user.manual.lpc2141.lpc2142.lpc2144.lpc2146.lpc2148.pdf  <img src='http://www.8051projects.net/e107_images/emotes/yahoo/1.gif' alt='' style='vertical-align:middle; border:0' />  <br />n <br />lpc-arm-book_srn.pdf]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 22 Dec 2007 10:17:28 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[IOSETx<br />x can be 0 1 ur choice of port<br /><br /><br /> <div class='indent'><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.<br /><br /></div> <br /><br />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 22 Dec 2007 10:22:34 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[so.. if i first make<br />IOCLR1 = 1; // this will make IO pin as 0<br />and then i make<br />IOSET1 = 1; // this will make IO pin as 1<br /><br />So the status of IOCLR1 will also change? after writing 1 to IOSET1?<br />and vise-versa?<br /><br />also in your code..<br />IODIR1 = 0xFF0000; //makes  port 1 as o.p<br />but.. why last 2 byyes are kept 0? i mean..<br />why 0xFF0000 why not 0xFFFFFF  <img src='http://www.8051projects.net/e107_images/emotes/yahoo/7.gif' alt='' style='vertical-align:middle; border:0' />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 22 Dec 2007 10:29:42 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[now for <br /><br /> <div class='indent'><br /> <div class='code_box'>CODE:</div><div class='code_highlight' style='unicode-bidi: embed; direction: ltr'><div class="c" style="font-family: monospace;"><br /><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><br />&nbsp;</div></div> <br /></div> <br /><br />well ARM do not have bit addressable registers   <img src='http://www.8051projects.net/e107_images/emotes/yahoo/2.gif' alt='' style='vertical-align:middle; border:0' />    <br />so u'll have to address the complete 32 bit registers.......<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 /><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 />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 22 Dec 2007 10:35:00 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[nope...........<br /><br />change in IOSET has no effect in IOCLR or IODIR....<br /><br /><br /> <div class='indent'>also in your code..<br />IODIR1 = 0xFF0000; //makes port 1 as o.p<br />but.. why last 2 byyes are kept 0? i mean..<br />why 0xFF0000 why not 0xFFFFFF </div> <br /><br /><br />gud that u noticed.....<br /><br />cause <br /><br />when i say IODIR1 =0x001;  =>  the last bit has been declared  output...<br />so now IOSET1 = 0x0F; => only the last bit is high.....  no effect on others.....<br />thus IODIR1 = 0xFF0000 => pins P1.24 - P1.31 are configured as output<br />interesting???    now we will discuss on one more 32 bit register IOPIN<br /><br />before that ur doubts... <img src='http://www.8051projects.net/e107_images/emotes/yahoo/103.gif' alt='' style='vertical-align:middle; border:0' />  <br /><br />MERGE:<br />yes u can read them any time in your code.....]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 22 Dec 2007 10:46:06 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[that made things more clear <img src='http://www.8051projects.net/e107_images/emotes/yahoo/1.gif' alt='' style='vertical-align:middle; border:0' /> <br />can we read IOSETx and IOCLRx registers?]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 22 Dec 2007 10:45:03 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[as you said about IODIR1..<br />so the number loaded has to be 4bytes..<br />i.e. 0xFF000000<br />instead of 0xFF0000  <img src='http://www.8051projects.net/e107_images/emotes/yahoo/7.gif' alt='' style='vertical-align:middle; border:0' />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 22 Dec 2007 11:04:02 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[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 /><br /> <div class='code_box'>CODE:</div><div class='code_highlight' style='unicode-bidi: embed; direction: ltr'><div class="c" style="font-family: monospace;"><br />IODIR1 =0xFF;<br />IOSET1 = 0x0F;<br />IOCLR1 = 0x02;<br />Int_Buffer = IOPIN1;<br />&nbsp;</div></div> <br /><br />value of  Int_Buffer = 0x0D...<br /><br />imp note =><br /> <div class='indent'><br />IODIR1 =0xFF;<br /></div> <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 /><strong class='bbcode bold'>IODIR1 = 0xFE;</strong><br /><br />points to remember.....<br /><br /><strong class='bbcode bold'>1. status of port pins can only be read thru IOPIN register.....<br />2. IODIR has a default value of 0x00 so by default port pins are configured as input.<br />3. change in IOSET register has no effect on IOCLR and vice versa..<br />4. IODIR IOSET IOCLR IOPIN are all individual 32 bit registers.. <br />5. a pin once configured as output can not be used as input unless the value of corresponding IODIR register is changed.<br />6.ports in LPC/arm are not bit addressable!!</strong><br />this is all about writing to a pin and reading from pins<br /><br />next we will discuss the PINSEL register....<br />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sat, 22 Dec 2007 23:47:53 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[Just see this example <br />Can we dry run this ?]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sun, 23 Dec 2007 03:14:50 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[run what???<br />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sun, 23 Dec 2007 03:15:45 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[Just see this example <br />can we dry run this<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: #808080; font-style: italic;">/*<br />&nbsp; &nbsp; &nbsp; &nbsp; LEDRing.c<br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; Lights a different LED every second.<br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; LEDs are active-low<br />*/</span><br /><br /><br /><span style="color: #339933;">#include &lt;Philips\LPC2148.h&gt; //</span><br /><span style="color: #339933;">#include &lt;Philips\LPC2138.h&gt; //</span><br /><br /><span style="color: #339933;">#define&nbsp;T0PR&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (*((volatile WORD32 *) 0xE000400C))</span><br /><span style="color: #339933;">#define&nbsp;VPBDIV&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (*((volatile WORD32 *) 0xE01FC100))</span><br /><span style="color: #339933;">#define&nbsp;IO1PIN&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (*((volatile WORD32 *) 0xE0028010))</span><br /><span style="color: #339933;">#define&nbsp;IO1SET&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (*((volatile WORD32 *) 0xE0028014))</span><br /><span style="color: #339933;">#define&nbsp;IO1DIR&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (*((volatile WORD32 *) 0xE0028018))</span><br /><span style="color: #339933;">#define&nbsp;IO1CLR&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (*((volatile WORD32 *) 0xE002801C))</span><br /><br /><span style="color: #339933;">#include &quot;Timer0.h&quot;</span><br /><br /><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><br /><span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333;">unsigned</span> <span style="color: #993333;">long</span> pin;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333;">int</span> i;<br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; InitTimer0<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; PINSEL0=<span style="color: #cc66cc;">0</span>;&nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// PINSEL(0,1,2) = 0 configures pins as GPIO</span><br />&nbsp; &nbsp; &nbsp; &nbsp; PINSEL1=<span style="color: #cc66cc;">0</span>;&nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// (probably not necessary: PINSELs default to zero)</span><br />&nbsp; &nbsp; &nbsp; &nbsp; PINSEL2=<span style="color: #cc66cc;">0</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// IOxDIR: setting a bit to one designates the pin as output</span><br />&nbsp; &nbsp; &nbsp; &nbsp; IO0DIR=0xFFFFFFFF;&nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// P0.0-P0.31 are output</span><br />&nbsp; &nbsp; &nbsp; &nbsp; IO1DIR=0x03FF0000;&nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// P1.25-P1.16 are output</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span>;;<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IO1PIN=0xFFFFFFFF;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span>i=<span style="color: #cc66cc;">0</span>,pin=<span style="color: #cc66cc;">1</span>; i&lt;<span style="color: #cc66cc;">32</span>; pin&lt;&lt;= <span style="color: #cc66cc;">1</span>,i++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IO0PIN=~pin;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WaitForNextTick<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IO0PIN=0xFFFFFFFF;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span>pin=0x00010000; pin&lt;=0x02000000; pin &lt;&lt;= <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IO1PIN=~pin;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WaitForNextTick<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br /><span style="color: #66cc66;">&#125;</span></div></div>]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sun, 23 Dec 2007 03:18:37 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[hi  vinay ...<br /><br />consider my previous post   <br /> <div class='indent'><br /><br />points to remember.....<br /><br /><strong class='bbcode bold'>1. status of port pins can only be read thru IOPIN register.....</strong><br /><br /></div> <br /><br />=> IOPIN  can be used only to read pin status..  writing 1 or 0 to them has no effects.. at the pins.....<br />if u have  a gud compiler with approprate warning level..  u wud sure get a warning....<br /><br /><br />so u got the programme wrong n it wont work....]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sun, 23 Dec 2007 03:23:27 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[#define T0PR (*((volatile WORD32 *) 0xE000400C))<br />#define VPBDIV (*((volatile WORD32 *) 0xE01FC100))<br />#define IO1PIN (*((volatile WORD32 *) 0xE0028010))<br />#define IO1SET (*((volatile WORD32 *) 0xE0028014))<br />#define IO1DIR (*((volatile WORD32 *) 0xE0028018))<br />#define IO1CLR (*((volatile WORD32 *) 0xE002801C))<br /><br />Shyam put some light on these .Since I am new to C it will be added advantage for me]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sun, 23 Dec 2007 03:32:13 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[If you are refering  to example posted by me then this is working on board and i am just referring to manual for your comments.<br />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sun, 23 Dec 2007 03:37:51 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[these are register declaration for ARM.]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sun, 23 Dec 2007 03:43:01 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[IO1PIN=0xFFFFFFFF;<br />IO1PIN=0xFFFFFFFF;<br />IO0PIN=~pin;<br />Well as per manual definition above statements should not have any effect on working of program . <br />So if i remove these from program board functioning should remain same .<br />Am i right Shyam?]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sun, 23 Dec 2007 03:45:01 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[vinay...<br />IO1PIN=0xFFFFFFFF; <br /><br />=>  IOSET1 = 0xFFFFFFFF;<br /><br />if IODIR1 = 0xFFFFFFFF;<br /><br />similarly....<br /><br />IO0PIN = ~ pin ..   wil call both IOSET and IOCLR...<br /><br />i didnt want to confuse u so i said u have got it wrong.....<br /><br />ur programme wud work...<br /><br />but as beginner u shud avoid using IOPIN =  statements directly.....<br /><br />better use IOSET and IOCLR...<br />when writing large programmes u will get my point...<br />for the time being ...   nd for ur question...<br />yes u can write to IOPIN and t will internally generate the two sets of instructions  IOSET n IOCLR...   but not recommended..!!<br /><br /><br />thus finally ur programe will run..<br /><br />but i recommend modifications...<br /><br />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sun, 23 Dec 2007 04:02:33 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[#define T0PR (*((volatile WORD32 *) 0xE000400C))<br />#define VPBDIV (*((volatile WORD32 *) 0xE01FC100))<br />#define IO1PIN (*((volatile WORD32 *) 0xE0028010))<br />#define IO1SET (*((volatile WORD32 *) 0xE0028014))<br />#define IO1DIR (*((volatile WORD32 *) 0xE0028018))<br />#define IO1CLR (*((volatile WORD32 *) 0xE002801C))<br /><br />well since u r using SCARM... u have to define the names of register else...<br /><br />u will find them in LPC2138.h<br />volatile (WORD32 * address) refers to a 32 bit address ie. address<br /><br />u neednt bother abt it....<br /><br />they always  remain the same.. <img src='http://www.8051projects.net/e107_images/emotes/yahoo/4.gif' alt='' style='vertical-align:middle; border:0' /> <br /><br />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Sun, 23 Dec 2007 04:22:26 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[well <br /><br />hope now<br />IODIR<br /> IOSET <br />IOCLR <br />IOPIN<br />are all clear now.....<br /><br />now we can start by interfacing a 16 x2 lcd on ARM???<br />this is a very simple programme.. no timers no interrupts nothing...   just GPIOS <img src='http://www.8051projects.net/e107_images/emotes/yahoo/4.gif' alt='' style='vertical-align:middle; border:0' /> <br />it is not an optimised code...  just will give u idea of what can u do with GPIOs<br /><br />here it goes...<br /><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;"><br /><span style="color: #339933;">#include &lt;LPC213X.H&gt;</span><br /><span style="color: #339933;">#include &quot;string.h&quot;</span><br /><span style="color: #339933;">#include &lt;stdio.h&gt;</span><br /><span style="color: #808080; font-style: italic;">/*<br />&nbsp; &nbsp; LCD connections:<br />&nbsp; &nbsp; P0.20 &nbsp; P0.23 &nbsp; P0.19 &nbsp; P0.18 &nbsp; P0.17 &nbsp; P0.16<br />&nbsp; &nbsp; RS &nbsp;EN &nbsp;D7 &nbsp;D6 &nbsp;D5 &nbsp;D4<br />&nbsp; &nbsp; 4 bit interface is used.<br />*/</span><br /><br /><span style="color: #993333;">void</span> SmallDelay <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br /><span style="color: #66cc66;">&#123;</span><br /><span style="color: #808080; font-style: italic;">/*<br />&nbsp; &nbsp; does nothing, but produces small delay due to call and return instructions<br />*/</span><br /><span style="color: #66cc66;">&#125;</span><br /><span style="color: #993333;">void</span> LcdCmd1 <span style="color: #66cc66;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> cmd<span style="color: #66cc66;">&#41;</span><br /><span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; <span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> temp ;<br /><br />&nbsp; &nbsp; IOSET0 = temp = 0x0F0000 &amp; <span style="color: #66cc66;">&#40;</span>cmd &lt;&lt; <span style="color: #cc66cc;">16</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; IOCLR0 = <span style="color: #66cc66;">&#40;</span>temp ^ 0x0F0000<span style="color: #66cc66;">&#41;</span> | 0x900000 ;<br /><br />&nbsp; &nbsp; SmallDelay<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; IOSET0 = 0x800000 ;<br />&nbsp; &nbsp; SmallDelay<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; IOCLR0 = 0x800000 ;<br />&nbsp; &nbsp; SmallDelay<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br /><span style="color: #66cc66;">&#125;</span><br /><span style="color: #993333;">void</span> LcdDat1 <span style="color: #66cc66;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> dat<span style="color: #66cc66;">&#41;</span><br /><span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; <span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> temp ;<br /><br />&nbsp; &nbsp; IOSET0 = temp = <span style="color: #66cc66;">&#40;</span>0x0F0000 &amp; <span style="color: #66cc66;">&#40;</span>dat &lt;&lt; <span style="color: #cc66cc;">16</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> | 0x100000 ;<br />&nbsp; &nbsp; IOCLR0 = <span style="color: #66cc66;">&#40;</span>temp ^ 0x1F0000<span style="color: #66cc66;">&#41;</span> | 0x800000 ;<br /><br />&nbsp; &nbsp; SmallDelay<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; IOSET0 = 0x800000 ;<br />&nbsp; &nbsp; SmallDelay<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; IOCLR0 = 0x800000 ;<br />&nbsp; &nbsp; SmallDelay<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br /><span style="color: #66cc66;">&#125;</span><br /><span style="color: #993333;">void</span> Delay250 <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br /><span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; <span style="color: #993333;">int</span> k ;<br />&nbsp; &nbsp; <span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span>k = <span style="color: #cc66cc;">0</span> ; k &lt; <span style="color: #cc66cc;">100</span> ; k ++<span style="color: #66cc66;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br /><span style="color: #66cc66;">&#125;</span><br /><span style="color: #993333;">void</span> DelayMs <span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> n<span style="color: #66cc66;">&#41;</span><br /><span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; <span style="color: #993333;">int</span> k ;<br />&nbsp; &nbsp; <span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span>k = <span style="color: #cc66cc;">0</span> ; k &lt; n ; k ++<span style="color: #66cc66;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br /><span style="color: #66cc66;">&#125;</span><br /><span style="color: #993333;">void</span> LcdCmd <span style="color: #66cc66;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> cmd<span style="color: #66cc66;">&#41;</span><br /><span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; LcdCmd1<span style="color: #66cc66;">&#40;</span>cmd &gt;&gt; <span style="color: #cc66cc;">4</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; LcdCmd1<span style="color: #66cc66;">&#40;</span>cmd<span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br /><span style="color: #66cc66;">&#125;</span><br /><span style="color: #993333;">void</span> LcdDat <span style="color: #66cc66;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> dat<span style="color: #66cc66;">&#41;</span><br /><span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; LcdDat1<span style="color: #66cc66;">&#40;</span>dat &gt;&gt; <span style="color: #cc66cc;">4</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; LcdDat1<span style="color: #66cc66;">&#40;</span>dat<span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br /><br /><span style="color: #66cc66;">&#125;</span><br /><span style="color: #993333;">void</span> LcdInit <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br /><span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; IODIR0 = 0x9F0000 ;<br />&nbsp; &nbsp; IOCLR0 = 0x9F0000 ;<br />&nbsp; &nbsp; DelayMs<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">15</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; DelayMs<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">15</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; DelayMs<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">15</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; DelayMs<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">15</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; LcdCmd1<span style="color: #66cc66;">&#40;</span>0x03<span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; DelayMs<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">6</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; DelayMs<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">6</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; DelayMs<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">6</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; DelayMs<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">6</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; LcdCmd1<span style="color: #66cc66;">&#40;</span>0x03<span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; LcdCmd1<span style="color: #66cc66;">&#40;</span>0x03<span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; LcdCmd1<span style="color: #66cc66;">&#40;</span>0x02<span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; Delay250<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> ;<br /><br />&nbsp; &nbsp; LcdCmd<span style="color: #66cc66;">&#40;</span>0x28<span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; LcdCmd<span style="color: #66cc66;">&#40;</span>0x08<span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; LcdCmd<span style="color: #66cc66;">&#40;</span>0x0c<span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; LcdCmd<span style="color: #66cc66;">&#40;</span>0x06<span style="color: #66cc66;">&#41;</span> ;<br /><span style="color: #66cc66;">&#125;</span><br /><span style="color: #993333;">void</span> DisplayRow<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> row, <span style="color: #993333;">char</span> *str<span style="color: #66cc66;">&#41;</span><br /><span style="color: #66cc66;">&#123;</span><br /><span style="color: #808080; font-style: italic;">/*<br />&nbsp; &nbsp; pass pointer to 16 character string<br />&nbsp; &nbsp; displayes the message on line1 or line2 of LCD, depending on whether row is 1 or 2.<br />*/</span><br />&nbsp; &nbsp; <span style="color: #993333;">int</span> k ;<br /><br />&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>row == <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; LcdCmd<span style="color: #66cc66;">&#40;</span>0x80<span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; <span style="color: #b1b100;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; LcdCmd<span style="color: #66cc66;">&#40;</span>0xc0<span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; <span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span>k = <span style="color: #cc66cc;">0</span> ; k &lt; <span style="color: #cc66cc;">16</span> ; k ++<span style="color: #66cc66;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>str<span style="color: #66cc66;">&#91;</span>k<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LcdDat<span style="color: #66cc66;">&#40;</span>str<span style="color: #66cc66;">&#91;</span>k<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">break</span> ;<br />&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />&nbsp; &nbsp; <span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span>k &lt; <span style="color: #cc66cc;">16</span><span style="color: #66cc66;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; LcdDat<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">' '</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; k ++ ;<br />&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br /><span style="color: #66cc66;">&#125;</span><br /><br /><span style="color: #993333;">void</span> ClearLine<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> row<span style="color: #66cc66;">&#41;</span><br /><span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; <span style="color: #993333;">char</span> szTemp<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">17</span><span style="color: #66cc66;">&#93;</span> ;<br />&nbsp; &nbsp; sprintf<span style="color: #66cc66;">&#40;</span>szTemp,<span style="color: #ff0000;">&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;</span><span style="color: #66cc66;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; DisplayRow<span style="color: #66cc66;">&#40;</span>row,szTemp<span style="color: #66cc66;">&#41;</span> ;<br /><br /><span style="color: #66cc66;">&#125;</span><br /><br /><span style="color: #993333;">int</span> main<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br /><span style="color: #66cc66;">&#123;</span><br />&nbsp;LcdInit<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br /><br />&nbsp; DisplayRow<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>,<span style="color: #ff0000;">&quot;hello shyam&quot;</span><span style="color: #66cc66;">&#41;</span>;<br /><span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span>;<br /><span style="color: #66cc66;">&#125;</span><br />&nbsp;</div></div> <br /><br />try it out on  a simulators or hardware if u can...<br />before that try and understand the bitwise operations....<br />i 've removed most of the comments...   so u do hve some doubts...<br />that will make ur understanding clearer <img src='http://www.8051projects.net/e107_images/emotes/yahoo/3.gif' alt='' style='vertical-align:middle; border:0' /> <br />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Mon, 24 Dec 2007 05:54:50 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[From little knowledge i have gained recently i wish to convey following <br />1. Since in ARM port pins are not bit addressable we can use IO0SET and IO0CLR as tool to set/reset specific bit in a specific port without bothering about and changing status of other pins in the port . <br />2. Actual time of operation or execution of IO0SET and IO0CLR are different . So if your application desires simultaneous status change of status from set to reset and vice versa then use of IO0SET and IO0CLR may cause error in high resolution time dependent applications .<br />3. Above problem is overcome by using IO0PIN . Unlike IO0SET and IO0CLR where O does not have any effect , 0 does and 1 both update pin status accordingly and time difference is not there as mentioned in point 2<br />4. Since in IO0PIN 0 matters it is very important for programmer to see if there is any possible undesired change in PIN status by using IO0PIN . If yes then necessary corrective/ preventive steps in terms of appropriate BOOLEAN operation is required otherwise it may result in undesired/ unpredictable results.<br />Hence use IO0PIN demands caution and use of IO0SET and IO0CLR is suggested .<br />Shyam please correct if i am wrong and may i request you to start RTC and UART if possible togather or UART first.<br />Shyam start discussion/tutorial on UART]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Fri, 28 Dec 2007 05:24:22 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[all right now...<br /><br />thanks vinay1277 for giving exact summarry  of this tutorial..<br />we shall move on to UAR then....<br /><br />Ajay we shud now close this discussion here ....]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Fri, 28 Dec 2007 05:49:59 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
						<item>
						<title>Re: Arm Development - GPIO tutorial</title>
<link>http://www.8051projects.net/forum-t4128.html</link>
<description><![CDATA[discussion should not be closed..<br />actually u posted in the wrong area..  <img src='http://www.8051projects.net/e107_images/emotes/yahoo/17.gif' alt='' style='vertical-align:middle; border:0' />]]></description>
<author>contact@nospam.com (Ajay Bhargav)</author>
<pubDate>Fri, 28 Dec 2007 06:10:10 -0800</pubDate>
<guid isPermaLink="true">http://www.8051projects.net/forum-t4128.html</guid>
</item>
				</channel>
				</rss>