MAX32600 User’s Guide
System Clock, Timers/Counters, Watchdog Timers and Real Time Clock
10.4 Timers/Counters
disabled and stops counting. Also, if the Timer Output function is enabled in the GPIO, the Timer output pin will change state for one clock cycle and then return to
the polarity value (the
bit in the Timer Control register).
The steps for configuring a 32-bit timer for One-Shot 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 One-Shot Mode,
= “000”
• Set the prescale value,
2. If using the Timer Output function, set the initial output level (High or Low) via
field
3. Write the starting count value,
4. Write the Compare/Terminal 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
7. Enable timer and start counting,
= "1"
In One-Shot mode, the Scaled System Clock always provides the timer input. The timer period is given by the following equation:
One Shot Timeout Period
(
s
) =
(
Reload
−
StartValue
)
SystemClockFrequency
(
Hz
)
×
Prescale
10.4.2.2
Continuous Mode
In Continuous Mode, the timer counts up to the 32-bit Compare value stored in the Timer Compare register,
. The timer input is the Scaled
System Clock. Upon reaching the Compare value, the timer generates an interrupt, the count value in the Timer register is reset to 0x0000_0001, and counting
resumes. Additionally, 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 upon reaching
Timer Compare value. The steps for configuring a timer for Continuous 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 Continuous Mode,
= “001”
Rev.1.3 April 2015
Maxim Integrated
Page 589