Skip to content

External interrupts misfiring #9704

Open
@tolletrolden

Description

@tolletrolden

Looks like attachInterrupt(digitalPinToInterrupt(2), juhu, FALLING); always akt like CHANGE.

No matter what i choose - RISING, FALLING, HIGH or CHANGE it always behave like CHANGE.

Here is the simple sketch:

void setup()
{
  pinMode(2, INPUT);
  pinMode(3, OUTPUT);

  attachInterrupt(digitalPinToInterrupt(2), juhu, RISING);
}

void loop()
{
}

void juhu() {
  digitalWrite(3, HIGH);
  delayMicroseconds(200);
  digitalWrite(3, LOW);
}

Then top two lines on the scope picture, is a nice clean square wave, made by an optocoupler.
The buttom two lines is the resulting signal on output pin 3.

No matter, if i stand on my head and sing a terrible song, or choose RISING, FALLING or CHANGE, the result is the same - always two signals with one square wave.

Can You tell me what is wrong?

I think the arduino ide translates all modes to CHANGE

image-20200131_140816

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: CoreRelated to the code for the standard Arduino APIType: Bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions