Start multiple PWM Simultaneously

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Mrinal
Level 4
Level 4
First solution authored 50 replies posted 25 replies posted

Hello

How can I start multiple PWM together without using hardware trigger signal. In PSoC-4 we could do the following:

PWM_1_TriggerCommand(PWM_1_MASK | PWM_2_MASK, PWM_1_CMD_START);

This would start PWM_1 and PWM_2 simultaneously.

How can I do the same with PSoC-6?

Thanks

0 Likes
1 Solution
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

Mrinal,

Which PSoC6 device are you targeting?

The PSoC6 does not provide a "SW" means of synchronizing the PWMs.   It uses a PDL-style of coding which in itself does not allow for combined 'starts', 'stops' or 'kills' of multiple PWM channels.

How 'synchronized' must the PWM channels be?   You can serially start multiple PWM channels with a fast BUS_CLK and very low latency if you temporarily turn off GLobal Interrupts.

Some PSoC6s have UDBs available.   This allows you to create an internal HW signal path (without exiting the IC) to synchronize starts.

Another less elegant way is to 'gate' the PWM clock source.   If the PWMs are attached to the same clock, you can turn off the PWM clock source, start the PWM in SW by writing to the PWM registers, then restart the PWM clock source.

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

0 Likes
1 Reply
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

Mrinal,

Which PSoC6 device are you targeting?

The PSoC6 does not provide a "SW" means of synchronizing the PWMs.   It uses a PDL-style of coding which in itself does not allow for combined 'starts', 'stops' or 'kills' of multiple PWM channels.

How 'synchronized' must the PWM channels be?   You can serially start multiple PWM channels with a fast BUS_CLK and very low latency if you temporarily turn off GLobal Interrupts.

Some PSoC6s have UDBs available.   This allows you to create an internal HW signal path (without exiting the IC) to synchronize starts.

Another less elegant way is to 'gate' the PWM clock source.   If the PWMs are attached to the same clock, you can turn off the PWM clock source, start the PWM in SW by writing to the PWM registers, then restart the PWM clock source.

Len
"Engineering is an Art. The Art of Compromise."
0 Likes