• Re: Pi Pico Python speed

    From Peter Heitzer@3:770/3 to Andy Burns on Fri Feb 9 12:09:06 2024
    Andy Burns <usenet@andyburns.uk> wrote:
    Peter Heitzer wrote:

    john larkin wrote:

    Cool. We just did a MicroPython loop to raise and lower a port pin 4
    times, brute force inline code, as fast as we could. One up/down cycle
    takes about 14 microseconds on a Pico, with some jitter.

    We'll repeat it in c. I'm guessing that will be 20x faster.

    I did a quick test yesterday evening using this few lines of code:
    I got 83 kHz.

    I think if you want the fastest cycle time, you'd use the RP2040's PIO
    state machine, and probably get 62MHz without overclocking, but then
    that's not really testing MicroPython ...
    Although the PIO code could be written in MicroPython with the
    decorator @rp2.asm_pio().

    --
    Dipl.-Inform(FH) Peter Heitzer, peter.heitzer@rz.uni-regensburg.de

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Andy Burns@3:770/3 to Peter Heitzer on Fri Feb 9 12:36:29 2024
    Peter Heitzer wrote:

    the PIO code could be written in MicroPython with the decorator @rp2.asm_pio().

    I should get a Pico to play with ...

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From The Natural Philosopher@3:770/3 to Andy Burns on Fri Feb 9 13:53:15 2024
    On 09/02/2024 12:36, Andy Burns wrote:
    Peter Heitzer wrote:

    the PIO code could be written in MicroPython with the decorator
    @rp2.asm_pio().

    I should get a Pico to play with ...


    The worst part is getting a toolchain working: and understanding the
    APIs. If you don't want to use Python.

    Coding the little fuckers is pretty simple after that.


    --
    "What do you think about Gay Marriage?"
    "I don't."
    "Don't what?"
    "Think about Gay Marriage."

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)