Ross Myers

MCF51JM Input Capture values

Discussion created by Ross Myers on Jun 5, 2009
Latest reply on Jun 8, 2009 by Ross Myers

Hi All,

 

I have a MCF51JM running off an 8MHz XTAL.

I want to use one of the timers to monitor pulse data coming in and measure the input capture toggle times.

What is the best method for calculating out how I need to set up the Timer Registers (Prescalers etc) to be able to measure bit times between 16uS and 300uS?.

I assume the best method is once I get an Int from the Timer I will read the TPM-Counter Registers (TPMxCNTH:TPMxCNTL) to get the value and compare it to 'x' to determine the time.

 

I'm just not sure how to calculate out for a given clock frequency and prescaler value what 100 or 400 (as examples) in the (TPMxCNTH:TPMxCNTL) registers corresponds to as a uS time.

 

Thanks,
Ross

Outcomes