void main() { uchar buf=0; uint i; Init_Device(); serial_init(); // delay05ms(1); buf = EEPROM_ByteRead(0);//读0字节 serial_send(&buf); //串口发送 EEPROM_ByteWrite(0, 0x64); //写0字节为100 buf = 0;//清0 buf = EEPROM_ByteRead(0); //读0字节 serial_send(&buf); //串口发送0字节 led = 0; // clear_24cXX(32768); led = 1; for(i=0;i<32768;i++) { buf = EEPROM_ByteRead(i);//读0字节 serial_send(&buf); //串口发送 } while(1) { ; } }
void test_eeprom(void) { volatile unsigned int i; volatile unsigned char x; EEPROM_Init(EEPROM_ADDR); for(i=0; i < 1;i++ ) { ascii(message[i]); EEPROM_ByteWrite(i, message[i]); EEPROM_AckPolling(); } for(i=0; i < 1;i++ ) { x=EEPROM_RandomRead(i); ascii(x); } }
int main(void) { volatile unsigned int i; volatile unsigned char x; WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer EEPROM_Init(0x50); for(i=0; i < 3;i++ ) { ascii(message[i]); EEPROM_ByteWrite(i, message[i]); EEPROM_AckPolling(); } for(i=0; i < 3;i++ ) { x=EEPROM_RandomRead(i); ascii(x); } }