This is a sample program for measuring the pulse width of a 16-bit timer.
The document provides a sample program for the TLCS-900/H microcontroller series that measures the high‑level width of an external pulse. It explains how to configure the 16‑bit timer in event‑counter mode, capture timer values on the TI8 pin, and calculate pulse width.
The program uses capture registers CAP1 and CAP2, the INTS5 interrupt handler, and an internal clock period of 0.8 µs. It includes example data variables and interrupt timing details for developers integrating the routine into their designs.
| Timer type | 16‑bit timer in event counter mode |
|---|---|
| Capture registers | CAP1, CAP2 |
| Interrupt used | INTS5 |
| Edge detection pin | TI8 |
| Cycle time example | 16 µs |
It measures the high‑level width of an external pulse using a 16‑bit timer.
The program is created for the TLCS‑900H series of microcontrollers.
The program captures timer values at rising and falling edges, computes the difference between CAP1 and CAP2, and multiplies it by the internal clock period.
The TI8 pin is used to trigger capture on rising and falling edges of the external pulse.