EasyManua.ls Logo

STC micro STC8A8K64D4 Series - Page 132

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
-
- 116 -
sfr P5M1 = 0xc9;
sfr P5M0 = 0xca;
bit busy;
int *BGV;
void UartIsr() interrupt 4
{
if (TI)
{
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;
P4M0 = 0x00;
P4M1 = 0x00;
P5M0 = 0x00;
P5M1 = 0x00;
BGV = (int code *)0xeff7; // STC8A8K60S4
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);
}

Table of Contents

Related product manuals