Skip to content
Discussion options

You must be logged in to vote

Works here, but your timing is a bit off.

MicroPython v1.25.0 on 2025-04-15; Raspberry Pi Pico with RP2040

You should bracket your PIO code with wrap_target() and wrap()

@asm_pio()
def test2():
    wrap_target()           #───────────────────────────────────
    set(x, 30)         [12] # 13    section delay 2000 ticks
    label('loop')           #
    nop()              [31] # 32    31×(32+32)+13 ──▶ 1997
    jmp(x_dec, 'loop') [31] # 32
    mov(isr,invert(null))   #  1
    push(noblock)           #  1
    irq(0)                  #  1    1997+3 ──▶ 2000
    wrap()                  #───────────────────────────────────

def ticker(irq, buf=bytearray(8)):
    z = ticks_us()
    s = divmod(z, 

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@ghfbsd
Comment options

@GitHubsSilverBullet
Comment options

@ghfbsd
Comment options

@GitHubsSilverBullet
Comment options

@ghfbsd
Comment options

Answer selected by ghfbsd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants