Interrupts 16F88

Status
Not open for further replies.

Macka

New Member
Hi,
I want to use 2 or 3 external interrupts on a PIC 16F88, but after looking at a pinout diagram I saw that pin 6 is labelled RB0/INT/CCP1, and no other pins have the INT label, does this mean that only one pin is available for use as an interrupt?

Also, I am using Mikrobasic, does anyone know the code needed to enable external interrupts, because I have found several examples and none of them are the same.
 
Page 57 of the datasheet talks about PORTB interrupts...

RB0 is an external interrupt, while RB4:7 are interrupts "on change".

Page 58 gives you a PORTB functions chart.

[Can't help you with the MicroBasic -- I use asm, sorry.]
 
Thanks Kyle

Ok, so that means i would have to use flags to detect a press, set the flag when the interrupt fires (if the pin is high). then clear the flag on the next interrupt and execute the code corresponding with the button press... ok, not too difficult.

Anyone know how to set up interrupts in Mikrobasic?
 

You have got the interrupts and flag thingies all wrong
The 'interrupt on change' inputs will cause an interrupt if RBIE and GIE (bits are found in INTCON register) are enabled. This will set the RBIF flag which must be cleared somewhere in your interrupt service routine after reading PORTB. Your code for the ISR must be able to determine which of the four pins generated the interrupt.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…