Electronics > Projects, Designs, and Technical Stuff

microcontroller timers explination

<< < (4/4)

westfw:

--- Quote ---are you saying if i set GPIO 1,3,5 which is the PWM B of PWM 0, 1, 2 repsectively to INPUT mode and at the same time enable the multiplexer to the PWM, i would read the logical OR of the 3 PWM timers? on all the 3 GPIO pins?
--- End quote ---
No?

I think it means that if you set the "Function Select" for GPIO0 and GPIO17 both to "PWM0 B" (F4 - see section 2.19.2) AND you've configured the PWM slice that uses that pin to use it as an input, then whatever the slice does with that input (looks like: gate clock, count rising edges, count trailing edges) will be done with the OR of the two pins.  (I don't see any place where that's likely to be useful?  It seems to be a general feature of the GPIO pins and the function select logic, rather than something specific to the PWM peripheral.)

jeremy0:

--- Quote from: drakejest on September 24, 2021, 10:28:39 pm ---
Is it possible to synchronize timers? for example for some odd reason, i need two pwm signals but im left with pins that are on different timers, so is it possible to spit out a for let say 1000 Hz 50% duty cycle on different timers that are synchronized?

--- End quote ---

The RP2040's PWM EN register (exposing all 8 slices' EN bits) is specifically for this purpose.


--- Quote from: drakejest on September 24, 2021, 10:28:39 pm ---another thing what if i want two PWM signals but the other one is an inverted copy of the first one? should that be done on the same or separate timers?

--- End quote ---

You can use a single PWM slice.  Pins A and B share the TOP value (hence both necessarily have the same frequency), and have distinct compare (CC) values, and so can have different duty cycles if required - and the control register contains A_INV and B_INV bits to invert each output.

Navigation

[0] Message Index

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod