yuvarajbe
Newbie level 5
Hi
I am working Interface EEPROM 24C08 with AT89C2051 controller.
I wrote some code for Read/Write the Values(0 to 9) in 24C08.
I am starting with Just counter program which shows Read/Write Values in BCD 7 segment.
Here Problem is for first time it works well when I press P3^5 button.After enter into forloop It wont execute the Read/write operation.For your refernce i have attached Code and simulation which i done.
code:
I am working Interface EEPROM 24C08 with AT89C2051 controller.
I wrote some code for Read/Write the Values(0 to 9) in 24C08.
I am starting with Just counter program which shows Read/Write Values in BCD 7 segment.
Here Problem is for first time it works well when I press P3^5 button.After enter into forloop It wont execute the Read/write operation.For your refernce i have attached Code and simulation which i done.
code:
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 #include "Includes.h" sbit enter = P3^5; void delay_ms1(int); // Function prototype declaration int a[10]={0x00,0x10,0x20,0x30,0x40,0x50,0x60,0x70,0x80,0x90}; void main (void) { unsigned char RxByte,chh1,chh2,c2,c1; unsigned char RxByte1; // if(enter==0){ chh2=2+'0'; Write_Byte_To_24LC64_EEPROM(0x0002, chh2); } // Read from 0x0001 address from EEPROM RxByte1 = Read_Byte_From_24LC64_EEPROM(0x0002); // Read from 0x0001 address from EEPROM [ATTACH=CONFIG]135696._xfImport[/ATTACH] P1=0x04; P1=P1|(a[RxByte1]); delay_ms1(1000); for (c1=(RxByte1);c1<10;c1++) { Write_Byte_To_24LC64_EEPROM(0x0001,c1+0x30);[B]//here is the Problem.It wont write in EEPROM[/B] P1=0x04; P1=P1|(a[c1]); delay_ms1(1000); } ////////////////////////////END//////////////////////////// } void delay_ms1(int secc) { int j1; int i1; for(i1=0;i1<secc;i1++) { for(j1=0;j1<110;j1++) { } } }
Last edited by a moderator: