We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello! We're trying to use the fast external interrupt inputs EX1IN and EX2IN. We read the manual over and over and still we must be doing something wrong because the interrupt service routine never fires using the corresponding CAPCOM interrupt vectors. We would be grateful for any help. Here's the code: void EX1IN(void) interrupt 0x19 { // Never gets to here! } void main(void) { DP2_P9 = 0; // P2.9 as input (EX1IN) DP2_P10 = 0; // P2.10 as input (EX2IN) // CAPCOM MOD9 & MOD10 to capture // on rising edge. CC1_M2 = 0x0110; // Enable interrupt inputs P2.9 & P2.10. CC1_CC9IC_IE = 1; CC1_CC10IC_IE = 1; // EX1IN & EX2IN interrupt on rising edge. EXICON = 0x0014; // Select external interrupt inputs. EXISEL0 = 0x0000; PSW_IEN = 1; // Global interrupt enable. while(1) ; }
You forget to initialize port pins as inputs: P2_P9 = 1; P2_P10 = 1; before DP2_P9 = 0; // P2.9 as input (EX1IN) DP2_P10 = 0; // P2.10 as input (EX2IN)