0

The title is pretty much self explanatory. When I write to the Output Compare Register (OC8RS or OC8R), an interrupt on the External Interrupt INT4 pin is triggered. I'm using the Timer3 & OC8 modules for PWM. The INT4 pin is connected to a physical switch that when pressed, triggers an interrupt. But, when I update the OC8RS register for my PWM function, an interrupt is triggered from INT4... which doesn't make sense (again, since this pin is connected to a physical switch - nothing to do with PWM).

I'm guessing I'm not initializing, setting, or clearing something correctly, but I'm out of ideas. Does anyone else have any? Thanks!

I'm using a PIC24HJ256GP610A processor, along with the latest MPLAB v8 and C30, and an ICD3.

The_Ders
  • 137
  • 9
  • In the pin diagram of the processor, are OC8 and INT4 mapped to the same pin? In revs without peripheral pinselect, functionality can be multiplexed on pins. – Marco van de Voort Oct 18 '12 at 08:35
  • Great suggestion, but I already checked that. The two are on separate pins. See below the "solution" I found... – The_Ders Oct 18 '12 at 13:56

1 Answers1

0

I found a solution. Instead of setting the tristate bit of INT4 to be an input (i.e., bit 15 of TRISA = 1), I set it to be an output (TRISAbit15=0). Now, this doesn't make sense because as I've already stated, I'm using a mechanical switch to send a pulse to the INT4 pin when pressed... i.e., an input signal to the MCU. I have the INT4 pin connected to a 10K pullup resistor for the switch to work.

So, setting the pin/tristate bit as an output no longer causes the INT4 interrupt to trigger. The signal looks noisier than it should, as if it's "fighting" with another signal, but it works fine now. Still confused as to how this could work with the pin set as an output when it's receiving an input...

The_Ders
  • 137
  • 9