Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing digitalPinToInterrupt definition #81

Open
madmalkav opened this issue Sep 16, 2015 · 7 comments
Open

Missing digitalPinToInterrupt definition #81

madmalkav opened this issue Sep 16, 2015 · 7 comments

Comments

@madmalkav
Copy link

The core doesn't define digitalPinToInterrupt for attinys.

I think correct implementation for attiny8 is:

define digitalPinToInterrupt(p) ( (p) == 2 ? 0 : -1)

and for attiny14:

define digitalPinToInterrupt(p) ( (p) == 8 ? 0 : -1)

@NicoHood
Copy link

@eried
Copy link

eried commented Dec 15, 2015

I though the sale but it seems all pins can be interrupt in the tiny85. Does anyone have a working interruptions code with damellis/attiny?

@NicoHood
Copy link

No this is wrong.

There are PinInterrupts (1 on Attiny I think) and PinChangeInterrupts (all pins on Attiny x5).

This code should work, but was never tested by me, at least not for Attinys, but for All other platforms:
https://github.com/NicoHood/PinChangeInterrupt

PinInterrupt issue still exist though, and should be added as well.

@eried
Copy link

eried commented Dec 15, 2015

Thanks @NicoHood I'll try. I tried some other similar code but there was some incompatibility with SoftwareSerial.

@NicoHood
Copy link

It is incompatible too. Otherwise you have to code your own interrupt vectors. Then you are working on such a low level where the Arduino IDE doesnt suit your needs anymore or a 328 would be the better choice.

@eried
Copy link

eried commented Dec 16, 2015

Yeah, I am going to use a 328. Too much hustle. The tiny85 is just lovely, but not this time

@matthijskooijman
Copy link

FWIW, I think the discussion above about supporting PCINT interrupts on all pins is orthogonal to the subject of this issue. The digitalPinToInterrupt() macro should apply for pins supported by the attachInterrupt() function, which I think the above proposals do. The PCINT interrupts are not supported by attachInterrupt(), but this applies equally to ATmega and ATtiny.

TheLastGimbus added a commit to TheLastGimbus/EasyButton that referenced this issue Jan 30, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Problem: damellis/attiny#81

Stolen from: tkem/mbino@34cbb89
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants