Page 1 of 1
IOC - Arduino
Posted: Fri Aug 11, 2017 11:54 am
by Docara
Hi
Is there a way NOT to have IOC's triggered on both edges on the Arduino UNO R3
Thanks
Matt
Re: IOC - Arduino
Posted: Fri Aug 11, 2017 2:49 pm
by Benj
Hi Matt,
I think it's an all or nothing thing with the IOC interrupt on that device.
There is an example here that uses software to filter out the pins that have changed and which edge, hopefully it will help.
https://www.flowcode.co.uk/wikiv7/index. ... Interrupts
Re: IOC - Arduino
Posted: Fri Aug 11, 2017 3:25 pm
by Docara
Hi Ben,
Thanks for the reply.
From which side? I'm not 100% sure but reasonably confident that according to the Data sheet for the 328P that active high and active low are available (not just INT0 or INT1) on the various pins.
Would you mind double checking your end for me please and give me a definite answer.
Thanks again
Matt
Re: IOC - Arduino
Posted: Fri Aug 11, 2017 4:44 pm
by Benj
Hi Matt,
Looking at the datasheet you can choose which pins can trigger the interrupt but you are fixed to both edges triggering the interrupt on enabled pins.
Re: IOC - Arduino
Posted: Fri Aug 11, 2017 5:01 pm
by Docara
I'm confused -
From the datasheet Section 17 (page 87)
"The External Interrupts can be triggered by a falling or rising edge or a low level. This is set up as
indicated in the specification for the External Interrupt Control Register A (EICRA). When the External
Interrupts are enabled and are configured as level triggered, the interrupts will trigger as long as the pin is
held low. Note that recognition of falling or rising edge interrupts on INT requires the presence of an I/O
clock. Low level interrupt on INT is detected asynchronously. This implies that this interrupt can be used
for waking the part also from sleep modes other than Idle mode. The I/O clock is halted in all sleep modes
except Idle mode."
Am I misunderstanding the operation of Interrupts with the 328P and/or FC
I don't care whether it is rising, falling or level I just want it to fire once per event not twice (rising AND falling as stated in FC properties)
Matt
Re: IOC - Arduino
Posted: Mon Aug 14, 2017 10:16 am
by Benj
Hi Matt,
That section is referring to the INT type interrupt pins which can be configured to interrupt on a single edge and not the IOC interrupt which is both edges.