prasadsrkrec
Junior Member level 2
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 void flashByteWrite (FLADDR addr, char byte, bit SFLE) { bit EA_SAVE = EA; // preserve EA char 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 } unsigned char flashByteRead (FLADDR addr, bit SFLE) { bit EA_SAVE = EA; // preserve EA char code * data pread; // FLASH read pointer unsigned char byte; EA = 0; // disable interrupts byte = *pread; // read the byte PSBANK = PSBANK_SAVE; // restore PSBANK EA = EA_SAVE; // restore interrupts return 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 EA char 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?
Last edited by a moderator: