<?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:37: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-t10090.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t10090.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t10090.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t10090.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t10090.html" />
				</rdf:Seq>
				</items>
				</channel>
						<item rdf:about="http://www.8051projects.net/forum-t10090.html">
						<title>i have problem with the display instruction and EEPROM writing</title>
						<link>http://www.8051projects.net/forum-t10090.html</link>
						<dc:date>2008-12-01T23:37:23-08:00</dc:date>
						<dc:creator></dc:creator>
						<dc:subject></dc:subject>
						<description>hi friends, i m facing a problem with display instruction in mikroC and EEPROM writing problem......  this is my digital code lockprojecthere is my code...........  CODE:<br />unsigned char OPEN&#40;&#41;;<br />unsigned char read_mastercode&#40;&#41;;<br />unsigned char check_code&#40;&#41;;<br />unsigned short take;<br />unsigned short add=0x3F;<br />unsigned char comp_default&#40;&#41;;<br />unsigned int comp_old&#40;&#41;;<br />unsigned char EEPROMwrite&#40;&#41;;<br />void write_defult&#40;&#41;;<br />unsigned short print&#40;&#41;;<br />void error&#40;&#41;;<br />void key_read&#40;&#41;;<br />char var&#91;5&#93;,input&#91;5&#93;;<br />static char var2&#91;5&#93;=&#123;5,4,3,2,1&#125;;<br />unsigned short kp, curX, curY,i=0,j=0,k=0,a=0,l,b=0;<br />unsigned char *text="HI SACHIN !";<br />unsigned char *text1="ENTER PASSWORD";<br />unsigned char *text2="ENTER OLD PASS";<br />//unsigned char *text3="enter "; <br />unsigned char *text4="WRONG PASSWORD";<br />unsigned char *text5="ENTER NEW";<br />unsigned char *text6="press'OK'to SAVE";<br />unsigned char *text7=" Code too Long...";<br />unsigned char *text3="OPENING........";<br />//unsigned char *text9="CLOSED!"; <br />// unsigned char *dis="ERROR...... "; <br />int *pv;<br />void main&#40;&#41; &#123;<br />int lockstatus;<br />// curX=1; <br />curY=0; // For keeping record of the 2x16 LCD cursor position <br />//pv=&amp;var&#091;0]; <br />write_defult&#40;&#41;;<br />Keypad_Init&#40;&amp;PORTB&#41;; // Initialize Keypad on PORTC <br />TRISC=0x00;<br />Delay_ms&#40;100&#41;;<br />TRISD=0x00;<br />Delay_ms&#40;100&#41;;<br />Lcd8_Config&#40;&amp;PORTC,&amp;PORTD,0,2,1,7,6,5,4,3,2,1,0&#41;; // Initialize LCD on PORTB, change to PORTD for EasyPIC4 <br />Lcd8_Cmd&#40;LCD_CLEAR&#41;; // Clear display <br />Lcd8_Cmd&#40;LCD_BLINK_CURSOR_ON&#41;;<br />Lcd8_Cmd&#40;LCD_SECOND_ROW&#41;;<br />Lcd8_Out&#40;1,1,text&#41;;<br />Delay_ms&#40;500&#41;;<br />Lcd8_Out&#40;1,1,text1&#41;;<br />Lcd8_Out&#40;2,1,":"&#41;;<br />do&#123;<br />key_read&#40;&#41;;<br />if&#40;kp==16&#41;<br />&#123; while&#40;k&lt;4&#41;<br />&#123;<br />comp_old&#40;&#41;;<br />&#125;<br />&#125;<br />else if&#40;kp&lt;10&#41;<br />&#123;<br />print&#40;&#41;;<br /><br />&#125;<br /><br /><br /><br />//continue; <br /><br />&#125;while &#40;1&#41;;<br />&#125; //~! <br /><br /><br />unsigned char EEPROMwrite&#40;&#41;<br />&#123; Lcd8_Cmd&#40;LCD_CLEAR&#41;;<br />Lcd8_Out&#40;1,1,text5&#41;;<br />//Lcd8_Out(2,1,text3); <br />INTCON=0;<br />for&#40;i=0;i&lt;5;i++&#41;<br />&#123; key_read&#40;&#41;;<br />if&#40;kp&lt;10&#41;&#123;<br />Lcd8_Chr_CP&#40;kp&#41;;<br />var&#91;i&#93;=kp;<br />&#125;<br />else&#123;i--;&#125;<br />&#125;<br />while&#40;1&#41;<br />&#123;Lcd8_Out&#40;1,1,text6&#41;;<br />key_read&#40;&#41;;<br />if&#40;kp=='C'&#41;<br />&#123;<br />for&#40;i=0;i&lt;6;i++&#41;<br />&#123;<br />EEprom_Write&#40;i,var&#91;i&#93;&#41;;<br /><br />&#125;<br />return&#40;i=0&#41;;<br />&#125;<br /><br />&#125;<br />&#125;<br />/*-------------display-------------*/<br /><br />unsigned short print&#40;&#41;<br />&#123;<br />//if (curY &lt;6) // change cursor position <br /><br />/* if (curX == 1) {<br />Lcd_Cmd(LCD_SECOND_ROW);<br />curX = 2;<br />curY = 1;<br />}<br />else {<br />Lcd_Cmd(LCD_FIRST_ROW);<br />curX = 1;<br />curY = 1;<br />} */<br />// Print on LCD <br />if&#40;kp=='#'&#41;<br />&#123;<br /><br />if&#40;curY&lt;=5&#41;<br />&#123; Lcd8_Chr_CP&#40;kp&#41;;<br />check_code&#40;&#41;;<br />if&#40;b==1&#41;<br />&#123;<br />OPEN&#40;&#41;;<br />Delay_ms&#40;500&#41;;<br /><br />&#125;<br />else<br />&#123;<br />error&#40;&#41;;<br />&#125;<br />&#125;<br />else<br />&#123; Lcd8_Cmd&#40;LCD_CLEAR&#41;;<br />Lcd8_Out&#40;1,1,text7&#41;;<br />Delay_ms&#40;500&#41;;<br />Lcd8_Cmd&#40;LCD_CLEAR&#41;;<br />Lcd8_Out&#40;1,1,text1&#41;;<br />Lcd8_Out&#40;2,1,":"&#41;;<br />&#125;<br />return 0;<br />&#125;<br />Lcd8_Chr_CP&#40;kp&#41;;<br />input&#91;i&#93;=kp;<br />curY++;<br />i++;<br />/* else<br />{<br />if(kp=='#')<br />{<br />Lcd8_Cmd(LCD_CLEAR);<br />Lcd8_Out_Cp("OK");<br />Delay_ms(500);<br />// Lcd8_Cmd(LCD_CLEAR);<br /><br />} */<br /><br /><br />&#125;<br /><br />/*---------------------keypad read-------------------*/<br /><br />void key_read&#40;&#41;<br />&#123;<br />// do { <br />kp = 0;<br /><br />// Wait for key to be pressed and released <br />do &#123;<br />kp = Keypad_Released&#40;&#41;;<br />Delay_ms&#40;10&#41;;<br />&#125;<br />while &#40;!kp&#41;;<br /><br />// Prepare value for output <br />switch &#40;kp&#41; &#123;<br />case 1: kp = '1'; break;<br />case 2: kp = '2'; break;<br />case 3: kp = '3'; break;<br />case 4: kp = 'A'; break;<br />case 5: kp = '4'; break;<br />case 6: kp = '5'; break;<br />case 7: kp = '6'; break;<br />case 8: kp = 'B'; break;<br />case 9: kp = '7'; break;<br />case 10: kp = '8'; break;<br />case 11: kp = '9'; break;<br />case 12: kp = 'C'; break;<br />case 13: kp = '*'; break;<br />case 14: kp = '0'; break;<br />case 15: kp = '#'; break;<br />case 16:16; break;<br />&#125;<br />// }while(1); <br />&#125;<br /><br />/*-----------compare the old password-----------*/<br /><br />unsigned int comp_old&#40;&#41;<br />&#123; Lcd8_Cmd&#40;LCD_CLEAR&#41;;<br />Lcd8_Out&#40;1,1,text2&#41;;<br />Lcd8_Out&#40;2,1,":"&#41;;<br />//Lcd8_Out(2,9,":"); <br /><br />for&#40;i=0;i&lt;5;i++&#41;<br />&#123;<br />key_read&#40;&#41;;<br />Lcd8_Chr_CP&#40;kp&#41;;<br />var&#91;i&#93;=kp;<br /><br />&#125;<br />//a=1; <br /><br />if&#40;a==0&#41;<br />&#123;<br />read_mastercode&#40;&#41;;<br />/* if(a==1)<br />{<br />Lcd8_Out(1,1,text2);<br />} */<br />&#125;<br />if&#40;a==1&#41;&#123;<br />comp_default&#40;&#41;;<br />&#125;<br /><br /><br />return 0;<br />&#125;<br />/*------------default code compare---------*/<br />unsigned char comp_default&#40;&#41;<br />&#123;for&#40;i=0;i&lt;5;i++&#41;<br />&#123;<br />take = Eeprom_Read&#40;add&#41;;<br />if&#40;var&#91;i&#93;==take&#41;<br />&#123;<br />add++;<br />&#125;<br />else<br />&#123;<br />Lcd8_Cmd&#40;LCD_CLEAR&#41;;<br />Lcd8_Out&#40;1,1,text4&#41;;<br />k++;<br />break;<br />&#125;<br />&#125;<br />EEPROMwrite&#40;&#41;;<br />return 0;<br />&#125;<br /><br />/*-----------default code----------------*/<br />void write_defult&#40;&#41;<br />&#123;INTCON=0x00;<br />for&#40;i=0;i&lt;6;i++&#41;<br />&#123;<br />EEprom_Write&#40;add, var2&#91;i&#93;&#41;;<br />add++;<br />&#125;<br />&#125;<br />/*--------------masercode compare----------*/<br />unsigned char read_mastercode&#40;&#41;<br />&#123;for&#40;l=0;l&lt;5;l++&#41;<br />&#123;take=00;<br />take=EEPROM_Read&#40;i&#41; ;<br />if&#40;var&#91;i&#93;==take&#41;<br />&#123;<br />i++;<br />&#125;<br />else<br />&#123; a=1;<br />return a;<br />&#125;<br />&#125;<br />EEPROMwrite&#40;&#41;;<br />&#125;<br />/*-----------verify the code----------------*/<br />unsigned char check_code&#40;&#41;<br />&#123;for&#40;l=0;l&lt;5;l++&#41;<br />&#123;<br />take=00;<br />take=EEPROM_Read&#40;i&#41; ;<br />if&#40;input&#91;i&#93;==take&#41;<br />&#123;<br />i++;<br />&#125;<br />else<br />&#123;<br />Lcd8_Cmd&#40;LCD_CLEAR&#41;;<br />Lcd8_Out&#40;1,1,text4&#41;;<br />k++;<br />return k;<br />&#125;<br />&#125;<br />return b;<br />&#125;<br />/*--------------oening and closig the lock----------*/<br />unsigned char OPEN&#40;&#41;<br />&#123;<br />Lcd8_Out&#40;1,1,text3&#41;;<br />while&#40;1&#41;<br />&#123;<br />key_read&#40;&#41;;<br />if&#40;kp==B&#41;<br />&#123;Lcd8_Cmd&#40;LCD_CLEAR&#41;;<br />Lcd8_Out_Cp&#40;"CLOSED!"&#41;;<br />return 0;<br />&#125;<br />&#125;<br />return 0;<br />&#125;<br /><br /><br />void error&#40;&#41;<br />&#123;<br />Lcd8_Cmd&#40;LCD_CLEAR&#41;;<br />// Lcd8_Out(1,1,dis); <br />&#125;<br /><br /><br />&nbsp; any budy help me with this , this is my digital code lock project..... i m writing the user password in EEPROM.....it looks like its not working .... i m using the PIC16F877A uC......... i m not getting any hex value in EEPROM page while burning the MCU .... if u have such project code then plz send me....</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t10090.html">
						<title>Re: i have problem with the display instruction and EEPROM writing</title>
						<link>http://www.8051projects.net/forum-t10090.html</link>
						<dc:date>2008-12-01T23:37:23-08:00</dc:date>
						<dc:creator>sashijoseph</dc:creator>
						<dc:subject></dc:subject>
						<description>Think he's using the PIC's internal eeprom.Sachin it seems you've written the default code in the eeprom at location 0x3F but are reading from a different address.Can you cross check?And which software are you using to burn the pic(and see the eeprom contents)?</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t10090.html">
						<title>Re: i have problem with the display instruction and EEPROM writing</title>
						<link>http://www.8051projects.net/forum-t10090.html</link>
						<dc:date>2008-12-01T23:37:23-08:00</dc:date>
						<dc:creator>electronicfreak</dc:creator>
						<dc:subject></dc:subject>
						<description>Arun Kumar V wrote ... Hello Sachin, chenna gidhira ?Which EEprom are you using, some i2c eeproms  require the write -protect  pin to be grounded and some connected to Vcc.if your code is correct and you are unable to write to eeprom ,then it may be write -protected, so bring it in unlock mode and try again Arunnanu chennagidiini, nivu hegiddira ...............i m using in built EEPROM , i m programmed it using mikroC compiler.................... but i m not getting it , plz check my code anywhere i made mistake  while coding.......</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t10090.html">
						<title>Re: i have problem with the display instruction and EEPROM writing</title>
						<link>http://www.8051projects.net/forum-t10090.html</link>
						<dc:date>2008-12-01T23:37:23-08:00</dc:date>
						<dc:creator>electronicfreak</dc:creator>
						<dc:subject></dc:subject>
						<description>i m using mikro C for C coding and IC prog for burning the uC.when i was burning the hex code ,i m not getting any hex code in the EEPROM block of IC prog or even in PICflash......PLZ help me...........</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t10090.html">
						<title>Re: i have problem with the display instruction and EEPROM writing</title>
						<link>http://www.8051projects.net/forum-t10090.html</link>
						<dc:date>2008-12-01T23:37:23-08:00</dc:date>
						<dc:creator>Arun Kumar V</dc:creator>
						<dc:subject></dc:subject>
						<description>Hello Sachin, chenna gidhira ?Which EEprom are you using, some i2c eeproms  require the write -protect  pin to be grounded and some connected to Vcc.if your code is correct and you are unable to write to eeprom ,then it may be write -protected, so bring it in unlock mode and try again Arun</description>
						</item>
				</rdf:RDF>