Hi chaps
Does this group also include the Raspberry rp2040/rp2350 as well? I'm
in need of resources or the knowledge of how to program the PWMs on the rp2040. If not, are there any online resource I can consult.
The rp2040 datasheets are instrutable on the subject of the PWMs. I can easily blink an ordinary LED, likewise for a RGB LED via three GPIO
pins, but for doing cool tricks like fading/brightening the separate
RGB components on a RGB LED it's beyond me, I think PWMs are needed for
this but all I could find was micropython stuff and that works but I'd
like to know how to do it baremetal with ARM thumb assembly.
Many thanks,
Alex
Does this group also include the Raspberry rp2040/rp2350 as well?
The rp2040 datasheets are instrutable on the subject of the PWMs.
Hi chaps
Does this group also include the Raspberry rp2040/rp2350 as well?
like to know how to do it baremetal with ARM thumb assembly.
like 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...
From: https://www.raspberrypi.com/documentation/pico-sdk/hardware.html#group_hardware_pwm
However: There is a section on hardware PWM in the Pico-series C/C++
SDK, have you seen that?
I confess it's not something I've played with, but it doesn't look
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 be
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 ...
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: | Jacob Catayoc |
|---|---|
| Location: | Pasay City, Metro Manila, Philippines |
| Users: | 5 |
| Nodes: | 4 (0 / 4) |
| Uptime: | 24:22:37 |
| Calls: | 117 |
| Calls today: | 117 |
| Files: | 368 |
| D/L today: |
560 files (257M bytes) |
| Messages: | 70,924 |
| Posted today: | 26 |