<?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>2008-12-01T23:21:37-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-t4150.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4150.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t4150.html" />
				</rdf:Seq>
				</items>
				</channel>
						<item rdf:about="http://www.8051projects.net/forum-t4150.html">
						<title>ARM-7TDMI tutorial - Working with GPIOs (LPC21xx)</title>
						<link>http://www.8051projects.net/forum-t4150.html</link>
						<dc:date>2008-12-01T23:21:37-08:00</dc:date>
						<dc:creator></dc:creator>
						<dc:subject></dc:subject>
						<description>consider the following example replace wait() with any delay routine....CODE: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.....</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t4150.html">
						<title>Re: ARM-7TDMI tutorial - Working with GPIOs (LPC21xx)</title>
						<link>http://www.8051projects.net/forum-t4150.html</link>
						<dc:date>2008-12-01T23:21:37-08:00</dc:date>
						<dc:creator>shyam</dc:creator>
						<dc:subject></dc:subject>
						<description>Important for reading:just download lpc2148 usermanual user.manual.lpc2141.lpc2142.lpc2144.lpc2146.lpc2148.pdfnlpc-arm-book_srn.pdf IOSETxx can be 0 1 ur choice of portGPIO 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.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.-----------------------------------------------------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 currentstate of the GPIO configured port pins canalways be read from this register, regardlessof pin direction.thus consider the sequence....CODE:IODIR1 =0xFF;<br />IOSET1 = 0x0F;<br />IOCLR1 = 0x02;<br />Int_Buffer = IOPIN1;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 writtenIODIR1 = 0xFE;Points to remember.....<br />status of port pins can only be read thru IOPIN register.....IODIR has a default value of 0x00 so by default port pins are configured as input.change in IOSET register has no effect on IOCLR and vice versa..IODIR IOSET IOCLR IOPIN are all individual 32 bit registers..a pin once configured as output can not be used as input unless the value of corresponding IODIR register is changed.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-t4150.html">
						<title>Re: ARM-7TDMI tutorial - Working with GPIOs (LPC21xx)</title>
						<link>http://www.8051projects.net/forum-t4150.html</link>
						<dc:date>2008-12-01T23:21:37-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>further discussion will be over here..http://www.8051projects.net/forum-t4128.html</description>
						</item>
				</rdf:RDF>