
MAX32600 User’s Guide
System Clock, Timers/Counters, Watchdog Timers and Real Time Clock
10.4 Timers/Counters
• Set the prescale value,
2. If using the Timer Output function, set the initial output level (High or Low) via
field
3. Write to the Timer Count register to set the starting count value
• This only affects the first pass in Continuous Mode
• After the first Timer Compare in Continuous Mode, counting always begins at the reset value of 0x0000_0001
4. Write the Compare Count value,
5. If desired, enable the timer interrupt,
6. If using the Timer Output function, configure the associated GPIO port pin for the Timer Output function
The timer period is given by the following equation:
Continuous Timeout Period
(
s
) =
Reload
SystemClockFrequency
(
Hz
)
×
Prescale
Note
If an initial starting value other than 0x0000_0001 is loaded into the Timer register, the
equation must be used to determine the first
time-out period.
10.4.2.3
Counter Mode
In Counter Mode, the timer counts input transitions from a GPIO port pin. The timer input is taken from the GPIO port pin Timer Input function. The
bit in the Timer Control register selects whether the count occurs on the rising edge (polarity = “0”) or the falling edge (polarity = “1”) of the Timer Input
signal.
In Counter Mode, the prescaler is disabled. Any value assigned to
in Counter Mode will have no effect.
The input frequency of the Timer Input
signal must not exceed one-fourth the currently selected System Clock frequency.
Upon reaching the Compare value stored in the Timer Terminal Count register, the
timer generates an interrupt, the count value in the Timer register is reset to 0x0000_0001 and counting resumes. Also, if the Timer Output function is enabled in the
GPIO, the Timer Output pin changes state from Low to High or from High to Low at Timer Compare. The steps for configuring a timer for Counter Mode and initiating
the count are as follows:
1. Write the following in the
register:
• Disable the timer,
= “0”
• Select 32-bit timer mode,
= "0"
• Configure the timer for Counter Mode,
= “010”
Rev.1.3 April 2015
Maxim Integrated
Page 590
Содержание MAX32600
Страница 1: ...MAX32600 User s Guide April 2015...