EasyManua.ls Logo

STC micro STC8A8K64D4 Series - Page 861

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
- 845 -
}
if (RI)
{
RI = 0;
dat = SBUF;
switch (stage)
{
case 0:
default:
L_Check1st:
if (dat == 'S') stage = 1;
else stage = 0;
break;
case 1:
if (dat == 'T') stage = 2;
else goto L_Check1st;
break;
case 2:
if (dat == 'C') stage = 3;
else goto L_Check1st;
break;
case 3:
if (dat == 'I') stage = 4;
else goto L_Check1st;
break;
case 4:
if (dat == 'S') stage = 5;
else goto L_Check1st;
break;
case 5:
if (dat == 'P') stage = 6;
else goto L_Check1st;
break;
case 6:
if (dat == '$') // When the correct user download command is detected
IAP_CONTR = 0x60; // reset to system area
else goto L_Check1st;
break;
}
}
}
void main()
{
P3M0 = 0x00;
P3M1 = 0x00;
SCON = 0x50; // Set the UART to 8 data bits
TMOD = 0x00;
AUXR = 0x40;
TH1 = BR2400 >> 8; // Set the UART baud rate to 115200
TL1 = BR2400;
TR1 = 1;
ES = 1;
EA = 1;

Table of Contents

Related product manuals