Synchronous PWM

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

Synchronous PWM

Post by Lord Grezington »

Hello All

Im looking to use the 33EP32MC504 chip, but I have a few questions with regards to the PWM's.

1. If I use two PWM components, on say channel 1 & 2, and I set them both to work of the same timer and all the same settings (frequency, Prescaler etc...) I then tell both of them to set a duty cycle of the same value, will both PWM's be exactly the same with no offset between them?

2. Is there any possible way I can make one of the PWM's the exact opposite to the other? (not using the MC synchronous feature of the 33EP32MC504).

3. The 33EP32MC504 says it has 6 PWM channels, when used as 3 synchronous pairs... However with FC6 I think it says there are 4 channels. I assume to switch over to this feature I will need to set the PENH/L values in the IOCONx register?

Thanks in advance...

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Synchronous PWM

Post by Benj »

Hello,
1. If I use two PWM components, on say channel 1 & 2, and I set them both to work of the same timer and all the same settings (frequency, Prescaler etc...) I then tell both of them to set a duty cycle of the same value, will both PWM's be exactly the same with no offset between them?
Yes this is correct.
2. Is there any possible way I can make one of the PWM's the exact opposite to the other? (not using the MC synchronous feature of the 33EP32MC504).
Advanced PWM is something we have wanted to support for a while. The main issue is that the chips and features are so varied that covering everything is a massive task. One potential easy quick fix is to use an inverting buffer IC on the output of one of your PWM channels. This is not ideal but will work and is fairly low cost and simple. In fact if your using an external inverting buffer then you might as well use a single PWM channel and invert this and this provides your two signals, the original PWM signal from the uC and the inverted version coming from the buffer.
3. The 33EP32MC504 says it has 6 PWM channels, when used as 3 synchronous pairs... However with FC6 I think it says there are 4 channels. I assume to switch over to this feature I will need to set the PENH/L values in the IOCONx register?
v7 only lists 4 channels too, we currently support the 4 output compare peripherals (OC) but not the 6 motor control peripherals.
I'll get them on the list to investigate how easy it would be to add support for them.

Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

Re: Synchronous PWM

Post by Lord Grezington »

Hello Ben

Thanks for this, I have just been looking at using some XOR gates and currently simulating them in LTSPICE for all the various PWM's that I need.

Please can you confirm how I would go about setting the motor control PWM's if/when I need them? (confirm its the PENH/L values in the IOCONx register that need to be changed suing C code)

Thanks

Post Reply