Arduino UNO Interrupt

An area to discuss AVR and Arduino specific problems and examples

Moderator: Benj

Post Reply
AqaFlow
Posts: 34
Joined: Mon May 16, 2016 2:03 pm
Has thanked: 6 times
Been thanked: 9 times
Contact:

Arduino UNO Interrupt

Post by AqaFlow »

How can I trigger interrupt on LOW state for Arduino UNO, I mean not on CHANGE or FALLING, but on LOW state
(Flowcode 7)
as from ARDUINO Refernce "LOW to trigger the interrupt whenever the pin is LOW"

Thanks in advance
Amrat

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Arduino UNO Interrupt

Post by Benj »

Hello,

Which interrupt are you looking at in the AVR datasheet?

AqaFlow
Posts: 34
Joined: Mon May 16, 2016 2:03 pm
Has thanked: 6 times
Been thanked: 9 times
Contact:

Re: Arduino UNO Interrupt

Post by AqaFlow »

I am not expert in programming so not look deep into data sheet but what I mean is in Arduino IDE INT0 INT1 , please see below paragraph from Arduino Refernce,

Parameters
interrupt: the number of the interrupt (int)
pin: the pin number (Arduino Due, Zero, MKR1000 only)
ISR: the ISR to call when the interrupt occurs; this function must take no parameters and return nothing. This function is sometimes referred to as an interrupt service routine.
mode: defines when the interrupt should be triggered. Four constants are predefined as valid values:

LOW to trigger the interrupt whenever the pin is low, <============

CHANGE to trigger the interrupt whenever the pin changes value

RISING to trigger when the pin goes from low to high,

FALLING for when the pin goes from high to low.
The Due, Zero and MKR1000 boards allows also:

HIGH to trigger the interrupt whenever the pin is high.


But in Flowcode INT Icon property, LOW is not available ??

Thanks
Amrat

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Arduino UNO Interrupt

Post by Benj »

Hello,

I'm looking at this for you now. Which version of Flowcode are you using?

AqaFlow
Posts: 34
Joined: Mon May 16, 2016 2:03 pm
Has thanked: 6 times
Been thanked: 9 times
Contact:

Re: Arduino UNO Interrupt

Post by AqaFlow »

Flowcode 7

Thanks

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Arduino UNO Interrupt

Post by Benj »

Hello,

Thanks for letting me know which version, I've moved the topic so it's now in a better location.

If you extract the attached files into your "Flowcode 7/FCD/AVR" directory and restart Flowcode then the extra interrupt settings should now be available.
AVR.zip
(69.18 KiB) Downloaded 329 times
Let us know how you get on.

AqaFlow
Posts: 34
Joined: Mon May 16, 2016 2:03 pm
Has thanked: 6 times
Been thanked: 9 times
Contact:

Re: Arduino UNO Interrupt

Post by AqaFlow »

Hi Benj,
Sorry for very late reply.
Your provided AVR.zip is great now I got LOW setting as well.

BUT Interrupt on HIGH is still not show in the drop down menu of " Interrupt Edge Select "
Only available,
Rising Edge of INT
Falling Edge of INT
Any Edge of INT
Low Level of INT

no High level of Pin to trigger INT !!
Flowcode v7.3.0.5 (Dec 14 2017)


Thanks again.
Amrat

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Arduino UNO Interrupt

Post by Benj »

Hello Amrat,

In the datasheet for the ATMEGA328P it only gives these options for the interrupt.

Low Level, Logical Change, Falling Edge, Rising Edge.

So I don't think the chip supports a High option.

AqaFlow
Posts: 34
Joined: Mon May 16, 2016 2:03 pm
Has thanked: 6 times
Been thanked: 9 times
Contact:

Re: Arduino UNO Interrupt

Post by AqaFlow »

Benj,
Thanks. Ok all clear

Post Reply