EasyManua.ls Logo

STC micro STC8A8K64D4 Series - Page 431

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
- 415 -
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;
P0M1 = 0x00;
P1M0 = 0x00;
P1M1 = 0x00;
P2M0 = 0x00;
P2M1 = 0x00;
P3M0 = 0x00;
P3M1 = 0x00;
P4M0 = 0x00;
P4M1 = 0x00;
P5M0 = 0x00;
P5M1 = 0x00;
Uart4Init();
IE2 = 0x10;
EA = 1;
Uart4SENDStr(“Uart Test !\r\n”);
while (1)
{
if (rptr != wptr)
{
Uart4SEND(buffer[rptr++]);
rptr &= 0x0f;
}
}
}
Assembly code
;Operating frequency for test is 11.0592MHz
AUXR DATA 8EH
T2H DATA 0D6H
T2L DATA 0D7H
S4CON DATA 84H

Table of Contents

Related product manuals