EasyManua.ls Logo

STC micro STC8A8K64D4 Series - Page 151

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
-
- 135 -
}
if (RI)
{
RI = 0;
}
}
void UartInit()
{
SCON = 0x50;
TMOD = 0x00;
TL1 = BRT;
TH1 = BRT >> 8;
TR1 = 1;
AUXR = 0x40;
busy = 0;
}
void UartSend(char dat)
{
while (busy);
busy = 1;
SBUF = dat;
}
void main()
{
P0M0 = 0x00;
P0M1 = 0x00;
P1M0 = 0x00;
P1M1 = 0x00;
P2M0 = 0x00;
P2M1 = 0x00;
P3M0 = 0x00;
P3M1 = 0x00;
P4M0 = 0x00;
P4M1 = 0x00;
P5M0 = 0x00;
P5M1 = 0x00;
F32K = (int code *)0xeff5; // STC8A8K60S4
UartInit();
ES = 1;
EA = 1;
UartSend(*F32K >> 8); //Read high byte of 32K frequency
UartSend(*F32K); //Read low byte of 32K frequency
while (1);
}
Assembly code
;Operating frequency for test is 11.0592MHz
AUXR DATA 8EH
F32K EQU 0EFF5H ; STC8A8K60S4
BUSY BIT 20H.0
P0M1 DATA 093H

Table of Contents

Related product manuals