Clock signal detector on KE02Z

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Clock signal detector on KE02Z

467 Views
CitRam
Contributor III

Hi All!

I try to make the clock signal detector on KE02Z. External clock signal is connected to KE02Z. I have not decided exactly what use for this, SPI or FTM and or something else.

Seemingly simple task . If there is external clock signal, on some KE02Z pin must be = 0. If no external clock signal, must be  = 1. But problem is, Clock signla may be from 50kHz to 4MHz, and clock word may be from 1 clock period to 18. Timeout between clock word from 15us to 50us. Clock signal idle state is 1.


While I think may be possible to do it with SPI Slave. SPI Slave has receiver full flag (SPRF). If read SPRF flag , can to determine, there is external clock or no. But what next? If SPI slave will get 4 clock periods? SPRF will in expectation for next 4 period (if it wait for 8 bit)

Maybe someone has already done something similar or have any ideas how to do it.

Best regards

Tags (3)
0 Kudos
1 Reply

284 Views
adriancano
NXP Employee
NXP Employee

Hi,

I think that the best idea is to use the FTM module in its Input Capture configuration, please refer to the FTM module in the Reference Manual Reference manual in the section Input Capture Mode. The input capture module has the task of capturing the current value of the timer counter upon an input event. This module is mainly used for the frequency or time period measurements and pulse measurements.

When using Input Capture mode remember that the maximum frequency for the channel input signal to be detected correctly is system clock divided by 4, which is required to meet Nyquist criteria for signal sampling.

You may find useful this thread:

Re: How can I measure frequency (0 - 100KHz) of a signal using a K10 microcontroller?

I hope this information can help you.

Regards,

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. It would be nice!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos