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 CCS Technical Support

RB0/INT and button

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



Joined: 24 Jul 2005
Posts: 20

View user's profile Send private message

RB0/INT and button
PostPosted: Fri Aug 19, 2005 10:50 pm     Reply with quote

Can i use button on RB0/INT for 2 jobs.
- first: for Interrupt
- second: for what button is pressed?

for exams
when button on RB0/INT is pressed we go to interrupt routine. During interrupt routine (GIE=0) we check RB0/INT if this button is pressed we do something?... is it possible?
Ttelmah
Guest







PostPosted: Sat Aug 20, 2005 2:34 am     Reply with quote

As described, no...
There will only be two possibilities. The line has been operated, in which case you interrupt, or the line is in it's idle state. If you are saying that you perhaps have a number of other buttons, connected to other inputs, and then use a seperate button connected to RB0, as a 'activate' button, then yes, of course.
You can do something along these lines, without a seperate button, using an 'AND' gate. If (for instance), you have a keypad, with four keys, pulling to 0v, and four pull-up resistors to keep these lines 'high' when no key is pressed. Then connect the four lines to four inputs on an AND gate, as well as four processor inputs, then connect the output of this gate, to the INT line, you will get an interrupt when any key is pressed, and can check in the interrupt handler, which key is involved.

Best Wishes
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