CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

RBport on change interrupt problem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Guest








RBport on change interrupt problem
PostPosted: Fri Jan 20, 2006 4:47 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Jan 20, 2006 5:07 pm     Reply with quote

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

View user's profile Send private message

Interrupt on-change on RB port
PostPosted: Fri Jan 20, 2006 8:56 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group