Hi there,
first up I want to ask you to be gentle since this is my first post.
As the title suggests, I am experiencing some strange behaviour when trying to use the counter compare when the counter is running above the specified period.
The setup:
I am using Simulink C2000 integration for code generation and deployment onto the Launchpad. Therein I am using the ePWM Type 1-4 Blocks to configure the registers.
I am using ePWM1 to generate a "low frequency" sync pulse which is used to sync and thereby set the phase of ePWM 2 to a value. ePWM 2 is counting at a much higher pace and is counting in up/down mode.
What i wan to achieve:
For a complicated pulse pattern, which I want to create, I want to set the time base counter to a value above the specified period for that register. The counter should (since it is in up/down mode):
- normally count
- then get synced to a value higher than the period (T = 5000) (in my case 60000), counting up after the sync
- then after a bit of counting reach Compare Match A and consequently set the pin
- then reach 65535 and flip its counting direction
- after a bit of counting down reach Compare Match A again and consequently clear the pin
- then count down further until it reaches 0
- start a new period which is unaffected by the previous sync
What I have found:
The Compare Match works as long as the action carried out by compare match A doesn't change the pins output (so for example the pin is already low and is cleared by the compare match action).
The Compare Match works perfeclty with an action that alters the pattern if it's value is smaller than the period.
As soon as I set the value of compare match A to something greater than the period and set the action of compare match A to something that would alter the pattern, the PWM pattern completely dissappears from the pin.
If you need more info please tell me, I am curious if this behaviour is defined or if it may even be simulink that is the killjoy.