Interrupts on PICs - Page 1
Forum section: electronics / general

author: deephaven
author_rank: Frequent Contributor
timestamp: July 07, 2011, 11:00:45 am
content: Are there any PICS in the 16/18/24 range that have LEVEL sensitive interrupts rather than edge sensitive ones?

author: PeterG
author_rank: Frequent Contributor
timestamp: July 07, 2011, 12:12:20 pm
content: The only way you could achieve this is with the analog input. Digital inputs cant be used for this purpose.You may need to poll the analog input.Regards

author: dimlow
author_rank: Frequent Contributor
timestamp: July 07, 2011, 12:27:12 pm
content: I better way would be to use the comparator of a pic, see herehttp://ww1.microchip.com/downloads/en/DeviceDoc/41215c.pdfThey have interrupts and that would give you your level interrupt

author: PeterG
author_rank: Frequent Contributor
timestamp: July 07, 2011, 12:49:39 pm
content: Didn't think of those Dimlow.Regards

author: Mechatrommer
author_rank: Super Contributor
timestamp: July 07, 2011, 01:35:53 pm
content: still you need an external analog Vref, except simpler (2 resistors?).

author: deephaven
author_rank: Frequent Contributor
timestamp: July 07, 2011, 03:16:43 pm
content: Thanks for the replies. I never thought about using an analogue input as an interrupt source as other makes of micro have the ability to choose between edge and level sensitive interrupts. I will look into this as a possible solution.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: July 07, 2011, 03:41:36 pm
content: Assuming you are talking about the traditional meaning of level-sensitive, i.e. maintain the int condition for as long as the pin is at the corresponding level, just interrupt on the edge and poll the pin until it goes inactive.If you mean int at a specific voltage level, that's what comparators are for.

author: deephaven
author_rank: Frequent Contributor
timestamp: July 07, 2011, 04:03:36 pm
content: Hi Mike,It's the former. The trouble is I have around twelve possible sources of interrupt all going into the same pin and I don't want to miss any. This means after I get an interrupt caused by the edge of the first one, I have to then go and see if there have been any others (this is all done with an FPGA as the source, so I can look at the register in in FPGA to see what interrupts are pending). However, it is still possible to miss an interrupt if I get one between when I've done a poll at the end of the old interrupt and returning to the background. In the past I've made psuedo level driven interrupts by gating the interrupts with a square wave so that it keeps knocking at the PIC's door till it gets serviced.

author: Rufus
author_rank: Super Contributor
timestamp: July 08, 2011, 02:40:07 am
content: Quote from: deephaven on July 07, 2011, 04:03:36 pmI don't see there is any issue. The interrupt edge trigger is re-armed by clearing the interrupt flag not returning. If you check the interrupt pin level after clearing the interrupt flag a new interrupt will either be seen by the level check or set the interrupt flag again if it occurs later.

author: deephaven
author_rank: Frequent Contributor
timestamp: July 08, 2011, 08:01:53 am
content: Quote from: Rufus on July 08, 2011, 02:40:07 amI think that has been what I was doing wrong, I would check the interrupt status bit in the PIC but I should have been looking at the pin. Thanks Rufus.