analogWrite does not work well with Arduino RP2040 board

Aperta
#1,079 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
arduino, c
Ambito
embedded-iot

Direzione di ricerca

Inizia riproducendo il report su una scheda Arduino RP2040 con la configurazione minima usando analogWrite su D8 e D12, quindi confronta il comportamento con digitalWrite e con i casi segnalati D17–D19. Traccia l’implementazione di analogWrite di ArduinoCore-mbed e le mappature dei pin della scheda; il lavoro è completato quando valori PWM indipendenti funzionano sui pin testati e digitalWrite continua a funzionare in seguito.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Hi!

I wanted to do something really simple. Having several LEDs controlled by PWM.
Everything was working very weird with analogWrite so I tried several boards and reduced the setup to the minimal.
It is really easy to reproduce, just put one LED on D8 and one another on D12 with appropriate pull-down resistors.
Use this simple two lines of code into the setup function which only use analogWrite to lit up the LEDs to independant values.
analogWrite(8, 255);
analogWrite(12, 0);
and
analogWrite(8, 0);
analogWrite(12, 255);

When applying those PWM, the last one is always taken for both LEDs.
It behaves exactly like there was an overwrite of the first one by the second one.
Using only digitalWrite works well to lit up one LED and not the other one and vice versa but if one analogWrite have been used digitalWrite does not work anymore.
I checked the schematics several times, there is no reason why it would do that in hardware.
I believe this is a software bug, but I was not able to find where. I am running with the last board package 4.3.1.
It seems there is the same bug with D17, D18 & D19 while those last ones have pull-ups because they are used by I²C this may explain the link between D18 & D19 but not D17!

Lingua principale
C
Stelle
411
Fork
229
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di arduino/ArduinoCore-mbed

Tutte le issue di arduino/ArduinoCore-mbed

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.