![Maxim Integrated MAX32660 Скачать руководство пользователя страница 116](http://html1.mh-extra.com/html/maxim-integrated/max32660/max32660_user-manual_1744484116.webp)
MAX32660 User Guide
Maxim Integrated
Page 116 of 195
The timer period event occurs on the timer clock
. The timer peripheral automatically performs
the following actions when an end of timer period event occurs:
1.
is reset to 0x0000 00001. The timer remains enabled and continues incrementing.
2.
The timer interrupt bit
.irq
will be set. An interrupt is generated if the IRQ is enabled.
10.8.2
Configuration
Configure the timer for Capture mode by doing the following:
1.
Disable the timer by setting
.ten
to 0.
2.
Select Counter mode by setting
.tmode
to 010b.
3.
Set
.pres3
.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
.tpol
to match the desired (inactive) state.
5.
If using the timer interrupt, enable the interrupt and set the interrupt priority.
6.
. This effects only the first period; subsequent periods always begin with
0x0000 0001.
7.
8.
Set
.ten
= 1 to enable the timer.
The timer period is calculated using the following equation:
Equation 10-7: Capture Mode Elapsed Time
𝐶𝑎𝑝𝑡𝑢𝑟𝑒 𝑒𝑙𝑎𝑝𝑠𝑒𝑑 𝑡𝑖𝑚𝑒 𝑖𝑛 𝑠𝑒𝑐𝑜𝑛𝑑𝑠 =
𝑇𝑀𝑅_𝑃𝑊𝑀 − 𝑇𝑀𝑅_𝐶𝑁𝑇
𝐼𝑁𝐼𝑇𝐼𝐴𝐿_𝐶𝑂𝑈𝑁𝑇_𝑉𝐴𝐿𝑈𝐸
𝑓
𝐶𝑁𝑇_𝐶𝐿𝐾
Note: The capture elapsed time calculation is only valid after the capture event occurs, and the timer stores the captured
count in the
Содержание MAX32660
Страница 4: ...MAX32660 User Guide Maxim Integrated Page 4 of 195 8 UART 84 9 Real Time Clock RTC 96 10 Timers 105...
Страница 7: ...MAX32660 User Guide Maxim Integrated Page 7 of 195 15 Trademarks 195 16 Revision History 195...
Страница 14: ...MAX32660 User Guide Maxim Integrated Page 14 of 195 Figure 2 1 MAX32660 High Level Block Diagram...