<?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-07T18:40:23-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-t10966.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t10966.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t10966.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t10966.html" />
				</rdf:Seq>
				</items>
				</channel>
						<item rdf:about="http://www.8051projects.net/forum-t10966.html">
						<title>Begineer need help about GPIO, PLEASE</title>
						<link>http://www.8051projects.net/forum-t10966.html</link>
						<dc:date>2009-01-07T18:40:23-08:00</dc:date>
						<dc:creator></dc:creator>
						<dc:subject></dc:subject>
						<description>I'm new in arm, i don't quite understand about in the IOPIN...for example,#define	  LED	 1&lt;&lt;24#define   KEY1	1&lt;&lt;16int  main(void){  	 unsigned int key = 0;		PINSEL0 = 0;		       	PINSEL1 = 0;	IO0DIR = LED;	IO0SET = 0x1010000; //set both P0.24 &amp; P0.16 to high	while(1)	   	{  	    key = IO0PIN;            if(key==?) //key is pressed, will be "0"            ...            ...   	}}i got a button and a led connected to P0.16 and P0.24, and i would like to read the status of the button in order to turn a led. but what value actually i need to put in the question mark??don't know if i miss understand the concept..... thank you</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t10966.html">
						<title>Re: Begineer need help about GPIO, PLEASE</title>
						<link>http://www.8051projects.net/forum-t10966.html</link>
						<dc:date>2009-01-07T18:40:23-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>its like this..CODE:if&#40;key&&#40;key1&#41;&#41;&#123;<br />&nbsp; &nbsp;//not pressed<br />&#125;<br />else&#123;<br />&nbsp; &nbsp;//Pressed<br />&#125;<br />&nbsp;</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t10966.html">
						<title>Re: Begineer need help about GPIO, PLEASE</title>
						<link>http://www.8051projects.net/forum-t10966.html</link>
						<dc:date>2009-01-07T18:40:23-08:00</dc:date>
						<dc:creator>mikemike</dc:creator>
						<dc:subject></dc:subject>
						<description>thank you, but i still confuse about it. if it is IO0SET = 0x1010000, so IO0PIN will read back 0x1010000?? also i don't quite understand the use of "key&amp;(key1)"if IO0PIN really read back 0x1010000, and "&amp;" with key1 it becomes key1 that means the button is not pressed. if the button is pressed, it becomes 0.don't know if i make it wrong, thank you</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t10966.html">
						<title>Re: Begineer need help about GPIO, PLEASE</title>
						<link>http://www.8051projects.net/forum-t10966.html</link>
						<dc:date>2009-01-07T18:40:23-08:00</dc:date>
						<dc:creator>shyam</dc:creator>
						<dc:subject></dc:subject>
						<description>you can try like this.. and hope it explians itself..CODE:<br />#define LED 1&lt;&lt;24<br />#define KEY1 1&lt;&lt;16<br /><br />int main&#40;void&#41;<br />&#123;<br />unsigned int key = 0;<br /><br />PINSEL0 = 0;<br />PINSEL1 = 0;<br /><br />IO0DIR = LED; // shyam: LED pin set as output.. other pins default to input<br />&nbsp;<br />IO0SET = 0x1010000; //set both P0.24 &amp; P0.16 to high<br /><br />while&#40;1&#41;<br />&#123;<br />key = IO0PIN;<br />if&#40;&#40;key&key1&#41;==key1&#41; //key is pressed, will be "0"<br />...<br />...<br />&#125;<br />&#125;<br />&nbsp;now while only the led pin is set as output pin..it will efffect ony the led not the key1so if u want the key1 to be effective high u will have to doIODIR1 = Key1| Led1;IOSET1 = Key1;//and then again make key as input IODIR1 = Led1;hope that clears  abit of your doubts...</description>
						</item>
				</rdf:RDF>