Skip to content

pio_blink.py and pio_irq.py examples uses 1000Hz frequency which is too low for Pi Pico #18

Closed
@kevinjwalters

Description

@kevinjwalters

The examples https://github.com/raspberrypi/pico-micropython-examples/blob/master/pio/pio_irq.py and https://github.com/raspberrypi/pico-micropython-examples/blob/master/pio/pio_blink.py set a frequency of 1000Hz using freq=1000.

If my understanding is correct then the maxium divisor is 65535 + 255/256 which at typical 125MHz gives 1907.349Hz as the lowest achievable frequency. That makes these examples misleading as that frequency cannot be achieved and is almost wrong by a factor of 2.

Is 2000Hz as used by https://github.com/raspberrypi/pico-micropython-examples/blob/master/pio/pio_1hz.py a better choice for low frequency for examples? That's precisely attainable at 125MHz and close at 133Mhz (1.47% over).

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