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.

Question about Interrupt

Status
Not open for further replies.

tinhnho

New Member
what is interrupt for pic18f452? and when do we need to use interrupt ? I read the datasheet of pic18f452 about interrupt:
The PIC18FXX2 devices have multiple interrupt
sources and an interrupt priority feature that allows
each interrupt source to be assigned a high priority
level or a low priority level. The high priority interrupt
vector is at 000008h and the low priority interrupt vector
is at 000018h. High priority interrupt events will override
any low priority interrupts that may be in progress.
There are ten registers which are used to control
interrupt operation. These registers are:
• RCON
• INTCON
• INTCON2
• INTCON3
• PIR1, PIR2
• PIE1, PIE2
• IPR1, IPR2
.........

But don't know what are those registers above for. I was searching around for some example for interrupt in C language but barely to see. If anyone has studies or know this pic please help me. Sorry if my words may sound stupid and newbie.
 
tinhnho said:
what is interrupt for pic18f452? and when do we need to use interrupt ? I read the datasheet of pic18f452 about interrupt:

But don't know what are those registers above for. I was searching around for some example for interrupt in C language but barely to see. If anyone has studies or know this pic please help me. Sorry if my words may sound stupid and newbie.

This is a hardware interrupt, read the following esp the overview:

https://en.wikipedia.org/wiki/Interrupt
 
The PICmicro® 18C MCU Family Reference Manual covers interrupts in much more detail than individual device data sheets:
https://www.electro-tech-online.com/custompdfs/2007/02/39500a.pdf

If you find it too complex, then try starting with a PIC16F range chip, they are much simpler to configure for interrupts, - you could then migrate up to the 18F range once you have a better understanding.

There are some interrupt code examples (asm) at:


Some application examples in C can be found in the "Microchip Application Maestro" software:
**broken link removed**
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top