First page Back Continue Last page Overview Graphics
“ a 16-bit binary stop watch” --P&B
- TIOS (located at 0x0080)
- There are 8 capture channels.
- Designator bits 0 through 7 indicate whether channel is for input capture or output compare.
- 0 = input, 1 = output
- TC0 through TC7 (0x0090 through 0x009F)
- Two byte registers to hold count when event occurred.
- High byte of count has lower address.
The HC12 has 8 capture channels. To specify whether a channel is to be used for input caputer or output compare, a mask is written to the Timer Input Capture / Output Compare Select Register (TIOS).
Associated with each channel is a register into which the counter value is written when an event occurs. Because the counter is a 16 bits wide, these registers must also contain 16 bits. For example, TC0, the register corresponding to channel zero, stores counter bits 15 through 8 of the counter in bits 7 through 0, respectively, at location 0x0090 and counter bits 7 through 0 in bits 7 through 0, respectively, at location 0x0091.