STC8A8K64D4 Series Manual
-
if (INT1) //Judging rising and falling edges
{
P10 = !P10; //Test port
}
else
{
P11 = !P11; //Test port
}
}
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;
IT1 = 0; //Enable INT1 rising edge and falling edge interrupts
EX1 = 1; //Enable INT1 interrupt
EA = 1;
while (1);
}
Assembly code
;Operating frequency for test is 11.0592MHz
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 0013H
LJMP INT1ISR
ORG 0100H
INT1ISR:
JB INT1,RISING ;Judging rising and falling edges
CPL P1.0 ;Test port
RETI
RISING:
CPL P1.1 ;Test port