cancel
Showing results for 
Search instead for 
Did you mean: 

Do you offer a C code example to program a double word in DFLASH?

e_
Associate

Hi all,

do you offer a working C Code example to

program a double word in DFLASH.

E.g. of data 0x55AA55AA at address 0x00AAA8 and data 0xAA55AA55 at address 0x00AAAC?

The example in the RM0037 Reference manual is no C Code

and the EEPROM Emulator (SPC5Studio) is also not written in C Code.

RM0037 Reference manual

Example 10

Double word program of data 0x55AA55AA at address 0x00AAA8 and data

0xAA55AA55 at address 0x00AAAC

MCR= 0x00000010;/* Set PGM in MCR: Select Operation */

(0x00AAA8)= 0x55AA55AA;/* Latch Address and 32 LSB data */

(0x00AAAC)= 0xAA55AA55;/* Latch 32 MSB data */

MCR = 0x00000011;/* Set EHV in MCR: Operation Start */

do /* Loop to wait for DONE=1 */

{ tmp = MCR;

/* Read MCR */

} while ( !(tmp & 0x00000400) );

status= MCR & 0x00000200;/* Check PEG flag */

30.6.3

MCR = 0x00000010;/* Reset EHV in MCR: Operation End */

MCR = 0x00000000;/* Reset PGM in MCR: Deselect Operation */

This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
0 REPLIES 0