I've found the following: https://github.com/thejpster/rp-hal-rp2350-public/blob/main/rp235x-hal/examples/pwm_blink.rslike to know how to do it baremetal with ARM thumb assembly.
... my use is the RISC-V cores in the rp2350, so bare metal RISC-V asembly.... But the principle for programming the PWM generators
is more or less the same from eith CPU, so I understand, but it's
something I've not gotten round to.
I'd suggest to have a look at the manual and SDK and see how to do it
from C then hand translate the C code into ASM...
However: There is a section on hardware PWM in the Pico-series C/C++Oh interesting, I can take a look at that. Hopefully the sources will
SDK, have you seen that?
I confess it's not something I've played with, but it doesn't lookNo, you're right, thankfully I don't need to go down that PIO rabbit
too impenetrable ... it doesn't require PIO programming (something
else I haven't played with yet) like another example I found.
I'm not sure how long ago I downloaded this SDK so it may not beThanks.
quite current ... but it's section 4.1.18 on P249.
If you used a capable search engine you might stumble across this:
https://forums.raspberrypi.com/viewtopic.php?t=344634
which seems to shed some light ...
From: https://www.raspberrypi.com/documentation/pico-sdk/hardware.html#group_hardware_pwmExcellent, I missed that one.
I'd suggest to have a look at the manual and SDK and see how to do it
from C then hand translate the C code into ASM...
I've found the following:
https://github.com/thejpster/rp-hal-rp2350-public/blob/main/rp235x-hal/examples/pwm_blink.rs
The funny thing is that the Pimoroni tiny2040 that I also have has a
RGB LED on it, there's no data sheet for it but it appears to be
reversed, in that all the GPIO pins attached to this LED are all active
low, (i.e ~R GPIO18, ~B GPIO19, ~G GPIO20) so works in the opposite way
to the LED on GPIO 25 on rp2040!
The funny thing is that the Pimoroni tiny2040 that I also have has a
RGB LED on it, there's no data sheet for it but it appears to be
reversed, in that all the GPIO pins attached to this LED are all active
low, (i.e ~R GPIO18, ~B GPIO19, ~G GPIO20) so works in the opposite way
to the LED on GPIO 25 on rp2040!
| Sysop: | DaiTengu |
|---|---|
| Location: | Appleton, WI |
| Users: | 1,126 |
| Nodes: | 10 (0 / 10) |
| Uptime: | 51:16:38 |
| Calls: | 14,414 |
| Calls today: | 2 |
| Files: | 186,401 |
| D/L today: |
10,488 files (2,848M bytes) |
| Messages: | 2,548,929 |
| Posted today: | 1 |