Previous in Forum: Inexpensive, Programmable, IP-Based Camera   Next in Forum: USB Testing Software
Close
Close
Close
3 comments
Rate Comments: Nested
Member

Join Date: Oct 2006
Posts: 7

PIC - Interrupts

03/12/2007 12:49 PM

hiya,

Working on a assignment and I need to set up a interrupt on a PIC16F84A, and I'm totally confused how to set one up.

The interrupt will be controlled by a proximity sensor which is active high, and I need to make the little car go around a object.

What I'm not sure about is how to initialise it to start with and how to set the interrupt up to goto a new bit of code when its high.

Thanks in advance.

Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.
Guru
Engineering Fields - Electrical Engineering - New Member

Join Date: Sep 2006
Location: El Lago, Texas, USA
Posts: 2639
Good Answers: 65
#1

Re: PIC - Interrupts

03/12/2007 2:49 PM

My advice would be to go to www.microchip.com and download the pdf file for this part. Then, search the datasheet for "interrupt". That will lead you to all the relevant info. Also, you'll find a couple of design guides and handbooks there that have examples of PIC code, and you'll see examples of interrupts there.

But the basic idea is to connect your sensor to one of the pins that can be used for interrupts. Enable that pin for interrupts (rising or falling edge). Enable the interrupt. These are all done is different registers. Put the code you want to execute (or a GOTO instruction to the code) at the Interrupt Vector location in the memory stack. Use the Return from Interrupt command to get back from the interrupt.


Good luck.

Register to Reply
Participant

Join Date: Feb 2007
Location: Upstate New York
Posts: 2
#2

Re: PIC - Interrupts

03/13/2007 8:26 AM

This link will take you to the Microchip Mid Range MCU Family Reference Manual. Its the Bible of the PIC's

http://ww1.microchip.com/downloads/en/devicedoc/33023a.pdf

Register to Reply
Member

Join Date: Oct 2006
Posts: 7
#3
In reply to #2

Re: PIC - Interrupts

03/14/2007 3:44 PM

Thanks its a lot clearer now.

Register to Reply
Register to Reply 3 comments
Copy to Clipboard

Users who posted comments:

bhankiii (1); Lachine (1); Thomas Tyska (1)

Previous in Forum: Inexpensive, Programmable, IP-Based Camera   Next in Forum: USB Testing Software

Advertisement