AP513 ACROPACK
USER
’S MANUAL
Acromag, Inc. Tel: 248-295-0310
- 22 -
http://www.acromag.com
- 22 -
www.acromag.com
TIMERCNTL[3:0] These bits are used to invoke a series of commands
that control the function of the Timer/Counter. The
commands 1100 to 1111 are reserved.
0001: Enable Timer Interrupt
0010: Disable Timer Interrupt
0011: Select One-shot mode
0100: Select Re-triggerable mode
0101: 125MHz clock as clock input for Timer
0110: not supported
0111: not supported
1000: De-route Timer output from MPIO[0]
1001: Start Timer
1010: Stop Timer
1011: Reset Timer
3.2.2.3 Timer Operation
The following paragraphs describe the operation of the 16-bit
Timer/Counter. The following conventions will be used in this discussion:
•
’
N
’
is the 16-bit value programmed in the TIMER MSB, LSB registers
•
P +Q = N, where ’P’ and ’Q’ are approximately half of ’N’.
•
If N is even, P = Q = N/2.
•
If N is odd, P = (N
–
1)/2 and Q = (N + 1)/2.
•
‘
N
’
can take any value from 0x0002 to 0xFFFF
Timer Operation in One-Shot Mode:
In the one-shot mode, the Timer output will stay HIGH when started (default
state) and will continue to stay HIGH until it times out (reaches the terminal
count of ‘N’ clocks), at which time it will become LOW and stay LOW. If the
Timer is re-started before the Timer times out, the counter is reset and the
Timer will wait for another time-out period before setting its output LOW. If
the Timer times out, re-starting the Timer does not have any effect and a
’Stop Timer’ command needs to be issued first which will set the Timer
output to its default HIGH state. The Timer must be programmed while it is
stopped since the following operations are blocked after the Timer has been
started:
•
Any write to TIMER MSB, LSB registers
•
Issue of any command other than
’
Start Timer
’
,
’
Stop Timer
’
and
’
Reset Timer
’
Timer Operation in Re-triggerable Mode:
In the re-triggerable mode, when the Timer is started, the Timer output will
stay HIGH until it reaches half of the terminal count N (= P clocks) and toggle
LOW and stay LOW for a similar amount of time (Q clocks). The above step
will keep repeating until the Timer is stopped at which time the output will
become HIGH (default state). Also, after the Timer is started, re-starting the
Timer does not have any effect in re-triggerable mode. The Timer must be
programmed while it is stopped since the following operations are blocked
when the Timer is running: