Thet Myint

HC08: EEPROM write

Discussion created by Thet Myint on Dec 13, 2006
Latest reply on Dec 17, 2006 by bigmac
Hello,

I guess, this is something they didn't teach in engineering school, or i must have slept througth the class.
i am just trying to write enable an eeprom through spi. Heres a part of the code

CS_PROM_ClrVal(); // select the chip low
Cpu_Delay100US(1);
spiok = SM1_SendChar(WREN); //WREN is defined as 6 (0000 0110)instruction format
CS_PROM_SetVal(); // deselect the chip
Cpu_Delay100US(TBD);

Q 1) it seems that the SPI doesn't work without putting a short delay after selecting the chip low. Also, after sending this char, does there have to be a delay before letting the chip go ?
Q 2) is the correct instruction format being send this way ? or does the char have to be put in and officially declared as char ' ' ?

Message Edited by CrasyCat on 2007-04-13 11:22 AM

Outcomes