![Maxim Integrated MAX32660 Скачать руководство пользователя страница 113](http://html1.mh-extra.com/html/maxim-integrated/max32660/max32660_user-manual_1744484113.webp)
MAX32660 User Guide
Maxim Integrated
Page 113 of 195
10.7
PWM Mode (011b)
In PWM mode, the timer sends a Pulse-Width Modulated (PWM) output
using th tim r’s utput signal
. The timer first
counts up to the match value stored in the
register. At the end of the cycle where the
value, the timer
’s
output toggles state. The timer continues counting until it reaches the
10.7.1
Timer Period
The timer period ends on the rising edge of PCLK following
The timer peripheral automatically performs the following actions at the end of the timer period:
1.
is reset to 0x0000 0001, and the timer resumes counting.
2.
The timer output signal is toggled.
3.
The timer interrupt bit
.irq
will be set. An interrupt will be generated if enabled.
.tpol
= 0, the timer output signal starts low and then transitions to high when the
value. The timer output signal remains high until the
value reaches the
value, resulting in the timer output signal transitioning low, and the
value resetting to 0x0000 0001.
.tpol
= 1, the Timer output signal starts high and transitions low when the
value. The timer output signal remains low until the
value, resulting
in the timer output signal transitioning high, and the
value resetting to 0x0000 0001.
10.7.2
PWM Mode Configuration
Complete the following steps to configure a timer for PWM mode and initiate the PWM operation:
1.
Set
.ten
= 0 to disable the timer.
2.
Set
.tmode
to 011b to select PWM mode.
3.
Set
.pres3
.pres
to set the prescaler that determines the timer frequency.
4.
Configure the timer pin:
5.
Configure the pin as a timer input and configure the electrical characteristics as needed.
6.
Set
.tpol
to match the desired initial (inactive) state.
a.
Set
.tpol
to select the initial logic level (high or low) and PWM transition state for the timer
’s
output.
b.
Set
to the starting count, typically 0x0000 0001. The initial
value only effects the initial
period in PWM mode with subsequent periods always setting
c.
Set the
value to the transition period count.
7.
Set the
value for the PWM second transition period. Note:
must be greater than the
value.
8.
Optionally enable the timer
’s
interrupt in the Interrupt Controller and set the timer
’s
interrupt priority.
9.
Set
.ten
to 1 to enable the timer and start the PWM.
The PWM period is calculated using the following equation:
Equation 10-6: Timer PWM Period
𝑃𝑊𝑀 𝑝𝑒𝑟𝑖𝑜𝑑 𝑖𝑛 𝑠𝑒𝑐𝑜𝑛𝑑𝑠 =
𝑇𝑀𝑅_𝐶𝑀𝑃
𝑓
𝐶𝑁𝑇_𝐶𝐿𝐾
(𝐻𝑧)
If an initial starting value other than 0x0000 0001 is loaded into the
register, use the One-Shot mode equation
to determine the initial PWM period.
Содержание 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...