|
Post by lockstepper on Jan 18, 2019 12:19:11 GMT
Hello,
we are using in tc26xx the TOM0 and TOM1 to ouptut 20 PWM channels. Is there a way to control a phase shift between all those channels? PWM Frequency range would be 25Hz to 25.000Hz.
Best regards
|
|
|
Post by Admin on Jan 21, 2019 16:09:15 GMT
Yes. You can apply a offset to the CN0 register so that each TOM will get to the end of the period early. You cannot easily this using the Arduino-style functions.
|
|
|
Post by aurixguru on Jan 21, 2019 17:13:01 GMT
hello
|
|
|
Post by aurixguru on Jan 21, 2019 17:21:56 GMT
Yes it is possible to offset PWMs channels using the counter value CN0 which is present in each TOM channel. If you want a fixed offset time value which does not change then when the GTM-TOM channel is configured (when the clock is not running) you can specify a start value for CN0 by writing to this register. Once the clock is enabled to all the GTM-TOM channels they will all run synchronously with each other. Changing the phase shift during run time is much harder as the counter value is a moving target, and so adding or subtracting an offset is very difficult, without stopping all of the timers together. Therefore the question has an easy solution providing you do not require dynamic adjustment of the phase offset. As you also have the channels spread across two TOM modules then its the GTM_CTBM_CMU_FXU fixed clock you need to stop. All TOMs use the fixed clocks and there is one enable bit for this clock in the CMU registers. GTM_CMU_CLK_EN.B.EN_FXCLK
|
|
|
Post by lockstepper on Jan 29, 2019 13:34:41 GMT
Hello Everyone,
I tested it and it serves my purpose this way, thank you!
|
|
sinai1
Junior Member

Posts: 65
|
Post by sinai1 on Jul 16, 2021 19:56:33 GMT
can please share a example of this?
|
|