Why program can run into external INT0 interrupt program while FP00IEN has already been cleared?
SONIX 8-bit MCU interrupt is that once received P0.0 interrupt condition, it can always set the corresponding interrupt flag FP00IRQ, but whether can enter interrupt depends on FP00IEN(this is set for customers inquiries necessary). However, if interrupt flag FP00IRQ is set by external interrupt conditions, at the same time, some other interrupt occurs, if interrupt service routine handled improperly, this may cause an error into the INT0 interrupt. Solution:
1. If there is no INT0 interrupt need in program, do not check FP00IRQ flag.
2. If the program requires INT0 interrupt, it should be used together with FP00IEN flag, as follows:
B0BTS1 FP00IEN | ; check whether P00 interrupt is enabled or not |
JMP EXIT | ; No P00 interrupt,exit |
B0BTS1 P00IRQ | ; Check other interrupt request flag |
JMP NEXT | |
: | |
NEXT: | ; P00 interrupt service routine |
: | |
EXIT: | ; Exit interrupt service routine |
RETI |