Other Parts Discussed in Thread: HALCOGEN, TMS570LS0332, TMS570LS3137
Hi,
I am running CCS6 with Halcogen 4.1 and the TMS570LS0332.
I have Halcogen set up to produce a pwm on pin 0 with a 50% duty cycle and a 7 ms period. This signal gets routed back into the Hercules (eventually through an emergency stop, right not it is directly connected) to pin 6.
I have a 1 ms loop that runs to check the signal integrity. I use capGetSignal (so have cap0 mapped to pin 6) to verify the duty cycle and period, but because these don't update if there is no edge, I set up an edge interrupt on both edges (so edge0 to pin 6). When I get the edge interrupt, I set a flag true. In my 1ms loop, I check if I haven't gotten a true flag for over half of the period. If I have, then my signal is still OK and I can read the duty cycle and period. If I haven't, then I assume the signal has flatlined.
For the most part this works well. However, every once in a while (a couple of seconds to over a minute) the pulse produced by the het skips a period (or two), I have a scope screen shot below.
What could cause the het to skip a period?
Green trace - This line gets toggled when the edge count is over half the period, since I'm not breaking the signal, it should always stay low (or high).
Red trace - toggles in the edge notification where I flag an edge is detected. This should have the same period as the PWM, which it does.
Blue trace - toggles at the start of each loop of my 1 ms main loop.
Yellow trace - test point connected to pin 0 of the nhet. This should always have a signal with 50% duty cycle and 7 ms period.
First picture is normal operation.
Second picture is where the error occurs. You can see that the 1ms loop is running fine. The green signal toggles each time the loop comes through because it hasn't seen an edge for over half the period. See that the pwm out of the nhet skips two periods.


