Tuesday, 27 September 2016

What's the actual difference between Edge sensitive and Level sensitive interrupts


Currently I'm working on a C8051F120 MCU where External Interrupts can be defined in two ways:




  1. Edge sensitive (Falling)

  2. Level sensitive (low-level)


In level-sensitive interrupts as soon as the MCU detects a low level at the external pin it will execute the ISR which is the same as detecting a falling edge.


I know I'm wrong as both can't be the same. Hence I'm asking this question: what's the actual difference between the two, in their detection procedure or in the execution of the ISR?



Answer



Its exactlly what is says.


If edge interrupt is set, the ISR will only get fired on falling/rising edge of a pulse. While if level sensitive interrupt (as you say) is set the ISR will get fired everytime there is a low-level/high-level signal on the corresponding pin.


In short, edge interrupt gets fired only on changing edges, while level interrupts gets fired as long as the pulse is low or high.


So if you have low-level interrupt set, MCU will keep executing the ISR as long as the pin is low.



No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...