Re: 使用MCC,XC8的DATAEE操作

作者 Edison_yu 於 2018年01月03日 09:00:09
覺得你可以用uint32_t的data type來放,
舉個例子115200的baud rate用一個union的架構來做,
union
{
uint32_t BaudRate;
uint8_t Byte[4];
}Uart;

Uart.BaudRate = 115200;


eeprom_write(0x00, Uart.Byte[0]);
eeprom_write(0x01, Uart.Byte[1]);
eeprom_write(0x02, Uart.Byte[2]);
eeprom_write(0x03, Uart.Byte[3]);

Uart.Byte[0] = eeprom_read(0x00);
Uart.Byte[1] = eeprom_read(0x01);
Uart.Byte[2] = eeprom_read(0x02);
Uart.Byte[3] = eeprom_read(0x03);

EUSART1_Initialize(Uart.BaudRate);

來自: http://www.microchip.com.tw/newbb/viewtopic.php?forum=1&topic_id=22165&post_id=77641