2011-02-14 12:10 AM
Cosmic and @eeprom
2011-05-17 06:11 AM
I'm using EEPROM in different way. I'm not sure that just declare variable in eeprom arae.
here is my source code
void EEPROM_WRITE(u16 addr,u8 data){
FLASH_Unlock(FLASH_MEMTYPE_DATA);
addr = 0x4000 + addr;
FLASH_ProgramByte(addr, data);
FLASH_Lock(FLASH_MEMTYPE_DATA);
}
u8 EEPROM_Read(u16 addr){
u8 returndata;
FLASH_Unlock(FLASH_MEMTYPE_DATA);
addr = 0x4000 + addr;
returndata = FLASH_ReadByte(addr);
FLASH_Lock(FLASH_MEMTYPE_DATA);
return returndata;
}
to use EEPROM in my way you need to include STM8S_FLASH.C and .H from ST Standard Library into your project
Saran
2011-05-17 06:11 AM
Hi,
from the user manual, page 51: **** The library routines are also using a few external symbols to locate the command registers in the I/O register space. When a standard header file provided with the compiler is included in at least one source file of the application, these symbols are automatically found. Otherwise, it is necessary to provide these symbols either by extra C declarations... **** Regards, Luca