Timer
Introduction:
The basic scalable timer consists of a 16-bit, software-programmable counter driven by a flexible
programmable prescaler.
This timer can be used for many purposes, including input waveform measurements while simultaneously
generating an output waveform. Pulse widths can vary from microseconds to many seconds.
This timer could contain up to 8 input capture/output compare channels with one pulse accumulator
available only on channel 7. The input capture function is used to detect a selected transition edge and
record the time. The output compare function is used for generating output signals or for timer software
delays. The 16-bit pulse accumulator is used to operate as a simple event counter or a gated time
accumulator. The pulse accumulator shares timer channel 7 when the channel is available and when in
event mode.
A full access for the counter registers or the input capture/output compare registers should take place in
one clock cycle. Accessing high byte and low byte separately for all of these registers may not yield the
same result as accessing them in one word.
Features:
- Up to 8 channels available. (refer to device specification for exact
number). - All channels have same input capture/output compare functionality.
- Clock prescaling.
- 16-bit counter.
- 16-bit pulse accumulator on channel 7.
Block Diagrams:
Register Descriptions:
TIOS:
输入捕获/输出比较选择:
- IOSx=0, 输入捕获;
- IOSx=1, 输出比较;
- 寄存器TIOS, TIOS_IOS[0-7];