Download Print this page

Uart2 Interrupt - STC micro STC8A8K64D4 Series Reference Manual

Advertisement

STC8A8K64D4 Series Manual
MOV
MOV
MOV
MOV
MOV
MOV
SETB
SETB
MOV
JMP
END

11.5.14 UART2 Interrupt

C language code
//Operating frequency for test is 11.0592MHz
#include "reg51.h"
#include "intrins.h"
sfr
T2L
sfr
T2H
sfr
AUXR
sfr
S2CON
sfr
S2BUF
sfr
IE2
#define
ES2
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 UART2_Isr() interrupt 8
{
if (S2CON & 0x02)
{
S2CON &= ~0x02;
P12 = !P12;
}
if (S2CON & 0x01)
{
S2CON &= ~0x01;
P13 = !P13;
}
P5M0, #00H
P5M1, #00H
SCON,#50H
T2L,#0E8H
T2H,#0FFH
AUXR,#15H
ES
EA
SBUF,#5AH
$
=
0xd7;
=
0xd6;
=
0x8e;
=
0x9a;
=
0x9b;
=
0xaf;
0x01
=
0x93;
=
0x94;
=
0x91;
=
0x92;
=
0x95;
=
0x96;
=
0xb1;
=
0xb2;
=
0xb3;
=
0xb4;
=
0xc9;
=
0xca;
=
P1^2;
=
P1^3;
;65536-11059200/115200/4=0FFE8H
;Start timer
;Enable UART1 interrupt
; Send test data
//Clear interrupt flag
//Test port
//Clear interrupt flag
//Test port
-
- 244 -

Advertisement

loading
Need help?

Need help?

Do you have a question about the micro STC8A8K64D4 Series and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Micro stc8a8k64d4-64pinMicro stc8a8k64d4-48pin