0

I am trying to program a PIC 16F876A using mikroC. I need the program to run when I push a button to a certain point, stop and wait till the button is pushed again before finishing. I have read that using a hardware interrupt is the way to do this but can not get mine to work. Any help/advice would be very much appreciated, thank you.

1 Answers1

0

Get to know that in MikroC, the interrupt routine works this way :

void interrupt (void) {interrupt code goes here}

Be sure that your interrupt is enabled via the Global interrupt bit (INTCON.GIE) and that your button is plugged either in the external interrupt pin (INT) or on Portb(4-7) pins which works with interrupt on change.

Also, be sure to enable the interrupt bits in INTCON whether it's an external interrupt or an interrupt on change.

There's may be different sources for you code not to work. Could you please post your code? That would help me find your problem.

Jean-francois
  • 316
  • 1
  • 9