Download Print this page

STC micro STC8A8K64D4 Series Reference Manual page 866

Advertisement

STC8A8K64D4 Series Manual
case 8:
if (dat != 0x16) goto L_CheckFirst;
UartReceived = TRUE;
UartRecvStep++;
break;
L_CheckFirst:
case 0:
default:
CommInit();
UartRecvStep = (dat == 0x46
break;
}
}
}
// system initialization
void Initial(void)
{
UartBusy = FALSE;
SCON = 0xd0;
AUXR = 0xc0;
TMOD = 0x00;
TH0 = HIBYTE(T1MS);
TL0 = LOBYTE(T1MS);
TR0 = 1;
TH1 = HIBYTE(BR(MINBAUD));
TL1 = LOBYTE(BR(MINBAUD));
TR1 = 1;
ET0 = 1;
ES = 1;
EA = 1;
}
//Xms Delay program
void DelayXms(WORD x)
{
do
{
f1ms = FALSE;
while (!f1ms);
} while (x--);
}
// Serial data sending program
BYTE UartSend(BYTE dat)
{
while (UartBusy);
UartBusy = TRUE;
ACC = dat;
TB8 = P;
SBUF = ACC;
return dat;
}
// Serial communication initialization
? 1 : 0);
// Serial data format must be 8-bit data + 1-bit even check
- 850 -

Advertisement

loading
Need help?

Need help?

Do you have a question about the micro STC8A8K64D4 Series and is the answer not in the manual?

This manual is also suitable for:

Micro stc8a8k64d4-64pinMicro stc8a8k64d4-48pin