STC8A8K64D4 Series Manual
MOV
SETB
MOV
JMP
END
11.5.16 UART4 Interrupt
C language code
//Operating frequency for test is 11.0592MHz
#include "reg51.h"
#include "intrins.h"
sfr
T2L
sfr
T2H
sfr
AUXR
sfr
S4CON
sfr
S4BUF
sfr
IE2
#define
ES4
sfr
P0M1
sfr
P0M0
sfr
P1M1
sfr
P1M0
sfr
P2M1
sfr
P2M0
sfr
P3M1
sfr
P3M0
sfr
P4M1
sfr
P4M0
sfr
P5M1
sfr
P5M0
sbit
P12
sbit
P13
void UART4_Isr() interrupt 18
{
if (S4CON & 0x02)
{
S4CON &= ~0x02;
P12 = !P12;
}
if (S4CON & 0x01)
{
S4CON &= ~0x01;
P13 = !P13;
}
}
void main()
{
P0M0 = 0x00;
P0M1 = 0x00;
P1M0 = 0x00;
IE2,#ES3
EA
S3BUF,#5AH
$
=
0xd7;
=
0xd6;
=
0x8e;
=
0x84;
=
0x85;
=
0xaf;
0x10
=
0x93;
=
0x94;
=
0x91;
=
0x92;
=
0x95;
=
0x96;
=
0xb1;
=
0xb2;
=
0xb3;
=
0xb4;
=
0xc9;
=
0xca;
=
P1^2;
=
P1^3;
;Enable UART3 interrupt
;Send test data
//Clear interrupt flag
//Test port
//Clear interrupt flag
//Test port
-
- 249 -
Need help?
Do you have a question about the micro STC8A8K64D4 Series and is the answer not in the manual?
Questions and answers