Anders Johansson

S12X and reading  >64 K of flash in one loop

Discussion created by Anders Johansson on Jan 22, 2012
Latest reply on Jan 23, 2012 by kef

I want to read many pages of flash in a single loop.

 

I declared:

unsigned short *far pGetAddressPoi; // FAR Pointer to a word variable

 

And load the pointer like this:

pGetAddressPoi = (unsigned short *far) 0x788000; // Point to word at global address

 

This works, for 64 K,

but how do I "add 0x1_0000" to the 16 bit pointer,

to read from 79_8000, 7A_8000 etc.

 

I tried incrementing GPAGE, but it is stuck at 0x78.

 

What am I doing wrong?

 

Thanks,

Anders J

Outcomes