void flashByteWrite (FLADDR addr,char byte, bit SFLE){
bit EA_SAVE = EA;// preserve EAchar xdata * data pwrite;// FLASH write pointer
EA =0;// disable interrupts
FLSCL |=0x01;// enable FLASH writes/erases
PSCTL |=0x01;// PSWE = 1
RSTSRC =0x02;// enable VDDMON as reset source*pwrite = byte;// write the byte
PSCTL &= ~0x01;// PSWE = 0
FLSCL &= ~0x01;// disable FLASH writes/erases
PSBANK = PSBANK_SAVE;// restore PSBANK
EA = EA_SAVE;// restore interrupts}unsignedchar flashByteRead (FLADDR addr, bit SFLE){
bit EA_SAVE = EA;// preserve EAchar code * data pread;// FLASH read pointerunsignedchar byte;
EA =0;// disable interrupts
byte =*pread;// read the byte
PSBANK = PSBANK_SAVE;// restore PSBANK
EA = EA_SAVE;// restore interruptsreturn byte;}//-----------------------------------------------------------------------------// flashPageErase//-----------------------------------------------------------------------------//// This routine erases the FLASH page containing the linear FLASH address// <addr>.//void flashPageErase (FLADDR addr, bit SFLE){
bit EA_SAVE = EA;// preserve EAchar xdata * data pwrite;// FLASH write pointer
EA =0;// disable interrupts
pwrite =(char xdata *) addr;
FLSCL |=0x01;// enable FLASH writes/erases
PSCTL |=0x03;// PSWE = 1; PSEE = 1
RSTSRC =0x02;// enable VDDMON as reset source*pwrite =0;// initiate page erase
PSCTL &= ~0x03;// PSWE = 0; PSEE = 0
FLSCL &= ~0x01;// disable FLASH writes/erases
EA = EA_SAVE;// restore interrupts}
Above one is the code which i am using ..
But i want to configure that code to lcd already i have that program .any one help me how to add address to that code?
- - - Updated - - -
I want flash memory primitives configuration to store byte in flash memory?