OE=0;
CE=1;
WE=1;
reset_pin=0;
reset_pin=1;
delay(1);
encode(5,0);
encode(5,1);
encode(5,2);
encode(5,3);
delay(2);
CE=0;
delay(1);
WE=0;
OE=1;
delay(2);
serial_in(0xAA);
delay(5);
WE=1;
delay(1);
CE=1;
delay(1);
reset_pin=0;
reset_pin=1;
delay(1);
encode(2,0);
encode(10,1);
encode(10,2);
encode(10,3);
delay(2);
CE=0;
delay(1);
WE=0;
delay(2);
//OE=1;
serial_in(0x55);
delay(5);
WE=1;
delay(1);
CE=1;
delay(1);
reset_pin=0;
reset_pin=1;
delay(1);
encode(5,0);
encode(5,1);
encode(5,2);
encode(5,3);
delay(2);
CE=0;
delay(1);
WE=0;
delay(2);
//OE=1;
serial_in(0xA0);
delay(5);
WE=1;
delay(1);
CE=1;
delay(1);
OE=0;
the above is my 3-byte sequence of data to be loaded before wrting into the EEPROM. i am using a 16f877 PIC with a 20MHz crystal. i am using 4 74191 counters to help in addressing the EEPROM. the "encode" function does the job of setting teh counter to the correct address. as for the data, i am using a 8-bit univeral shift register. "serial_in" is the function to load the data in to teh shift register. every dealy is around 1 ms. i.e. delay(5) is around 5 ms.
i have tested the the outputs from teh counters and shift registers using a multimeter and teh readings is the same as those i expected.
is there something wrong with my code sequence?