<?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-02T00:41:40-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-t9579.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9579.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9579.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9579.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9579.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9579.html" />
				</rdf:Seq>
				</items>
				</channel>
						<item rdf:about="http://www.8051projects.net/forum-t9579.html">
						<title>How to program EEPROM correctly? SAved but recall FAILED</title>
						<link>http://www.8051projects.net/forum-t9579.html</link>
						<dc:date>2008-12-02T00:41:40-08:00</dc:date>
						<dc:creator></dc:creator>
						<dc:subject></dc:subject>
						<description>Hi,Ajay, this is my last problem, i already solved the INput problems,for pic12f629, to enable the GPIO 4,5 , you must configure the Internal Clock and other config, as below. __CONFIG   	_CP_OFF &amp; _MCLRE_OFF &amp; _WDT_OFF &amp; _INTRC_OSC_NOCLKOUT &amp; _BODEN_OFF &amp; _CPD_OFF &_PWRTE_OFFThis does not been told in the datasheet.By the way, my new problem is i saved my data (0x01) into eeprom address 0x01, when i recall the data it does not recall the same data but something different from it and sometimes i can save the data and recall correctly but sometimes not.What is the problem? is the setting or code problems? i already DOUBLExDouble check it in the DATASHEET for few hours and look for solutions on internet, i still cant recall correctly, PLEASe HELP.I write the data correctly...everytime, when i check in the EEDATA register b4 i reset the MPLAB SIM and rerun again.Code Below, PIC12F629 ,WRITE code from me,CODE:ORIGINAL_PWM EQU 0x21<br />TEMP EQU 0x22<br />WRITE:&nbsp; BSF&nbsp; &nbsp; &nbsp;STATUS,5; switch to bank 1<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;0x01; go to addr 0x01<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;EEADR;<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVF&nbsp; &nbsp; ORIGINAL_PWM,w&nbsp; ; (ORIGINAL_PWM = 0x01)<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;EEDATA; write 0x01 to EEDATA<br />&nbsp; &nbsp; &nbsp; &nbsp; BSF&nbsp; &nbsp; &nbsp;EECON1,WREN; &lt; follow the datasheet write process<br />&nbsp; &nbsp; &nbsp; &nbsp; BCF&nbsp; &nbsp; &nbsp;INTCON,GIE&nbsp; &nbsp; &nbsp; ;&lt;<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;H'0055'&nbsp;;&lt;<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;EECON2&nbsp; ;&lt;<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;H'00AA' &nbsp; &nbsp; &nbsp; &nbsp; ;&lt;<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;EECON2&nbsp; ;&lt;<br />&nbsp; &nbsp; &nbsp; &nbsp; BSF&nbsp; &nbsp; &nbsp;EECON1,WR&nbsp; &nbsp; &nbsp; &nbsp;;&lt;<br />&nbsp; &nbsp; &nbsp; &nbsp; BSF&nbsp; &nbsp; &nbsp;INTCON,GIE&nbsp; &nbsp; &nbsp; ;&lt;<br />&nbsp; &nbsp; &nbsp; &nbsp; BCF&nbsp; &nbsp; &nbsp;STATUS,5; switch to bank 0<br />&nbsp; &nbsp; &nbsp; &nbsp; RETURN<br /><br />READ:&nbsp; &nbsp;BSF&nbsp; &nbsp; &nbsp;STATUS,5; switch to bank 1<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;0x01; goto addr 0x01 in eeprom<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;EEADR;<br />&nbsp; &nbsp; &nbsp; &nbsp; BSF&nbsp; &nbsp; &nbsp;EECON1,RD&nbsp; &nbsp; &nbsp; &nbsp;; read previously saved data 0x01<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVF&nbsp; &nbsp; EEDATA,w&nbsp; &nbsp; &nbsp; &nbsp; ; move 0x01 to w<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;TEMP; (TEMP register ) move 0x01 to TEMP<br />&nbsp; &nbsp; &nbsp; &nbsp; BCF&nbsp; &nbsp; &nbsp;STATUS,5; switch bank 0<br />&nbsp; &nbsp; &nbsp; &nbsp; RETURNThanks for your help....mmy last problem...</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9579.html">
						<title>Re: How to program EEPROM correctly? SAved but recall FAILED</title>
						<link>http://www.8051projects.net/forum-t9579.html</link>
						<dc:date>2008-12-02T00:41:40-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>after you set WR bit in EECON1 register you need to poll that bit till the writing is finished. Do not confuse writing in flash with writing to EEPROM.When you write in flash, cpu stalls itself till writing is finished so no need to poll in that case, whereas in case of EEPROM, you need to poll the WR bit in EECON1 register. Try again.. use test bit instruction for checking WR bit. Please ask if you still feel any problem working on it.</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9579.html">
						<title>Re: How to program EEPROM correctly? SAved but recall FAILED</title>
						<link>http://www.8051projects.net/forum-t9579.html</link>
						<dc:date>2008-12-02T00:41:40-08:00</dc:date>
						<dc:creator>nicholastyc</dc:creator>
						<dc:subject></dc:subject>
						<description>thank you very much Ajay...i made a statement like this,btfsc EECON1, WR;goto $-1 ;it looks fine... but the main problem still is the MPLAB SIM, when i simulate it in ANIMATION mode, its just keep looping...and u know wat, but i go to the RUN mode, everything just works fine and the EEPROM is saving the data n recall. Hope it will work fine in the PIC after i program it tomorrow, lets c how tomorrow. Thanks for your help.</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9579.html">
						<title>Re: How to program EEPROM correctly? SAved but recall FAILED</title>
						<link>http://www.8051projects.net/forum-t9579.html</link>
						<dc:date>2008-12-02T00:41:40-08:00</dc:date>
						<dc:creator>nicholastyc</dc:creator>
						<dc:subject></dc:subject>
						<description>hi Ajay, wat is poll the WR bit means?i m a newbie here...please explain in asm or meaning of poll the WR bit..thanks!!</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9579.html">
						<title>Re: How to program EEPROM correctly? SAved but recall FAILED</title>
						<link>http://www.8051projects.net/forum-t9579.html</link>
						<dc:date>2008-12-02T00:41:40-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>polling means waiting...it can be done something like this...CODE:wait:<br />&nbsp; &nbsp; &nbsp; &nbsp; btfsc EECON1,WR //skip the next statement if the bit is cleared<br />&nbsp; &nbsp; &nbsp; &nbsp; bra wait &nbsp;//jump back and check again<br />&nbsp; &nbsp; &nbsp; &nbsp; return &nbsp;//return when bit is cleared.<br />&nbsp;</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9579.html">
						<title>Re: How to program EEPROM correctly? SAved but recall FAILED</title>
						<link>http://www.8051projects.net/forum-t9579.html</link>
						<dc:date>2008-12-02T00:41:40-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>try using label instead of $-1I hope it will work..</description>
						</item>
				</rdf:RDF>