EasyManuals Logo

Maxim Integrated MAX32665 User Manual

Maxim Integrated MAX32665
457 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #339 background imageLoading...
Page #339 background image
MAX32665-MAX32668 User Guide
Maxim Integrated Page 339 of 457
16.8.1 Capture Mode Timer Period
Two timer period events are possible in Capture Mode:
The Capture event occurs on the timer clock following the selected transition on the timer pin. The timer peripheral
automatically performs the following actions:
1. The value in TMRn_CNT is copied to TMRn_PWM
2. The timer interrupt bit TMRn_INT.irq will be set. An interrupt will be generated if enabled.
3. The timer remains enabled and continues incrementing.
4. The timer period ends on the timer clock following TMRn_CNT = TMRn_CMP.
The timer period event occurs on the timer clock TMRn_CNT = TMRn_CMP. The timer peripheral automatically performs
the following actions when an end of timer period event occurs:
1. The value in TMRn_CNT is reset to 0x0000 00001. The timer remains enabled and continues incrementing.
2. The timer interrupt bit TMRn_INT.irq will be set. An interrupt will generated if enabled.
16.8.2 Capture Mode Configuration
Configure the timer for Capture mode by doing the following:
1. Disable the timer by setting TMRn_CN.ten to 0.
2. Select Counter mode by setting TMRn_CN.tmode to 010b.
3. Set TMRn_CN.pres3:TMRn_CN.pres to set the prescaler that determines the timer frequency.
4. If using the timer pin:
a. Configure the pin as a timer output and configure the electrical characteristics as needed.
b. Set TMRn_CN.tpol to match the desired (inactive) state.
5. If using the timer interrupt, enable the interrupt and set the interrupt priority.
6. Write the initial value to TMRn_CNT. This effects only the first period; subsequent periods always begin with
0x0000 0001.
7. Write the compare value to TMRn_CMP.
8. Set TMRn_CN.ten = 1 to enable the timer.
The timer period is calculated using the following equation:
Equation 16-9: Capture Mode Elapsed Time Calculation in Seconds

 


Note: The capture elapsed time calculation is only valid after the capture event occurs, and the timer stores the captured
count in the TMRn_PWM register.
16.9 Compare Mode (101b)
In Compare mode the timer peripheral increments continually, allowing the timer to be a programmable 32-bit
programmable period timer. The end of timer period event occurs when the timer value matches the compare value, but
the timer continues to increment until the count reaches 0xFFFF FFFF. The timer counter then rolls over and continues
counting from 0x0000 0000.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Maxim Integrated MAX32665 and is the answer not in the manual?

Maxim Integrated MAX32665 Specifications

General IconGeneral
BrandMaxim Integrated
ModelMAX32665
CategoryMotherboard
LanguageEnglish