Page 1 of 1

movw not working (solved! not possible on V6)

Posted: Mon Apr 19, 2021 1:52 pm
by danjperron
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

Re: movw not working

Posted: Mon Apr 19, 2021 3:41 pm
by pythoncoder
The Pico instruction set is ARM V6 whereas Pyboards are ARM V7. There are unsupported instructions including all the floating point ones.

Re: movw not working

Posted: Mon Apr 19, 2021 7:31 pm
by danjperron
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