PDA

View Full Version : Mixing PortB interupts



crhomberg
- 5th October 2007, 15:06
Dear PIC'ers,

I am building a project that uses an optical encoder and 3 position sensors.
The encoder needs to interrupt the main program every time it pulses but the sensors also need their own interrupt but with another routine.

I am using Darrel Taylor's instant interrupts and wonder if it is possible to use the PORTB change interrupt that goes to one routine and the INT (PORTB.0) interrupt to go to another without PORTB change interrupts seeing PORTB.0 as one of it's pins changing.

Long story short, exclude Bit 0 of PortB when using PORTB change interrupt?

Regards

Chris Rhomberg

paul borgmeier
- 5th October 2007, 16:22
Chris,

PortB change interrupts usually refer to bits 4-7 only, which means you will be okay (from an excluding bit 0 point of view). What pic are you using?

crhomberg
- 8th October 2007, 22:10
I am using PIC16F877A but I donīt really want to use PORTB bits 6 & 7 as I like to use them for programming the PIC while powered up and plugged in.
Is there another PIC which fits in the same range that has different interrupt or programming pins?

Regards

Chris