EasyManua.ls Logo

STC micro STC8A8K64D4 Series - Page 135

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
-
- 119 -
TI = 0;
busy = 0;
}
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;
P5M0 = 0x00;
P5M1 = 0x00;
BGV = (int idata *)0xef;
UartInit();
ES = 1;
EA = 1;
UartSend(*BGV >> 8); //Read the high byte of the internal reference voltage
UartSend(*BGV); //Read the low byte of the internal reference voltage
while (1);
}
Assembly code
;Operating frequency for test is 11.0592MHz
AUXR DATA 8EH
BGV DATA 0EFH
BUSY BIT 20H.0
P0M1 DATA 093H

Table of Contents

Related product manuals