Hello,
The OP is using the earlier HC908 devices, rather than HCS08. So the timer module is a TIM, rather than a TPM. Consequently, the posted code will require some modification to use the HC908. The TIM register names will differ, and the bit usage within the registers is also likely to differ.
Measuring pulse width using input capture will be relatively simple provided the width never exceeds the TIM overflow period. If it is possible for the pulse width to exceed the overflow period, the code will be substantially more complex. Therefore, what range of pulse widths are required to be measured, and what is the expected resolution for the measurement.
Regards,
Mac
Message Edited by bigmac on
2009-02-06 09:51 AM