Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Interupts on PIC16F877

Status
Not open for further replies.

si2030

Member
Hi There,

I am a newbie to PIC. I am looking at the pic16F877 with the intention of using interupts.

I wonder if someone could tell me if its possible to run a 4X4 keypad with interupts as well as an encoder with interupts?

I note that RB0 - RB7 has an interupt but I can not find any other interupts that are suitable to run these two periferals separately. Is it possible? There does not appear to be any other interupts associated with RC0 - RC7 RD0 - RD7 etc...

How would I run the key pad and the encoder on this microcontroller testing for interupts or is there another way..

Kind Regards

Simon
 
Why the interrupts obsession?, they can certainly be useful, and at times are essential - but mostly suitable programming means you don't need to use them. EXACTLY what are you trying to do?. If you did feel it's the only way, then use PortB for them both - you don't need all pins on PortB for the keypad (use four on PortB, and four elsewhere).
 
hi,
This pdf is a useful guide for PORTB interrupts.
 

Attachments

  • KeyIntr2..pdf
    98.9 KB · Views: 194
Hi Nigel,

I had the idea that a user could press a button on the keypad and this would cause an interupt which I could then deal with. At the same time I have an encoder I want to use which I also wanted to service if the user moved it... I am working on building a function generator for interest and learning.. The idea of using half of port B for the keypad and the other half say on port C or D hadnt occured to me but this frees up 4 pins on port B which I can use for the encoder..
 
Hi Nigel,

I had the idea that a user could press a button on the keypad and this would cause an interupt which I could then deal with. At the same time I have an encoder I want to use which I also wanted to service if the user moved it... I am working on building a function generator for interest and learning..

Check out the PIC function generator at Mondo Technology - Pic Projects

The idea of using half of port B for the keypad and the other half say on port C or D hadnt occured to me but this frees up 4 pins on port B which I can use for the encoder..

It's the sort of thing which doesn't instantly spring to mind, but is obvious once the idea has been mentioned.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top