movw not working (solved! not possible on V6)

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
Post Reply
danjperron
Posts: 51
Joined: Thu Dec 27, 2018 11:38 pm
Location: Québec, Canada

movw not working (solved! not possible on V6)

Post by danjperron » Mon Apr 19, 2021 1:52 pm

I did have to use assembly to speed up a process to play 44.1KHz wave on the pico but I was'nt able to use the code
movw. The only one working is the 8bit version mov.

movw(r3, 32768) or movwt(r3, 32768) don't work!
I got "SyntaxError: unsupported Thumb instruction 'movw' with 2 arguments"

Is there a reason or I was using the wrong syntax.

I had to replace it by
mov(r3,1)
mov(r4,15)
lsl(r3,r4)

My script is on https://github.com/danjperron/PicoAudioPWM
Last edited by danjperron on Tue Apr 20, 2021 7:25 pm, edited 2 times in total.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: movw not working

Post by pythoncoder » Mon Apr 19, 2021 3:41 pm

The Pico instruction set is ARM V6 whereas Pyboards are ARM V7. There are unsupported instructions including all the floating point ones.
Peter Hinch
Index to my micropython libraries.

danjperron
Posts: 51
Joined: Thu Dec 27, 2018 11:38 pm
Location: Québec, Canada

Re: movw not working

Post by danjperron » Mon Apr 19, 2021 7:31 pm

Thanks Peter.

Now I know Why!


Now to set 10 bit PWM I need to do and(r2,#1023)

Then I will do

Code: Select all

mov(r4,255)
lsl(r4,r4,2)
add(r4,r4,3)
and_(r2,r4)
Daniel

Post Reply