9s08qd 125khz Carrier Detection

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

9s08qd 125khz Carrier Detection

跳至解决方案
1,221 次查看
ksirob
Contributor I

AN3552 example for pulse width measurement doesn't work beyond few kHz, target enters in wait stop mode !!!!!

(i've modify this note for "rising edge only detection" in order to calculate periode)

 

I hope that AD compare function on QD4 will work better with shorter AD convertion time.... is there any example about ?

Any solution or help should be welcomed.

标签 (1)
0 项奖励
回复
1 解答
575 次查看
bigmac
Specialist III

Hello,

 

Further to my previous post, I notice that the 9S08QD4 does not contain an analogue comparator.  If this is required to "square up" the waveform applied to the TPM module, it would need to be an external component.  Additionally, the device makes no provision for an external clock for accurate measurement.

 

On the subject of the period measurement, I think that the feasibility is quite borderline of being able to measure the period of frequencies as high as 125 kHz.  Anyway, as there are only 64 bus cycles within the period, the resolution of the measurement will be extremely limited.

 

The direct measurement of frequency would potentially provide much more resolution, depending on the gate interval used.  However, frequency measurement would occupy two TPM modules, one to count the incoming cycles (via external TPM input) and the other for the gate timing.

 

Regards,

Mac

 

在原帖中查看解决方案

0 项奖励
回复
2 回复数
575 次查看
bigmac
Specialist III

Hello,

 

If you are referring to the conversion time of the ADC module, this has nothing to do with the use of tha analogue comparator, the output of which I would assume would be externally connected to a channel input pin of the TPM module.

 

The likely reason that you would not be able to measue the period of an external signal, wnen its frequency exceeded  "a few kilohertz", is that the period would become less than the ISR processing time for each input capture event.  Do you have maximum allowable bus frequency?  Are you performing unnecessary operations within the ISR code?  To improve the performance the ISR code should be minimal.  Perhaps you should consider inline assembly code.

 

To measure 125kHz, a period of 8 microseconds, and assuming a bus clock of 8 MHz, and allowing for the interrupt call, the execution of the ISR code should not exceed 30-40 cycles.

 

Regards,

Mac

 

0 项奖励
回复
576 次查看
bigmac
Specialist III

Hello,

 

Further to my previous post, I notice that the 9S08QD4 does not contain an analogue comparator.  If this is required to "square up" the waveform applied to the TPM module, it would need to be an external component.  Additionally, the device makes no provision for an external clock for accurate measurement.

 

On the subject of the period measurement, I think that the feasibility is quite borderline of being able to measure the period of frequencies as high as 125 kHz.  Anyway, as there are only 64 bus cycles within the period, the resolution of the measurement will be extremely limited.

 

The direct measurement of frequency would potentially provide much more resolution, depending on the gate interval used.  However, frequency measurement would occupy two TPM modules, one to count the incoming cycles (via external TPM input) and the other for the gate timing.

 

Regards,

Mac

 

0 项奖励
回复