CMT2380F17
Rev0.1 | 310/347
www.cmostek.com
Bit 5: SWRST, software reset trigger control. 0: No operation
1: Generate software system reset. It will be cleared by hardware automatically.
Bit 4: CFAIL, Command Fail indication for ISP/IAP operation. 0: The last ISP/IAP command has finished
successfully.
1: The last ISP/IAP command fails. It could be caused since the access of flash memory was inhibited. Bit
3~0: Reserved. Software must write “0” on these bits when ISPCR is written.
IAPLB
:
IAP Low Boundary
SFR Page
= P Only
SFR Address = 0x03
Bit
7
6
5
4
3
2
1
0
Name
IAPLB[7:0]
R/W
W
W
W
W
W
W
W
W
Reset Value
0
1
1
1
0
0
0
X
Bit 7~0: The IAPLB determines the IAP-memory lower boundary. Since a Flash page has 512 bytes, the
IAPLB must be an even number.
To read IAPLB, MCU need to define the IFMT for mode selection on IAPLB Read and set ISPCR.ISPEN.
And then write 0x46h & 0xB9h sequentially into SCMD. The IAPLB content is available in IFD. If write
IAPLB, MCU will put new IAPLB setting value in IFD firstly. And then select IFMT, enable ISPCR.ISPEN
and then set SCMD. The IAPLB content has already finished the updated sequence.
The range of the IAP-memory is determined by IAPLB and the ISP start address as listed below.
IAP lower boundary = IAPLB[7:0] x 256, and
IAP higher boundary = ISP start address
– 1.
For example, if IAPLB=0x20 and ISP start address is 0x3000, then the IAP-memory range is located at
0x2000 ~ 0x2FFF.
Additional attention point, the IAP low boundary address must not be higher than ISP start address.
28.6
ISP/IAP Sample Code
The following Figure 28
–8 shows a sample code for ISP operation.
;******************************************************************************************
; Demo Program for the ISP
;******************************************************************************************
IFD DATA 0E2h
IFADRH DATA 0E3h
IFADRL DATA 0E4h
IFMT DATA 0E5h
SCMD DATA 0E6h
ISPCR DATA 0E7h
;
MOV ISPCR,#10000000b ;ISPCR.7=1, enable ISP
;=============================================================================
; 1. Page Erase Mode (512 bytes per page)
;=============================================================================
ORL
IFMT,#03h
;MS[2:0]=[0,1,1], select Page Erase Mode
MOV
IFADRH,??
;fill page address in IFADRH & IFADRL
MOV
IFADRL,??
;
MOV
SCMD,#46h
;trigger ISP processing MOV
SCMD,#0B9h ;
;Now in processing...(CPU will halt here until complete)
;=============================================================================
; 2. Byte Program Mode
;=============================================================================
Summary of Contents for CMT2380F17
Page 27: ...CMT2380F17 Rev0 1 27 347 www cmostek com 1 25 Phase Noise...
Page 177: ...CMT2380F17 Rev0 1 177 347 www cmostek com Figure 17 3 PCA Interrupt System...
Page 246: ...CMT2380F17 Rev0 1 246 347 www cmostek com SnMIPS S0MI S1MI 1 P3 3 P4 7...