EasyManua.ls Logo

STC micro STC8A8K64D4 Series - Page 362

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
- 346 -
sfr P2M1 = 0x95;
sfr P2M0 = 0x96;
sfr P3M1 = 0xb1;
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 Uart4Isr() interrupt 18
{
if (S4CON & 0x02)
{
S4CON &= ~0x02;
busy = 0;
}
if (S4CON & 0x01)
{
S4CON &= ~0x01;
buffer[wptr++] = S4BUF;
wptr &= 0x0f;
}
}
void Uart4Init()
{
S4CON = 0x10;
T2L = BRT;
T2H = BRT >> 8;
AUXR = 0x14;
wptr = 0x00;
rptr = 0x00;
busy = 0;
}
void Uart4Send(char dat)
{
while (busy);
busy = 1;
S4BUF = dat;
}
void Uart4SendStr(char *p)
{
while (*p)
{
Uart4SEND(*p++);
}
}
void main()
{
P0M0 = 0x00;

Table of Contents

Related product manuals