Skip to content

Precisely Synchronizing Low Rate SM to Async Edge - Arm Thumb help needed #16449

Discussion options

You must be logged in to vote

Hello @mungewell

I tried this interesting problem:

3). How to do a 'vectored' jump into code, ie to jump over a (changable) number of nops().

and found that you may adjust your delays to the clock resolution, as intended:

@micropython.asm_thumb
def asm_udelay(r0, r1):
    b(START)
    label(DELAY)
    data(2, 0x4487)  # add(r15, r15, r0)
    nop()
    nop()
    nop()
    nop()
    nop()
    nop()
    nop()
    nop()
    nop()
    nop()
    nop()
    nop()
    nop()
    nop()
    nop()
    nop()
    bx(lr)
    label(START)
    bl(DELAY)
    sub(r1, 1)
    cmp(r1, 1)
    bge(START)

from time import ticks_us, ticks_diff

for k in range(0, 32, 2):
    start = ticks_us()
    asm_udelay(k, 1…

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
1 reply
@mungewell
Comment options

Comment options

You must be logged in to vote
4 replies
@rkompass
Comment options

Answer selected by mungewell
@mungewell
Comment options

@mungewell
Comment options

@mungewell
Comment options

Comment options

You must be logged in to vote
2 replies
@mungewell
Comment options

@mungewell
Comment options

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