Skip to content

attachInterrupt forces pin high #757

@tikonen

Description

@tikonen

Hi, There appears to be a bug in attachInterrupt() call.

If pinMode is called on a pin before attachInterrupt is called with 'CHANGE' parameter the pin is forced high.

Minimal example. Tested with Arduino Nano 33 BLE and Mbed OS Nano board 4.0.8.

void dummy() {} // dummy interrupt handler

void setup() {
  pinMode(2, INPUT);
  attachInterrupt(2, dummy, CHANGE);
}

void loop()
{}

Steps to reproduce.

  1. Load the sketch above
  2. Measure voltage on pin 2. It's 3.3V. Expected result is that pin would be floating.

If call to pinMode is commented out, the pin works correctly and does not have a pull-up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions