Place EEPROM at byte boundaries in Pic18 series.

Pommie

Well-Known Member
Most Helpful Member
If I take a simple program with bytes placed at word boundaries all works well. No errors,

If I now change it to byte boundaries I get,

Note, the only thing changed is the address where the second byte goes.
The error is on the fourth line up starting ::: error:
It appears that XC8 has decided the EEPROM needs to be on word boundaries like the program memory.

Does anyone know why this is or a work around?

Thanks,

Mike.
 
I just use the inbuilt function
__EPROM_DATA ( x,x,x,x,x); // x is byte size.

The method you are using is aligned. BUT in powers of 2.. So Int Long etc..

In MPLABX in the help file under eedata / Data memory allocatiion.

OR!

const int mydata __at(0xF00000) = 0x55AA;
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…