Skip to content

Pin output extremly slow #55

@robert-hh

Description

@robert-hh

Changing the value of a Pin with the pin method is extremely slow. It takes about 2.5 ms (!) to change the pin output level. A 0/1 burst then has a frequency of 200 Hz.
Other micropython port are in the range of 1-4 µs, 1000 times faster.
Is there any way to speed this slow pace?

Test code:

from machine import Pin
p1 = Pin("D1", Pin.OUT, value=1)

def run():
    global p1
    p = p1
    p.value(0);p.value(1)
    p.value(0);p.value(1)
    p.value(0);p.value(1)
    p.value(0);p.value(1)
    p.value(0);p.value(1)
    p.value(0);p.value(1)
    p.value(0);p.value(1)
    p.value(0);p.value(1)
    p.value(0);p.value(1)
    p.value(0);p.value(1)

run()

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestxbee change neededA change to XBee firmware is needed to close this out

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions