Arduino UNO Interrupt

An area to discuss AVR and Arduino specific problems and examples

Moderator: Benj

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

Arduino UNO Interrupt

Postby AqaFlow » Tue Jan 30, 2018 5:44 pm

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: 14130
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4325 times
Been thanked: 4070 times
Contact:

Re: Arduino UNO Interrupt

Postby Benj » Wed Jan 31, 2018 1:38 pm

Hello,

Which interrupt are you looking at in the AVR datasheet?

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

Re: Arduino UNO Interrupt

Postby AqaFlow » Wed Jan 31, 2018 4:13 pm

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: 14130
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4325 times
Been thanked: 4070 times
Contact:

Re: Arduino UNO Interrupt

Postby Benj » Wed Jan 31, 2018 4:18 pm

Hello,

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

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

Re: Arduino UNO Interrupt

Postby AqaFlow » Thu Feb 01, 2018 1:09 am

Flowcode 7

Thanks

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

Re: Arduino UNO Interrupt

Postby Benj » Thu Feb 01, 2018 11:04 am

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 46 times


Let us know how you get on.

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

Re: Arduino UNO Interrupt

Postby AqaFlow » Sun Mar 25, 2018 9:58 am

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: 14130
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4325 times
Been thanked: 4070 times
Contact:

Re: Arduino UNO Interrupt

Postby Benj » Mon Mar 26, 2018 3:31 pm

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: 28
Joined: Mon May 16, 2016 2:03 pm
Has thanked: 5 times
Been thanked: 9 times
Contact:

Re: Arduino UNO Interrupt

Postby AqaFlow » Mon Mar 26, 2018 4:10 pm

Benj,
Thanks. Ok all clear