Please how do I enable a level sensitive interrupt for my PIC on mikro c?

In all the sites I have checked, its only the INTEDG command to enable  rising or falling edge interrupt. Please how can I enable a level triggered interrupt on my PIC18F14K22 with mikroc compiler? Thank you. 

sort by: active | newest | oldest
iceng2 years ago

You cannot interrupt on an analog voltage point.

You can trigger on a counter going through zero and you can trigger on a high or a low level.

Say you want to trigger when a pin is high level.

Well unless that pin is already high when you enable the interrupt,

The logical situation is that pin starts out low and you want to interrupt when it is high...

Interrupting is faster then poling the pin, Well the fastest interrupt occurs when the pin just went high.

In fact the fastest way to detect a high pin is the so-called rising edge detect interrupt on change detect.

The upshot is that PIC has no Level interrupt because it makes no sense.

Look it up yourself on part 7.

Plenty of processors HAVE digital level sensing interrupts - the 8052 family for one. Simply, while the interrupt pin is high, the interrupt routine fires (or if its low, depending on the config)

ikechukwu.dimobi (author)  steveastrouk2 years ago

Thank you very much, its clear now.

ikechukwu.dimobi (author)  iceng2 years ago

Thank you. So what you are saying is that PIC MCUs dont hae level trigered interrupt capability

Yes, it looks like they can only be edge-triggered. What are you trying to do that needs level-triggered interrupts ?

This level triggering is vague

Say author wants to trigger on a high

Does author want to trigger some time after the pin goes high ?

Or does author want to trigger immediately when the pin goes high ?

WHILE the pin is high.

That means that as soon as the interrupt is enabled the interrupt will activate because the line is already high.. That is the same as polling the line.

Except the interrupt hardware does it for you.

Yes and why not

seandogue2 years ago

"... how do I enable a level sensitive interrupt...?"

A threshold detector will produce the signal you need to trip the interrupt. GOogle the bolded term if you are unfamiliar