EasyManua.ls Logo

STC micro STC8A8K64D4 Series - Page 418

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
- 402 -
sfr P0M1 = 0x93;
sfr P0M0 = 0x94;
sfr P1M1 = 0x91;
sfr P1M0 = 0x92;
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 Uart2Isr() interrupt 8
{
if (S2CON & 0x02)
{
S2CON &= ~0x02;
busy = 0;
}
if (S2CON & 0x01)
{
S2CON &= ~0x01;
buffer[wptr++] = S2BUF;
wptr &= 0x0f;
}
}
void Uart2Init()
{
S2CON = 0x10;
T2L = BRT;
T2H = BRT >> 8;
AUXR = 0x14;
wptr = 0x00;
rptr = 0x00;
busy = 0;
}
void Uart2Send(char dat)
{
while (busy);
busy = 1;
S2BUF = dat;
}
void Uart2SendStr(char *p)
{
while (*p)
{
Uart2SEND(*p++);
}

Table of Contents

Related product manuals