cancel
Showing results for 
Search instead for 
Did you mean: 

SPC564B74 input frequency measurements errors

MH_Electronics
Associate

Hi,

I am using the SPC564B74 to measure the frequency of a square wave signal. The problem is that I have a some artifact measurements that cause problems on my application. A few times per minute, the measured frequency randomly drops to zero or an intermediate value and I don't understand the root cause. I made measurements and it is software related.

 

I am using the eMIOS module in MCB mode. The signal is the output of a variable reluctance sensor measuring a motor RPM, ranging from  4 Hz to 8000 Hz.

The SPC564 is clocked with a 40 MHz cristal.

 

(FXOSC 40MHz → PLL 120MHz → Peripheral Set 3 Prescaler = 2 → Peripheral Set 3 = 60 MHz (ADC0, ADC1, eMIOS0, eMIOS1)

eMIOS0 prescaler = 15 → eMIOS0 CLK = 4MHz

 

For good precision in low and high frequencies, I am measuring 16 periods (32 edges) of the input signal.

 

The measured signal is mapped to PA[1] and I am using eMIOS0 channel 1 as MCB_UP. It is linked to DMA_MUX channel 18, linked to eDMA channel 28 that triggers an ISR on INTC.

 

To detect the absence of an input signal and force frequency measurement to 0, I am using a reference counter (eMIOS0 channel that triggers an ISR on the INTC as time base, which runs at 4MHz and is 16 bits wide. This counter is incremented every 10ms. If it exceeds a threshold value, the calculated frequency is forced to 0. The artifacts are not related to this method.

 

I noticed that the number of artifacts is related to the input frequency (the higher the frequency, the higher the number of artifacts).

 

            -Is my frequency measurement method correct or is another eMIOS mode better?

            -What could be the cause of artifacts? (DMA errors?)

            -Has anyone experienced the same behaviour?

 

I would like support from ST and can provide the source code if necessary.

Thank you in advance.

0 REPLIES 0