EasyManua.ls Logo

STC micro STC8A8K64D4 Series - Page 289

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
- 273 -
}
//Because the interrupt vector is greater than 31, it cannot be directly compiled in KEIL
//The 13th interrupt entry address must be borrowed
void common_isr() interrupt 13
{
unsigned char psw2_st;
unsigned char intf;
psw2_st = P_SW2;
P_SW2 |= 0x80;
intf = P2INTF;
if (intf)
{
P2INTF = 0x00;
if (intf & 0x01)
{
//P2.0 interrupt
}
if (intf & 0x02)
{
//P2.1 interrupt
}
if (intf & 0x04)
{
//P2.2 interrupt
}
if (intf & 0x08)
{
//P0.3 interrupt
}
if (intf & 0x10)
{
//P2.4 interrupt
}
if (intf & 0x20)
{
//P2.5 interrupt
}
if (intf & 0x40)
{
//P2.6 interrupt
}
if (intf & 0x80)
{
//P2.7 interrupt
}
}
P_SW2 = psw2_st;
}
// ISR.ASM
// Save the following code as ISP.ASM, and then add the file to the project
CSEG AT 013BH ;P2 interrupt entry address
JMP P2INT_ISR
P2INT_ISR:

Table of Contents

Related product manuals