EasyManua.ls Logo

STC micro STC8A8K64D4 Series - UART1 Reads and Writes EEPROM - Read Using MOVC

Default Icon
901 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
STC8A8K64D4 Series Manual
- 464 -
IAP_ERASE:
MOV IAP_CONTR,#80H ;Enable IAP
MOV IAP_TPS,#12 ;Set the erasing wait parameter of 12MHz
MOV IAP_CMD,#3 ;Set IAP erasing command
MOV IAP_ADDRL,DPL ;Set IAP low address
MOV IAP_ADDRH,DPH ;Set IAP high address
MOV IAP_TRIG,#5AH ;Write trigger command (0x5a)
MOV IAP_TRIG,#0A5H ;Write trigger command (0xa5)
NOP
LCALL IAP_IDLE ;Disable IAP function
RET
MAIN:
MOV SP, #5FH
MOV P0M0, #00H
MOV P0M1, #00H
MOV P1M0, #00H
MOV P1M1, #00H
MOV P2M0, #00H
MOV P2M1, #00H
MOV P3M0, #00H
MOV P3M1, #00H
MOV P4M0, #00H
MOV P4M1, #00H
MOV P5M0, #00H
MOV P5M1, #00H
LCALL UART_INIT
MOV DPTR,#0400H
LCALL IAP_ERASE
MOV DPTR,#0400H
LCALL IAP_READ
LCALL UART_SEND
MOV DPTR,#0400H
MOV A,#12H
LCALL IAP_PROGRAM
MOV DPTR,#0400H
LCALL IAP_READ
LCALL UART_SEND
SJMP $
END
16.4.4 UART1 reads and writes EEPROM - Read using MOVC
C language code (main.c)
//Operating frequency for test is 11.0592MHz
/* This program is completely normal after testing, and does not provide telephone technical support. If you cannot understand it,
please supplement the relevant basis yourself. */
/************* Function description of this program **************
STC8G family MCUs EEPROM general test program.

Table of Contents

Related product manuals