STC8A8K64D4 Series Manual
Appendix L
program to the system area for ISP download
(without power off)
When the project is in the development stage, it is necessary to repeatedly download the user code to the target
chip for code verification, and the STC microcontroller
For normal ISP downloads, the target chip needs to be re-powered, which will make the project development phase
more cumbersome. For this reason, STC MCU has added a special function register IAP_CONTR. When the user writes
0x60 to this register, the software can be reset to the system area, and then ISP download can be performed without
power failure.
But how do users judge whether ISP download is in progress? When to write 0x60 to register IAP_CONTR to
trigger a soft reset? Regarding these two issues, four methods of judgment are introduced below:
Use P3.0 port to detect serial port start signal
The serial port ISP of the STC microcontroller uses P3.0 and P3.1. When the ISP download software starts to
download, it will send a handshake command to the P3.0 port of the microcontroller. If the user's P3.0 and P3.1 are
only used for ISP download, you can use the P3.0 port to detect the start signal of the serial port to judge the ISP
download.
C Language Code
// Operating frequency for test is 11.0592MHz
#include "reg51.h"
#include "intrins.h"
sfr
IAP_CONTR
=
sfr
P3M0
=
sfr
P3M1
=
sbit
P30
=
void main()
{
P3M0 = 0x00;
P3M1 = 0x00;
P30 = 1;
while (1)
{
if (!P30) IAP_CONTR = 0x60;
...
}
}
The method of resetting the user
0xc7;
0xb2;
0xb1;
P3^0;
// The low level of P3.0 is the serial port start signal
// Software reset to system area
//User codes
- 841 -
Need help?
Do you have a question about the micro STC8A8K64D4 Series and is the answer not in the manual?