<?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-07T22:02:29-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-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4128.html" />
				</rdf:Seq>
				</items>
				</channel>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator></dc:creator>
						<dc:subject></dc:subject>
						<description>consider the following example  replace wait() with any delay routine.... CODE:<br />int main &#40;void&#41; &nbsp;<br />&#123;<br />&nbsp; unsigned int j; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/* LED var */<br /><br />&nbsp; IODIR1 = 0xFF0000; &nbsp; &nbsp;/* P1.16..23 defined as Outputs */<br /><br />&nbsp; init_timer&#40;&#41;;<br /><br />&nbsp;while &#40;1&#41; &nbsp;<br />&#123; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/* Loop forever */<br />&nbsp; &nbsp; for &#40;j = 0x010000; j &lt; 0x800000; j &lt;&lt;= 1&#41; &#123; /* Blink LED 0,1,2,3,4,5,6 */<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; /* Turn on LED */<br />&nbsp; &nbsp; &nbsp; wait &#40;&#41;; &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;/* call wait function */<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;/* Turn off LED */<br />&nbsp; &nbsp; &#125;<br />&nbsp; &nbsp; for &#40;j = 0x800000; j > 0x010000; j >>=1 &#41; &#123; /* Blink LED 7,6,5,4,3,2,1 */<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;/* Turn on LED */<br />&nbsp; &nbsp; &nbsp; wait &#40;&#41;; &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; /* call wait function */<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; /* Turn off LED */<br />&nbsp; &nbsp; &#125;<br />&nbsp; &#125;<br />&#125; this is  a very simple code but tells  the main differences  between 51 and arm.....we will discuss  it further till then waiting for ur querries......</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>shyam</dc:creator>
						<dc:subject></dc:subject>
						<description>thnks ajay u r right......i'll edit it..now read....thus IODIR1 = 0xFF000000 => pins P1.24 - P1.31 are configured as output</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>got it   thank you...  have to click thanks button.. forgot it</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>would you refer anything to read? anything specific.. about compiler and stuff..</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>Also i do not understand this...CODE:for &#40;j = 0x010000; j &lt; 0x800000; j &lt;&lt;= 1&#41;and CODE:for &#40;j = 0x800000; j > 0x010000; j >>=1 &#41; &nbsp;code is really confusing..    can you give a little insight of various macros like"IOSET1", "IOCLR1" what other options are there..</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>shyam</dc:creator>
						<dc:subject></dc:subject>
						<description>is there any thing in the above code that u feel problem in....   if not then relax......else practice bitwise operations...   imp: just download lpc2148 usermanual     user.manual.lpc2141.lpc2142.lpc2144.lpc2146.lpc2148.pdf    n lpc-arm-book_srn.pdf</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>shyam</dc:creator>
						<dc:subject></dc:subject>
						<description>IOSETxx can be 0 1 ur choice of port GPIO Port Output Set register. This registercontrols the state of output pins inconjunction with the IOCLR register. Writingones produces highs at the correspondingport pins. Writing zeroes has no effect.IOCLR GPIO Port Output Clear register. Thisregister controls the state of output pins.Writing ones produces lows at thecorresponding port pins and clears thecorresponding bits in the IOSET register.Writing zeroes has no effect.</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>so.. if i first makeIOCLR1 = 1; // this will make IO pin as 0and then i makeIOSET1 = 1; // this will make IO pin as 1So the status of IOCLR1 will also change? after writing 1 to IOSET1?and vise-versa?also in your code..IODIR1 = 0xFF0000; //makes  port 1 as o.pbut.. why last 2 byyes are kept 0? i mean..why 0xFF0000 why not 0xFFFFFF</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>shyam</dc:creator>
						<dc:subject></dc:subject>
						<description>now for   CODE:<br />for &#40;j = 0x010000; j &lt; 0x800000; j &lt;&lt;= 1&#41;<br />&nbsp;  well ARM do not have bit addressable registers       so u'll have to address the complete 32 bit registers.......IOSET n IOCLR are both 32 bit registers....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...ex.IOSET1 =0x01 =>  P1.0 is highIOSET1 = 0x02 => P1.1 highIOSET1 = 0x03 => P1.0 and P1.1 are highIOSET1 = 0x80000000 => P1.31  high ...........important point.......suppose  the following sequenceIOSET1=0x01;IOSET1 =0x00;what is the output??P1.1  is still high because  Writing zeroes has no effect.</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>shyam</dc:creator>
						<dc:subject></dc:subject>
						<description>nope...........change in IOSET has no effect in IOCLR or IODIR.... also in your code..IODIR1 = 0xFF0000; //makes port 1 as o.pbut.. why last 2 byyes are kept 0? i mean..why 0xFF0000 why not 0xFFFFFF  gud that u noticed.....cause when i say IODIR1 =0x001;  =>  the last bit has been declared  output...so now IOSET1 = 0x0F; => only the last bit is high.....  no effect on others.....thus IODIR1 = 0xFF0000 => pins P1.24 - P1.31 are configured as outputinteresting???    now we will discuss on one more 32 bit register IOPINbefore that ur doubts...   MERGE:yes u can read them any time in your code.....</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>that made things more clear  can we read IOSETx and IOCLRx registers?</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>as you said about IODIR1..so the number loaded has to be 4bytes..i.e. 0xFF000000instead of 0xFF0000</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>shyam</dc:creator>
						<dc:subject></dc:subject>
						<description>all this while we have been trying to use IOs as output pins......but we require them as inputs too.....this is where IOPIN comes inIOPIN           ==>                                      GPIO Port Pin value register. The current                                                          state of the GPIO configured port pins can                                                          always be read from this register, regardless                                                           of pin direction.thus consider the sequence.... CODE:<br />IODIR1 =0xFF;<br />IOSET1 = 0x0F;<br />IOCLR1 = 0x02;<br />Int_Buffer = IOPIN1;<br />&nbsp; value of  Int_Buffer = 0x0D...imp note => IODIR1 =0xFF; =>  P1.0 - P1.7 has been configured as output pins......we can not take input at these input...thus look again at the above stated sequence...now if i have a press-2-on switch on pin P1.0...   can i read the status????no....the IOPIN1 will still return 0x0D..there fore the IODIR1 shud be written IODIR1 = 0xFE;points to remember.....1. status of port pins can only be read thru IOPIN register.....2. IODIR has a default value of 0x00 so by default port pins are configured as input.3. change in IOSET register has no effect on IOCLR and vice versa..4. IODIR IOSET IOCLR IOPIN are all individual 32 bit registers.. 5. a pin once configured as output can not be used as input unless the value of corresponding IODIR register is changed.6.ports in LPC/arm are not bit addressable!!this is all about writing to a pin and reading from pinsnext we will discuss the PINSEL register....</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>vinay1277</dc:creator>
						<dc:subject></dc:subject>
						<description>Just see this example Can we dry run this ?</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>shyam</dc:creator>
						<dc:subject></dc:subject>
						<description>run what???</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>vinay1277</dc:creator>
						<dc:subject></dc:subject>
						<description>Just see this example can we dry run thisCODE:/*<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 />*/<br /><br /><br />#include &lt;Philips\LPC2148.h> //<br />#include &lt;Philips\LPC2138.h> //<br /><br />#define&nbsp;T0PR&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (*((volatile WORD32 *) 0xE000400C))<br />#define&nbsp;VPBDIV&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (*((volatile WORD32 *) 0xE01FC100))<br />#define&nbsp;IO1PIN&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (*((volatile WORD32 *) 0xE0028010))<br />#define&nbsp;IO1SET&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (*((volatile WORD32 *) 0xE0028014))<br />#define&nbsp;IO1DIR&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (*((volatile WORD32 *) 0xE0028018))<br />#define&nbsp;IO1CLR&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (*((volatile WORD32 *) 0xE002801C))<br /><br />#include "Timer0.h"<br /><br />int main&#40;void&#41;<br />&#123;<br />&nbsp; &nbsp; &nbsp; &nbsp; unsigned long pin;<br />&nbsp; &nbsp; &nbsp; &nbsp; int i;<br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; InitTimer0&#40;&#41;;<br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; PINSEL0=0;&nbsp; &nbsp; &nbsp; // PINSEL(0,1,2) = 0 configures pins as GPIO<br />&nbsp; &nbsp; &nbsp; &nbsp; PINSEL1=0;&nbsp; &nbsp; &nbsp; // (probably not necessary: PINSELs default to zero)<br />&nbsp; &nbsp; &nbsp; &nbsp; PINSEL2=0;<br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; // IOxDIR: setting a bit to one designates the pin as output<br />&nbsp; &nbsp; &nbsp; &nbsp; IO0DIR=0xFFFFFFFF;&nbsp; &nbsp; &nbsp; // P0.0-P0.31 are output<br />&nbsp; &nbsp; &nbsp; &nbsp; IO1DIR=0x03FF0000;&nbsp; &nbsp; &nbsp; // P1.25-P1.16 are output<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; for&#40;;;&#41; &#123;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IO1PIN=0xFFFFFFFF;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for&#40;i=0,pin=1; i&lt;32; pin&lt;&lt;= 1,i++&#41; &#123;<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&#40;&#41;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#125;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IO0PIN=0xFFFFFFFF;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for&#40;pin=0x00010000; pin&lt;=0x02000000; pin &lt;&lt;= 1&#41; &#123;<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&#40;&#41;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#125;<br />&nbsp; &nbsp; &nbsp; &nbsp; &#125;<br />&#125;</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>shyam</dc:creator>
						<dc:subject></dc:subject>
						<description>hi  vinay ...consider my previous post    points to remember.....1. status of port pins can only be read thru IOPIN register..... => IOPIN  can be used only to read pin status..  writing 1 or 0 to them has no effects.. at the pins.....if u have  a gud compiler with approprate warning level..  u wud sure get a warning....so u got the programme wrong n it wont work....</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>vinay1277</dc:creator>
						<dc:subject></dc:subject>
						<description>#define T0PR (*((volatile WORD32 *) 0xE000400C))#define VPBDIV (*((volatile WORD32 *) 0xE01FC100))#define IO1PIN (*((volatile WORD32 *) 0xE0028010))#define IO1SET (*((volatile WORD32 *) 0xE0028014))#define IO1DIR (*((volatile WORD32 *) 0xE0028018))#define IO1CLR (*((volatile WORD32 *) 0xE002801C))Shyam put some light on these .Since I am new to C it will be added advantage for me</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>vinay1277</dc:creator>
						<dc:subject></dc:subject>
						<description>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.</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>these are register declaration for ARM.</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>vinay1277</dc:creator>
						<dc:subject></dc:subject>
						<description>IO1PIN=0xFFFFFFFF;IO1PIN=0xFFFFFFFF;IO0PIN=~pin;Well as per manual definition above statements should not have any effect on working of program . So if i remove these from program board functioning should remain same .Am i right Shyam?</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>shyam</dc:creator>
						<dc:subject></dc:subject>
						<description>vinay...IO1PIN=0xFFFFFFFF; =>  IOSET1 = 0xFFFFFFFF;if IODIR1 = 0xFFFFFFFF;similarly....IO0PIN = ~ pin ..   wil call both IOSET and IOCLR...i didnt want to confuse u so i said u have got it wrong.....ur programme wud work...but as beginner u shud avoid using IOPIN =  statements directly.....better use IOSET and IOCLR...when writing large programmes u will get my point...for the time being ...   nd for ur question...yes u can write to IOPIN and t will internally generate the two sets of instructions  IOSET n IOCLR...   but not recommended..!!thus finally ur programe will run..but i recommend modifications...</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>shyam</dc:creator>
						<dc:subject></dc:subject>
						<description>#define T0PR (*((volatile WORD32 *) 0xE000400C))#define VPBDIV (*((volatile WORD32 *) 0xE01FC100))#define IO1PIN (*((volatile WORD32 *) 0xE0028010))#define IO1SET (*((volatile WORD32 *) 0xE0028014))#define IO1DIR (*((volatile WORD32 *) 0xE0028018))#define IO1CLR (*((volatile WORD32 *) 0xE002801C))well since u r using SCARM... u have to define the names of register else...u will find them in LPC2138.hvolatile (WORD32 * address) refers to a 32 bit address ie. addressu neednt bother abt it....they always  remain the same..</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>shyam</dc:creator>
						<dc:subject></dc:subject>
						<description>well hope nowIODIR IOSET IOCLR IOPINare all clear now.....now we can start by interfacing a 16 x2 lcd on ARM???this is a very simple programme.. no timers no interrupts nothing...   just GPIOS  it is not an optimised code...  just will give u idea of what can u do with GPIOshere it goes... CODE:<br />#include &lt;LPC213X.H><br />#include "string.h"<br />#include &lt;stdio.h><br />/*<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 />*/<br /><br />void SmallDelay &#40;&#41;<br />&#123;<br />/*<br />&nbsp; &nbsp; does nothing, but produces small delay due to call and return instructions<br />*/<br />&#125;<br />void LcdCmd1 &#40;unsigned char cmd&#41;<br />&#123;<br />&nbsp; &nbsp; unsigned int temp ;<br /><br />&nbsp; &nbsp; IOSET0 = temp = 0x0F0000 &amp; &#40;cmd &lt;&lt; 16&#41; ;<br />&nbsp; &nbsp; IOCLR0 = &#40;temp ^ 0x0F0000&#41; | 0x900000 ;<br /><br />&nbsp; &nbsp; SmallDelay&#40;&#41; ;<br />&nbsp; &nbsp; IOSET0 = 0x800000 ;<br />&nbsp; &nbsp; SmallDelay&#40;&#41; ;<br />&nbsp; &nbsp; IOCLR0 = 0x800000 ;<br />&nbsp; &nbsp; SmallDelay&#40;&#41; ;<br />&#125;<br />void LcdDat1 &#40;unsigned char dat&#41;<br />&#123;<br />&nbsp; &nbsp; unsigned int temp ;<br /><br />&nbsp; &nbsp; IOSET0 = temp = &#40;0x0F0000 &amp; &#40;dat &lt;&lt; 16&#41;&#41; | 0x100000 ;<br />&nbsp; &nbsp; IOCLR0 = &#40;temp ^ 0x1F0000&#41; | 0x800000 ;<br /><br />&nbsp; &nbsp; SmallDelay&#40;&#41; ;<br />&nbsp; &nbsp; IOSET0 = 0x800000 ;<br />&nbsp; &nbsp; SmallDelay&#40;&#41; ;<br />&nbsp; &nbsp; IOCLR0 = 0x800000 ;<br />&nbsp; &nbsp; SmallDelay&#40;&#41; ;<br />&#125;<br />void Delay250 &#40;&#41;<br />&#123;<br />&nbsp; &nbsp; int k ;<br />&nbsp; &nbsp; for&#40;k = 0 ; k &lt; 100 ; k ++&#41;<br />&nbsp; &nbsp; &#123;<br />&nbsp; &nbsp; &#125;<br />&#125;<br />void DelayMs &#40;int n&#41;<br />&#123;<br />&nbsp; &nbsp; int k ;<br />&nbsp; &nbsp; for&#40;k = 0 ; k &lt; n ; k ++&#41;<br />&nbsp; &nbsp; &#123;<br />&nbsp; &nbsp; &nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; &#125;<br />&#125;<br />void LcdCmd &#40;unsigned char cmd&#41;<br />&#123;<br />&nbsp; &nbsp; LcdCmd1&#40;cmd >> 4&#41; ;<br />&nbsp; &nbsp; LcdCmd1&#40;cmd&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&#125;<br />void LcdDat &#40;unsigned char dat&#41;<br />&#123;<br />&nbsp; &nbsp; LcdDat1&#40;dat >> 4&#41; ;<br />&nbsp; &nbsp; LcdDat1&#40;dat&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br /><br />&#125;<br />void LcdInit &#40;&#41;<br />&#123;<br />&nbsp; &nbsp; IODIR0 = 0x9F0000 ;<br />&nbsp; &nbsp; IOCLR0 = 0x9F0000 ;<br />&nbsp; &nbsp; DelayMs&#40;15&#41; ;<br />&nbsp; &nbsp; DelayMs&#40;15&#41; ;<br />&nbsp; &nbsp; DelayMs&#40;15&#41; ;<br />&nbsp; &nbsp; DelayMs&#40;15&#41; ;<br />&nbsp; &nbsp; LcdCmd1&#40;0x03&#41; ;<br />&nbsp; &nbsp; DelayMs&#40;6&#41; ;<br />&nbsp; &nbsp; DelayMs&#40;6&#41; ;<br />&nbsp; &nbsp; DelayMs&#40;6&#41; ;<br />&nbsp; &nbsp; DelayMs&#40;6&#41; ;<br />&nbsp; &nbsp; LcdCmd1&#40;0x03&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; LcdCmd1&#40;0x03&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; LcdCmd1&#40;0x02&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br />&nbsp; &nbsp; Delay250&#40;&#41; ;<br /><br />&nbsp; &nbsp; LcdCmd&#40;0x28&#41; ;<br />&nbsp; &nbsp; LcdCmd&#40;0x08&#41; ;<br />&nbsp; &nbsp; LcdCmd&#40;0x0c&#41; ;<br />&nbsp; &nbsp; LcdCmd&#40;0x06&#41; ;<br />&#125;<br />void DisplayRow&#40;int row, char *str&#41;<br />&#123;<br />/*<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 />*/<br />&nbsp; &nbsp; int k ;<br /><br />&nbsp; &nbsp; if &#40;row == 1&#41;<br />&nbsp; &nbsp; &nbsp; &nbsp; LcdCmd&#40;0x80&#41; ;<br />&nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; LcdCmd&#40;0xc0&#41; ;<br />&nbsp; &nbsp; for&#40;k = 0 ; k &lt; 16 ; k ++&#41;<br />&nbsp; &nbsp; &#123;<br />&nbsp; &nbsp; &nbsp; &nbsp; if &#40;str&#91;k&#93;&#41;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LcdDat&#40;str&#91;k&#93;&#41; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break ;<br />&nbsp; &nbsp; &#125;<br />&nbsp; &nbsp; while&#40;k &lt; 16&#41;<br />&nbsp; &nbsp; &#123;<br />&nbsp; &nbsp; &nbsp; &nbsp; LcdDat&#40;' '&#41; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; k ++ ;<br />&nbsp; &nbsp; &#125;<br />&#125;<br /><br />void ClearLine&#40;int row&#41;<br />&#123;<br />&nbsp; &nbsp; char szTemp&#91;17&#93; ;<br />&nbsp; &nbsp; sprintf&#40;szTemp," &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"&#41; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; DisplayRow&#40;row,szTemp&#41; ;<br /><br />&#125;<br /><br />int main&#40;&#41;<br />&#123;<br />&nbsp;LcdInit&#40;&#41;;<br /><br />&nbsp; DisplayRow&#40;1,"hello shyam"&#41;;<br />return 0;<br />&#125;<br />&nbsp; try it out on  a simulators or hardware if u can...before that try and understand the bitwise operations....i 've removed most of the comments...   so u do hve some doubts...that will make ur understanding clearer</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>vinay1277</dc:creator>
						<dc:subject></dc:subject>
						<description>From little knowledge i have gained recently i wish to convey following 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 . 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 .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 24. 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.Hence use IO0PIN demands caution and use of IO0SET and IO0CLR is suggested .Shyam please correct if i am wrong and may i request you to start RTC and UART if possible togather or UART first.Shyam start discussion/tutorial on UART</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>shyam</dc:creator>
						<dc:subject></dc:subject>
						<description>all right now...thanks vinay1277 for giving exact summarry  of this tutorial..we shall move on to UAR then....Ajay we shud now close this discussion here ....</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4128.html">
						<title>Re: Arm Development - GPIO tutorial</title>
						<link>http://www.8051projects.net/forum-t4128.html</link>
						<dc:date>2009-01-07T22:02:29-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>discussion should not be closed..actually u posted in the wrong area..</description>
						</item>
				</rdf:RDF>