EasyManua.ls Logo

STC micro STC8A8K64D4 Series - Page 358

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
- 342 -
sfr P3M0 = 0xb2;
sfr P4M1 = 0xb3;
sfr P4M0 = 0xb4;
sfr P5M1 = 0xc9;
sfr P5M0 = 0xca;
bit busy;
char wptr;
char rptr;
char buffer[16];
void Uart3Isr() interrupt 17
{
if (S3CON & 0x02)
{
S3CON &= ~0x02;
busy = 0;
}
if (S3CON & 0x01)
{
S3CON &= ~0x01;
buffer[wptr++] = S3BUF;
wptr &= 0x0f;
}
}
void Uart3Init()
{
S3CON = 0x10;
T2L = BRT;
T2H = BRT >> 8;
AUXR = 0x14;
wptr = 0x00;
rptr = 0x00;
busy = 0;
}
void Uart3Send(char dat)
{
while (busy);
busy = 1;
S3BUF = dat;
}
void Uart3SendStr(char *p)
{
while (*p)
{
Uart3SEND(*p++);
}
}
void main()
{
P0M0 = 0x00;
P0M1 = 0x00;
P1M0 = 0x00;
P1M1 = 0x00;

Table of Contents

Related product manuals