Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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,
1715833095569.png

If I now change it to byte boundaries I get,
1715833256755.png

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;
 

Latest threads

Back
Top