These are the signals when I transfer 0x0070 (0x0070 0x0070 | 0x0000) with an address (0x0070) , Mode (write = 0x0000) and 0xff for a data.
Does anyone know how to write the read data from MikroC. I want to check base on the MCU. I wrote like that but it is not work.
Code:
unsigned char SL900A_Read(unsigned int uirMode, unsigned int uirAddress){
unsigned char ucResult;
SEN = 1;
delay_us(300);
uiTemp = uirAddress | uirMode;
SPI1_Write(uiTemp >> 8);
SPI1_Write(uirAddress & 0x00FF);
delay_us(300);
ucResult= SPI1_Read(0);
delay_ms(1);
SEN = 0;
return ucResult;
}
20 ms delay should be used between successive read or write to eeprom. Also GIE_bit has to be turned OFF before eeprom operation and it has to be enabled if needed after eeprom operation.