Hello,
I'm using DCC2 to compare the 16MHz oscillator (Count0) to a 9.974KHz PWM on N2HET2:0 (Count1).
I used HALCoGen to set up a 20% drift over 2.5 msec. It set up Count0 = 25600, Count1 = 20, and Valid = 12800. This results in a detect time start = 1.6msec, detect time end = 2.4msec, and Count1 time of 2msec.
To test, I expected that setting the Count1 time to 1.5msec and 2.5msec would generate an error interrupt; setting it to 1.7msec and 2.3msec would not generate an error interrupt. An error interrupt was not generated at 1.5msec, but was generated at 2.3 msec.
Using the single-shot measurement example in SPNU499 Section 11.2.2 as a guide, I set Valid = 6400 to make the detect time end = 2.0msec, and set Count1 = 100 to guarantee an error interrupt. When Count0 and Valid = 0, Count1 = 16 on the first pass, then 18 on all subsequent passes. This means that either 4 or 2 N2HET2:0 pulses were not counted. I see where one pulse could be missed depending on the PWM output when the DCC counters were loaded. I don't mind adding a dead band to our testing, but I have to be able to justify it.
1) Is this behavior because the two frequencies are so far apart?
2) Is there a delay before starting the Count1 decrement?
3) Are there any guidelines for calculating the offset?
Thanks, Charlie Johnston