Skip to content

Use PINx to toggle pins. #27

@timower

Description

@timower

Currently DirectIO uses a read, flip, write sequence to toggle output pins.
This can be done faster by using the PINx registers (on some targets?).
See section 14.2.2 of the ATMega328 manual:

14.2.2 Toggling the Pin
Writing a logic one to PINxn toggles the value of PORTxn, independent on the value of DDRxn. Note that the SBI instruction can be used to toggle one single bit in a port.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions