PinChangeInterrupt management

24 views
Skip to first unread message

Balázs Kelemen

unread,
Nov 24, 2015, 5:11:49 AM11/24/15
to Developers
Hi All,

  I have some software solutions using the PCI, where the users reported to have conflict with the SoftwareSerial library provided by Arduino. It turns out that SoftwareSerial has switched to PCI, so both of us defining the interrupt handlers.

  The right way solving this issue, is to have a manager software, that spreads interrupt event to the listeners.

  Actually I do have a library, that can be a good basis for a final solution:
    https://github.com/prampec/arduino-pcimanager

  I just wonder what is your opinion about this problem, and how can we force the SoftwareSerial (and possibly other libraries) to let others use PCI in the same time.

Thanks,
Balazs

William Westfield

unread,
Nov 25, 2015, 5:11:25 AM11/25/15
to devel...@arduino.cc

> The right way solving this issue, is to have a manager software, that spreads interrupt event to the listeners.

Implementing an additional level of indirection is quite “expensive” on AVRs. Just the wrapper for attachInterrupt() takes about 40 cycles (compared to a relatively simple (non-redirecting) function like the timer ISR that drives millis(), which takes about 75 cycles total.

BillW/WestfW

Reply all
Reply to author
Forward
0 new messages