When I enable the interrupt and put the pic to sleep, it wake up and enter to the ISR before I push a key. Is there something I have to do before enable the port interrupt? I'm using the ICD debugger (with port b internal pull ups): is this the problem?
I have 16F876 PIC, 3.19 compiler version, 3.43 IDE version.
P.S: sorry for my bad english.
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Fri Jan 20, 2006 5:07 pm
You must read the port before you enable the interrupt.
This will clear the latch that detects the "change condition".
Then it will be setup to detect the next keypress.
JohnLeung
Joined: 18 May 2004 Posts: 15
Interrupt on-change on RB port
Posted: Fri Jan 20, 2006 8:56 pm
Try putting a small delay to "debounce" after wake up to avoid any noisy problem for RB on-change port, even though you have pull-up for PORTB.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum