Steve Church

simple pointer question CW5.7 9s08re16

Discussion created by Steve Church on Feb 11, 2008
Latest reply on Feb 11, 2008 by Brett Wallace
I want to store a char variable into an int address (storeing data byte to Flash) and call a routine

void di_in_ram(unsigned char command, unsigned int address, unsigned char data)

where "command" is put into one of the flash registers to tell it what action is required (erase or write)
"address" is the 16 bit address I want to write to
"data is the 8 bit byte to be written.

I know this involves pointers and I have read C books and tried various code which either produces compiler errors or fails to work (I won't bore you with them).

Could someone tell me how to achieve this. It's probably just two or three lines of code, but, for the life of me, I can't seem to get it sorted. It must be a Monday morning thing, or else I'm just getting too old!!!

Steve

Outcomes