STC8A8K64D4 Series Manual
sfr
P3M1
=
char cnt7f;
void UartIsr() interrupt 4
{
if (TI)
{
TI = 0;
}
if (RI)
{
RI = 0;
if ((SBUF == 0x7f) && (RB8 == 1))
{
if (++cnt7f == 8)
IAP_CONTR = 0x60;
}
else
{
cnt7f = 0;
}
}
}
void main()
{
P3M0 = 0x00;
P3M1 = 0x00;
SCON = 0xd0;
TMOD = 0x00;
AUXR = 0x40;
TH1 = BR2400 >> 8;
TL1 = BR2400;
TR1 = 1;
ES = 1;
EA = 1;
cnt7f = 0;
while (1)
{
...
}
}
Use P3.0/RxD to receive and detect user download commands sent by ISP download
software
If the user code needs to use the serial port for communication, the above 3 methods may not be applicable. At
this time, you can use the interface provided by the STC ISP download software to customize a set of dedicated user
download commands (you can specify the baud rate, Check bit and stop bit). If this function is enabled, the ISP
download software will use the user-specified baud rate, check bit and stop bit to send the user download command
before ISP download, and then send the handshake command. The user only needs to monitor the serial port command
sequence in his own code. When the correct user download command is detected, the software is reset to the system
0xb1;
// UART Interrupt Service Routine
// Handshake command 7F sent by ISP download software
//The even parity bit of 7F is 1
// When 8 consecutive 7Fs are detected
// reset to system area
// Set the UART to 9 data bits
// Set the UART baud rate to 2400
//User codes
- 843 -
Need help?
Do you have a question about the micro STC8A8K64D4 Series and is the answer not in the manual?