STC8A8K64D4 Series Manual
-
P4M1 = 0x00;
P5M0 = 0x00;
P5M1 = 0x00;
IT0 = 0; //Enable INT0 rising edge and falling edge interrupts
// IT0 = 1; //Enable INT0 falling edge interrupt
EX0 = 1; //Enable INT0 interrupt
IT1 = 0; //Enable INT1 rising edge and falling edge interrupts
// IT1 = 1; //Enable INT1 falling edge interrupt
EX1 = 1; //Enable INT1 interrupt
INTCLKO = EX2; //Enable INT2 falling edge interrupt
INTCLKO |= EX3; //Enable INT3 falling edge interrupt
INTCLKO |= EX4; //Enable INT4 falling edge interrupt
EA = 1;
PCON = 0x02; //MCU enters power down mode
_nop_(); //Enter interrupt service routine immediately after wake-up from power
mode
_nop_();
_nop_();
_nop_();
while (1)
{
P11 = ~P11;
}
}
Assembly code
; Operating frequency for test is 11.0592MHz
INTCLKO DATA 8FH
EX2 EQU 10H
EX3 EQU 20H
EX4 EQU 40H
P0M1 DATA 093H
P0M0 DATA 094H
P1M1 DATA 091H
P1M0 DATA 092H
P2M1 DATA 095H
P2M0 DATA 096H
P3M1 DATA 0B1H
P3M0 DATA 0B2H
P4M1 DATA 0B3H
P4M0 DATA 0B4H
P5M1 DATA 0C9H
P5M0 DATA 0CAH
ORG 0000H
LJMP MAIN
ORG 0003H
LJMP INT0ISR
ORG 0013H
LJMP INT1ISR
ORG 0053H