View Full Version : INT2 and INT3 interrupts not working
Mercutio
21-01-2004, 16:26
For some reason, INT2 and INT3 are not working for me. I'm incrementing a variable inside the if (INTCON3bits.INT2IF)... block in the interrupt handler (same for the INT3 if block), but the variable never changes. I know the digital inputs are changing value when I open and close them, and I know the RBIF interrupts are working, but INT2 and INT3 don't respond. Does anyone have some advice?
~Aaron
Mercutio
21-01-2004, 16:44
YAY! I FIXED IT! If you're having the same problem, read this:
INT2 and INT3 (the interrupts on digital inputs 1 and 2) ARE NOT ENABLED BY DEFAULT!!!!!
INTCON3bits.INTXIE, the bit that controls whether INTX is enabled (where X is 2 or 3 and probably 1 or 0 as well), is set to 0 by default! You have to change it before the interrupts will work.
If everyone knows this already, feel free to delete this thread, moderator. If this is a problem people might run into, on the other hand, it might be best to leave it up.
~Aaron :D :D :D
emusteve
01-02-2004, 03:16
Glad you got it working, but where were you able to find out which interupts went with which inputs? I've been trying to find out which PIC ports are which digital inputs for the past week!
Jay Lundy
01-02-2004, 04:17
Glad you got it working, but where were you able to find out which interupts went with which inputs? I've been trying to find out which PIC ports are which digital inputs for the past week! RC Dig I/O 1 = RB2 (INT2)
RC Dig I/O 2 = RB3 (INT3)
RC Dig I/O 3 = RB4 (RBIF)
RC Dig I/O 4 = RB5 (RBIF)
RC Dig I/O 5 = RB6 (RBIF)
RC Dig I/O 6 = RB7 (RBIF)
Kevin Watson
01-02-2004, 13:27
Glad you got it working, but where were you able to find out which interupts went with which inputs? I've been trying to find out which PIC ports are which digital inputs for the past week!The information is in the FAQ (http://kevin.org/frc/faq.html) and the interrupt and timer template code that can be found here (http://kevin.org/frc).
-Kevin
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.