Download Lecture 10: PI/T timer

Transcript
PI/T timer registers
g
Timer Control Register
n
g
Timer Interrupt Vector Register
n
g
A 24-bit counter with the desired (by the
programmer) number of counts measured in ticks
Counter Register
n
g
Stores the interrupt vector number
Counter Preload Register
n
g
Determines the operation modes of the timer
A 24-bit counter down-counter that is
automatically decremented with every tick
Timer Status Register
n
n
n
Determines the status of the timer
Only Bit #0 (Zero Detect Status or ZDS) is used
In order to clear the ZDS bit after a zero-detect
YOU MUST WRITE A 1 to it (YES, the ZDS bit is
cleared by writing a ONE to it)
Register and Mnemonic
Timer Control Register
TCR
Acc.
R/W
Offset
$21
Timer Interrupt Vector Register
Counter Preload Register High
Counter Preload Register Middle
Counter Preload Register Low
Counter Register High
Counter Register Middle
Counter Register Low
Timer Status Register
R/W
R/W
R/W
R/W
R
R
R
R/W
$23
$27
$29
$31
$2F
$31
$33
$35
TIVR
CPRH
CPRM
CPRL
CNTRH
CNTRM
CNTRL
TSR
Microprocessor-based System Design
Ricardo Gutierrez-Osuna
Wright State University
4