Martin Diaz

S08 Input Capture Problem

Discussion created by Martin Diaz on Mar 1, 2016

Hi all. I am using the TPM2 module, set to input capture mode, of a MCU MC9S08JM60 in order to measure the frequency of a rectangular signal. The problem is that I can not get a value by executing the following instructions:


TPM2C1DL = TPM2C1VL; TPM2C1DH = TPM2C1VH; TPM2C1DH = TPM2C1DH * 256; TPM2C1D = TPM2C1DL + TPM2C1DH; TPM2C1D = (TPM2C1D * 12) /100000 TPM2C1D  = 1/TPM2C1D 

(All variables are of the type " unsigned short ")


The module uses the BUSCLK as reference clock, which previously set in the Bypassed Internal Low Power mode, which understand that the BUSCLK is 32kHz / 2/2 = 8 kHz. What could be happening?.