STC8A8K64D4 Series Manual
MOV
CJNE
INC
MOV
CJNE
LJMP
ISNOT7F:
MOV
UARTISR_EXIT:
POP
POP
RETI
START:
MOV
CLR
MOV
DJNZ
MOV
MOV
MOV
MOV
MOV
MOV
SETB
SETB
SETB
MAIN:
INC
SJMP
END
User code can be written in C or assembly language, but one thing to note about assembly code: the instruction at
the reset entry address of 0000H must be a long jump statement (similar to LJMP START). In the user code, the serial
port needs to be set up, and when the download conditions are met, the PC value is jumped to ISPPROGRAM (that is,
the absolute address of FA00H) to achieve code update. For assembly code, we can use the "LJMP 0FA00H" instruction
to call, as shown below
A,SBUF
A,#7FH,ISNOT7F
CNT7F
A,CNT7F
A,#16,UARTISR_EXIT
ISPPROGRAM
CNT7F,#0
PSW
ACC
R0,#7FH
A
@R0,A
R0,$-1
SP,#7FH
SCON,#50H
AUXR,#15H
TMOD,#00H
TH1,#HIGH UARTBAUD
TL1,#LOW UARTBAUD
TR1
ES
EA
P0
MAIN
; Invoke the download module (****important statement ****)
;Clear RAM
; Initialize SP
; Set UART mode (8-bit data, variable baud rate, no parity bit)
; BRT works in 1T mode, start BRT
;Timer 1 works in mode 0 (16-bit reload)
;set reload value
;start timer 1
; Enable UART interrupt
; Enable CPU interrupt
- 837 -
Need help?
Do you have a question about the micro STC8A8K64D4 Series and is the answer not in the manual?