How to output two complementary PWM waveforms from the PICO microcontroller, by using MicroPython?
pwm_A=PWM(Pin(0))
pwm_A.freq(10000000)
If you use the above two lines, only one way PWM can be output, how to use the code to output two complementary PWM waveforms, one way high when the other is low. And the frequency can reach 1M. This microcontroller is no problem at all.
How to output two complementary PWM waveforms from PICO microcontroller?
Re: How to output two complementary PWM waveforms from PICO microcontroller?
Reading the Quick ref suggest to me that you can generate multiple PWM signals.
Is the problem ... that you can't generate two PWM signals at the same frequency, but with the opposite polarity?
Is the problem ... that you can't generate two PWM signals at the same frequency, but with the opposite polarity?
Re: How to output two complementary PWM waveforms from PICO microcontroller?
An external inverter is not allowed?
Re: How to output two complementary PWM waveforms from PICO microcontroller?
I am only familiar with the PWM on the ATmega88 so had a look at the PICO datasheet. Doesn't seem to have much to say.
Seems more common to use an external H-bridge driver https://www.tomshardware.com/how-to/dc- ... ry-pi-pico
Seems more common to use an external H-bridge driver https://www.tomshardware.com/how-to/dc- ... ry-pi-pico
Re: How to output two complementary PWM waveforms from PICO microcontroller?
I'm pretty sure this can be done on the RP2040 using phase alignment (see 4.5.2.8 in the data sheet), but it is not exposed by the micropython API.
You might instead be able to do this with the PIO though -- see the pio_pwm.py example at https://github.com/micropython/micropyt ... pio_pwm.py