Skip to content

millis() not working: Incorrect hardware timer defined for 14 and 20 pin devices in arduino.py #65

@objekt58325

Description

@objekt58325

On DD-series with 14 or 20 pins, TCB1 is the default millis timer (see https://github.com/SpenceKonde/DxCore/blob/master/megaavr/extras/Ref_Timers.md).
But in arduino.py the timer TCB2 is defined for all DxCore dvices.
ref: https://github.com/platformio/platform-atmelmegaavr/blob/aae69d4c9d317ef2e63e2e7ca89ba8ac5b85c6fb/builder/frameworks/arduino.py#L137C25-L137C25

One workaround is to define the millis()-timer in platformio.ini:

[env:AVR64DD20] 
board = AVR64DD20
board_hardware.millistimer = B1
...

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