How one would do PWM AND & OR modulations on PICO? #10321
-
Guys, I am building some special purpose PWM thing, and would like to be able to connect channels to do AND & OR modulations. I am not an expert at all, even the word PWM is something new to me, so the wording might be incorrect. The examples are very simple, the first and second line is Pin 1 & 2, it could be a PWM Channel/Slice or even just a PIN. And the 3rd is the expected output: Masking (AND)Merging (OR)Possible solutions
Do you have other ideas? Maybe I am wrong with some of my assumptions, I would very appreciate if you could give me some hints how one could solve it. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 15 replies
-
As I understand it the PWM should be continuously running ordinary PWM - internally generated. |
Beta Was this translation helpful? Give feedback.
-
You need to give a little more information
|
Beta Was this translation helpful? Give feedback.
-
My IR remote transmitter uses the PIO to generate an OOK (on-off keying) modulated carrier. The file rp2_rmt.py emulates the ESP32 RMT class. Studying the docs for ESP32 RMT will give pointers as to how this can be used. |
Beta Was this translation helpful? Give feedback.
-
I tried the PIO approach just for fun and ended up with the following program:
The cycle to process the logical AND takes 4 PIO instructions here. |
Beta Was this translation helpful? Give feedback.
-
Guys, thanks for your help, I've found a solution in the datasheet, which says, that you can control the pwm counter with the help of the input channel. This has to be enabled, through the register. you simply put a connection between the drive channel (package) and the input channel B of the pulse signal. Maybe this will help someone else in the future: |
Beta Was this translation helpful? Give feedback.
Guys, thanks for your help, I've found a solution in the datasheet, which says, that you can control the pwm counter with the help of the input channel. This has to be enabled, through the register. you simply put a connection between the drive channel (package) and the input channel B of the pulse signal.
Maybe this will help someone else in the future:
PICO Datasheet page 529