Hello,
we would like to measure on the same NHET pin (N2HET2[16]) via 2 PCNT instruction the high time and period.
The high time should be measured with high resolution, the period with low resolution granularity.
We are using a TMS570LS3137ZWT with:
VCLK2 = 90MHz
hr = 45, lr = 4
-> HRP = 500ns
-> LRP = 2us
; Duty Cycle capturing
L00: PCNT { next = L01, type = RISE2FALL, pin = 16, hr_lr = HIGH }
; Period capturing
L01: PCNT { next = END, type = FALL2FALL, pin = 16, hr_lr = LOW }
We figured out that the measurements toggle by a few LSBs and the accuracy is bad.
When our program consists only of 1 PCNT instruction, the measurement is fine and toggles only by 1 LSB. (when we measure with high resolution by 500ns, when we measure with low resoltion by 2us).
The problem only appears when 2 measurements are taken on the same pin and one is measured with high resolution and the other one with low resolution.
Also the high resolution part toggels more than 2us.
Any ideas why this happens?
According to the TRM, the HR counter is assigned to the first NHET instruction of this pin.
What happens when 1 instruction measures with low resolution, another one with high resolution?
Our input signal is feed to the NHET pin is 100% stable and does not jitter.
Is is independant if the input signal is 200Hz or 10kHz, the problem is always the same. Duty cycle of the signal is always fixed at 50%.