*(volatile unsigned char*)0x1400 = data;
with 0x1400 being the first address of EEPROM for my device(MC9S08DZ60) and data being defined as an int, with: typedef unsigned int word;
When data is an int less than 255, a byte, everything writes fine. And when reading the data back with:
data = *(volatile unsigned char*)0x1400;
data is correct.
However, when data is more than 255, it ends up writing as the original data-255-1, and gets recalled as such. When I change the dereferenced pointer to:
*(volatile unsigned int*)0x1400 = data;
in the any of the functions, it compiles but in debug everything fails and the error bits get set in FSTAT. Any suggestions?
Message Edited by bdayberr on 2008-02-24 12:52 AM