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
movw not working (solved! not possible on V6)
-
- Posts: 51
- Joined: Thu Dec 27, 2018 11:38 pm
- Location: Québec, Canada
movw not working (solved! not possible on V6)
Last edited by danjperron on Tue Apr 20, 2021 7:25 pm, edited 2 times in total.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: movw not working
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.
Index to my micropython libraries.
-
- Posts: 51
- Joined: Thu Dec 27, 2018 11:38 pm
- Location: Québec, Canada
Re: movw not working
Thanks Peter.
Now I know Why!
Now to set 10 bit PWM I need to do and(r2,#1023)
Then I will do
Daniel
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)