What accuracy can we expect for DigitalSignal.Capture on SC13048? I’m seeing values ranging by up to 800ns between falling edges from a known signal. The known signal is being sent by a frequency generator and confirmed by scope. It seems like the captured values are always at least 150ns too long.
On 20260D I’m seeing values being ~30ns larger than expected, but very stable.
Any config that could be wrong to cause that or tips to improve?
Thanks for looking into this. Results from your code are consistent with mine. When doing a capture on a 2500Hz (400us) signal with 1000 samples using SC13 I get the following results (ignoring the first value):
Average = 400237
Median = 400238
Max = 400550
Min = 400088
Any chance of increasing that clock rate for the capture (maybe even as a special mode on the CPU)? This is an awesome feature but the current rate leads to errors of up to 3-4Hz at the frequencies we need to measure.
This mode use DMA, everything is done by hardware.
Let me read more on document to see anything we can improve, but so far I don’t think we can. We give DMA a buffer and bring this buffer to user when DMA done.
On SC20 it is more accurate you mean? Is the source generate clock correctly? :)).
In your example is the source / capture on the same SC13? I setup a 2.5kHz PWM on PA2 on SC13. I’m seeing a similar issue with accuracy on the scope and protocol analyzer. The output frequency is 3-5Hz off. If you were going from SC13 to SC13 maybe the PWM / Capture accuracy cancels out and that’s why you got such perfect results?
To me it seems like the PWM and Capture use a similar accuracy timer behind the scenes. Can the frequency of that timer be cranked up in the hardware config?
Just closing this one off… The issue was that we were testing on FEZ Flea so I’m assuming this was just a lack of xtal. It works great in production with a good xtal and on the SC13048Q dev board. Sorry for the false lead!