NXP S12Z CPU
The S12Z is a 16 Bit CPU from NXP.
The EEPROM starts at address 0x100000.
Two consecutive words can always be deleted as a sector.
The words can be written individually, as each word has its own ECC stored.
USBDM TCL interpreter scripts for s12z
Check the status to see if the module is still busy.
rb 0x386 ;#FSTAT if CCIF == 0 Command is running
Erase 1 Sector (2 Words)
wb 0x386 0x30 ;#FSTAT clear ACCERR & FPVIOL flag in flash status register
wb 0x382 1 ;#FCCOBIX 2 COBs used
wl 0x38C 0x12100000 ;#FCCOB0+B1 0x12<<24 | 0x100000 COMMAND Erase Sector 0x12 and Address 0x100000
Verify Sectors
wb 0x386 0x30 ;#FSTAT clear ACCERR & FPVIOL flag in flash status register
wb 0x382 2 ;#FCCOBIX 3 COBs used
wl 0x38C 0x10100000 ;#FCCOB0+B1 0x10<<24 | 0x100000 COMMAND Erase & Verify Sector 0x10 and Address 0x100000
ww 0x390 4 ;#FCCOB2 4 Words
Write 1 Word
wb 0x386 0x30 ;#FSTAT clear ACCERR & FPVIOL flag in flash status register
wb 0x382 2 ;#FCCOBIX 3 COBs used
wl 0x38C 0x11100000 ;#FCCOB0+B1 0x11<<24 | 0x100000 COMMAND Program EEPROM-Word(s) 0x11 and Address 0x100000
ww 0x390 0x1112 ;#FCCOB2 Word 0x1112
Write 2 Words
wb 0x386 0x30 ;#FSTAT clear ACCERR & FPVIOL flag in flash status register
wb 0x382 3 ;#FCCOBIX 4 COBs used
wl 0x38C 0x11100000 ;#FCCOB0+B1 0x11<<24 | 0x100000 COMMAND Program EEPROM-Word(s) 0x11 and Address 0x100000
ww 0x390 0x1112 ;#FCCOB2 Word 0x1112
ww 0x392 0x1314 ;#FCCOB3 Word 0x1314
Write 3 Words
wb 0x386 0x30 ;#FSTAT clear ACCERR & FPVIOL flag in flash status register
wb 0x382 4 ;#FCCOBIX 5 COBs used
wl 0x38C 0x11100000 ;#FCCOB0+B1 0x11<<24 | 0x100000 COMMAND Program EEPROM-Word(s) 0x11 and Address 0x100000
ww 0x390 0x1112 ;#FCCOB2 Word 0x1112
ww 0x392 0x1314 ;#FCCOB3 Word 0x1314
ww 0x394 0x1516 ;#FCCOB4 Word 0x1516
Write 4 Words
wb 0x386 0x30 ;#FSTAT clear ACCERR & FPVIOL flag in flash status register
wb 0x382 5 ;#FCCOBIX 6 COBs used
wl 0x38C 0x11100000 ;#FCCOB0+B1 0x11<<24 | 0x100000 COMMAND Program EEPROM-Word(s) 0x11 and Address 0x100000
ww 0x390 0x1112 ;#FCCOB2 Word 0x1112
ww 0x392 0x1314 ;#FCCOB3 Word 0x1314
ww 0x394 0x1516 ;#FCCOB4 Word 0x1516
ww 0x396 0x1718 ;#FCCOB5 Word 0x1718
Read EEPROM
rl 0x100000
rl 0x100004
USBDM