Project

General

Profile

We interrupt this program - Pin changes, levels, and edges

Added by JohnO almost 5 years ago

> Another note is that for this simplest of all cases, interrupts would not even have been needed. All pin changes are latched and remembered by the hardware – with a slightly different approach, we could have checked (and then cleared) the hardware flag without risk of missing any edge events.

That is a very interesting feature slipped in there. Does the hardware remembered changed flag stay set even if the change reverses - prior up the code resetting it obviously.

I have just read the pattern match section again and am very impressed by it.


Replies (2)

RE: We interrupt this program - Pin changes, levels, and edges - Added by jcw almost 5 years ago

Yes, hence the need to clear the flag in the ISR, i.e. 1) event sets, 2) code clears - in all scenarios.

The only special case is when change events come in faster than you can service them (worst case) and you need to know that it happened more than once.
In such a case simple pin changes are no longer sufficient. Then you’ll need to use a hardware counter (this can be done in the LPC8xx with the SCT).

-jcw

RE: We interrupt this program - Pin changes, levels, and edges - Added by jscrane almost 5 years ago

On a maybe-related note, I’ve been playing around with higher-level abstractions for devices and interrupts on Arduino.

I’ve just written a post about it here: http://programmablehardware.blogspot.ie/2015/05/interrupted.html

Really glad you’ve started blogging again jcw!

    (1-2/2)