Quantcast
Channel:
Viewing all articles
Browse latest Browse all 59170

Forum Post: M16c/62P INT

$
0
0
I am trying to get the INT pins on a QSK-62P to work - without success. The program jumps to the ISR when an INT occurs, but then the PC goes to oblivion.  Then minimum code snippet for INT0 is in sect30.inc .lword dummy_int ; timer B2(for user)(vector 28) .glb _thr_A_ISR .lword _thr_A_ISR ; .lword dummy_int ; int0 (for user)(vector 29) the port is defined in a h file as #define thro_chan_A p8_2 #define thro_chan_A_DDR pd8_2 #define thro_chan_B p8_6 #define thro_chan_B_DDR pd8_6 the int is setup in main.c using #include "GST_bsp.h"  #pragma INTERRUPT thr_A_ISR //interrupt vector void main(void) {  /* Initializations */ mcu_init(); // Initialize MCU clock thro_chan_A_DDR = INPUT; //pd8_3 thro_chan_B_DDR = INPUT; //pd8_6 ifsr =0xc0; //set to one edge DISABLE_IRQ // disable irqs before setting irq registers - macro defined in skp_bsp.h int0ic = 1; // enable input irq by setting to non-zero value, ENABLE_IRQ; // enable interrupts macro defined in skp_bsp.h while(1){    } }       //end of main The ISR is void thr_A_ISR(void) {       if (thro_chan_B == LOW)                throt_ctr++;       else               throt_ctr--; } Any help would be appreciated! David

Viewing all articles
Browse latest Browse all 59170

Trending Articles