19. Memory programming
A96G140/A96G148/A96A148 User’s manual
238
Start
OCD mode entry
Write(OCD_CODE, 0xF555, 0xAA)
Set auto verify mode
End
Busy check (FESR[7]=L)
Read 24- bit Checksum (H, M, L)
Read(OCD_XDATA, FEARH)
Read(OCD_XDATA, FEARM)
Read(OCD_XDATA, FEARL)
Set checksum read mode
Write(OCD_CODE, 0xFAAA, 0x55)
Write(OCD_CODE, 0xF555, 0xA5)
Write(OCD_XDATA, FEMR, 0x81)
Write(OCD_CODE,
FETR, 0x00
)
Write(OCD_CODE, FECR, 0x07)
Exit checksum read mode
Write(OCD_XDATA, FECR, 0x30)
Write(OCD_XDATA, FEARM,Start Address Upper)
Write(OCD_XDATA, FEARL,Start Address Lower)
Write(OCD_XDATA, FEARM1,End Address Upper)
Write(OCD_XDATA, FEARL1,End Address Lower)
Figure 127. Read Device Internal Checksum (User Define Size)