RBERRYPI ---------------- < Пред. | След. > -- < @ > -- < Сообщ. > -- < Эхи > --
 Nп/п : 40 из 100
 От   : Michael Schwingen                   3:633/10          18 янв 26 10:32:40
 К    : All                                                   18 янв 26 15:06:02
 Тема : Re: Baremetal programiing the Pimoroni Tiny2040 RGB LED
----------------------------------------------------------------------------------
                                                                                 
@MSGID:
<slrn10mpdm8.bh8.news-1513678000@a-tuin.ms.intern> 11ab9d85
@REPLY:
<be0b48e4a9aa74e87d18d03edbbace7103176e96.camel@munted.eu> 6c0e9188
@PID: PyGate 1.5.2
@TID: PyGate/Linux 1.5.2
@CHRS: ASCII 1
@TZUTC: 0000
@REPLYADDR news-1513678000@discworld.dascon.de
@REPLYTO 3:633/10 UUCP
On 2026-01-17, Single Stage to Orbit <alex.buell@munted.eu> wrote:
>> 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

Why not go to the primary source?

I believe the RP2xx0 datasheet has all you need in the PWM chapter (CH 4.5
for RP2040, or CH 12.5 for RP2350).

There is a list of registers with all the relevant bits explained.

> 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!

This is quite common - they probably used a 4-pin LED package with common
anode, so you have to drive the individual lines low to activate the LED. 
You could use 3 external inverters or transistors to make them active high,
but why bother (the parts cost money and take up PCB space) when all it
takes to fix this is a single line of code on the software side?

cu
Michael
-- 
Some people have no respect of age unless it is bottled.

--- PyGate Linux v1.5.2
 * Origin: Dragon`s Lair, PyGate NNTP<>Fido Gate (3:633/10)
SEEN-BY: 19/10 50/109 153/757 218/840 840 220/70
221/1 6 360 226/17 100
SEEN-BY: 229/426 240/1120 267/800 301/1 113 812
310/31 335/364 341/66 463/68
SEEN-BY: 633/10 280 414 418 420 422 509 2744
712/848 770/1 3 100 340 350
SEEN-BY: 772/210 220 230 5019/40 5020/715 848 1042
4441 12000 5030/49 722
SEEN-BY: 5030/1081 1474 5053/55 5061/133 5075/128
@PATH: 633/10 280 770/1 218/840 221/6 301/1
5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх