S9KEAZN64AMLC EEPROM write sequence

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S9KEAZN64AMLC EEPROM write sequence

444 Views
Nikijai
Contributor I

Hi Team,

I am working on EEPROM for S9KEAZN64AMLC microcontroller.

issue: I am able to see the address and data in the registers. but in memory, I only see 2 bytes of data and it is also not in a proper manner after that system will go into default ISR.

/* code */

/* Write EEPROM program command */
TMRE->FCCOBHI = (uint8_t) 0x11;

/* Write upper byte address */
FTMRE->FCCOBLO = (uint8_t) (FLASH_lAddress >> FLASH_POS_SHIFT16);
/* Write index for lower byte address */
FTMRE->FCCOBIX = FLASH_INDEX1;
/* Write the lower byte memory address */
FTMRE->FCCOBLO = (uint8_t) FLASH_lAddress;
FTMRE->FCCOBHI = (uint8_t) (FLASH_lAddress >> FLASH_POS_SHIFT8);
/* Write index to specify the word1 (LSB word) to be programmed */
FTMRE->FCCOBIX = FLASH_INDEX2;
/* Write LSB word */
FTMRE->FCCOBHI = (uint8_t) (FLASH_lDataByte >> FLASH_POS_SHIFT8);
FTMRE->FCCOBLO = (uint8_t) (FLASH_lDataByte);
/* Write index to specify the word1 (MSB word) to be programmed*/
FTMRE->FCCOBIX = FLASH_INDEX3;
/* Write MSB word */
FTMRE->FCCOBHI = (uint8_t) ((FLASH_lDataByte >> FLASH_POS_SHIFT16)
>> FLASH_POS_SHIFT8);
FTMRE->FCCOBLO = (uint8_t) (FLASH_lDataByte >> FLASH_POS_SHIFT16);

FTMRE->FSTAT = 0x80U;

Can you please provide the process.

0 Kudos
Reply
0 Replies