LM3S8971 Luminary Micro, Inc, LM3S8971 Datasheet - Page 481

no-image

LM3S8971

Manufacturer Part Number
LM3S8971
Description
Lm3s8971 Arm Microcontroller
Manufacturer
Luminary Micro, Inc
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
LM3S8971-EQC50-A2
Manufacturer:
Texas Instruments
Quantity:
10 000
Part Number:
LM3S8971-EQC50-A2T
Manufacturer:
Texas Instruments
Quantity:
10 000
Part Number:
LM3S8971-IBZ50-A2
Manufacturer:
Texas Instruments
Quantity:
10 000
Part Number:
LM3S8971-IBZ50-A2
Manufacturer:
TI/德州仪器
Quantity:
20 000
Part Number:
LM3S8971-IBZ50-A2T
Manufacturer:
Texas Instruments
Quantity:
10 000
Part Number:
LM3S8971-IQC50-A2
Manufacturer:
TI
Quantity:
141
Part Number:
LM3S8971-IQC50-A2
Manufacturer:
Texas Instruments
Quantity:
10 000
18.3
July 26, 2008
modifying the individual PWM generators, which are modified by the feedback control loop). Similarly,
fault control can disable any of the PWM signals as well. A final inversion can be applied to any of
the PWM signals, making them active Low instead of the default active High.
Initialization and Configuration
The following example shows how to initialize the PWM Generator 0 with a 25-KHz frequency, and
with a 25% duty cycle on the PWM0 pin and a 75% duty cycle on the PWM1 pin. This example assumes
the system clock is 20 MHz.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
Enable the PWM clock by writing a value of 0x0010.0000 to the RCGC0 register in the System
Control module.
Enable the clock to the appropriate GPIO module via the RCGC2 register in the System Control
module.
In the GPIO module, enable the appropriate pins for their alternate function using the
GPIOAFSEL register.
Configure the Run-Mode Clock Configuration (RCC) register in the System Control module
to use the PWM divide (USEPWMDIV) and set the divider (PWMDIV) to divide by 2 (000).
Configure the PWM generator for countdown mode with immediate updates to the parameters.
Set the period. For a 25-KHz frequency, the period = 1/25,000, or 40 microseconds. The PWM
clock source is 10 MHz; the system clock divided by 2. This translates to 400 clock ticks per
period. Use this value to set the PWM0LOAD register. In Count-Down mode, set the Load field
in the PWM0LOAD register to the requested period minus one.
Set the pulse width of the PWM0 pin for a 25% duty cycle.
Set the pulse width of the PWM1 pin for a 75% duty cycle.
Start the timers in PWM generator 0.
Enable PWM outputs.
Write the PWM0CTL register with a value of 0x0000.0000.
Write the PWM0GENA register with a value of 0x0000.008C.
Write the PWM0GENB register with a value of 0x0000.080C.
Write the PWM0LOAD register with a value of 0x0000.018F.
Write the PWM0CMPA register with a value of 0x0000.012B.
Write the PWM0CMPB register with a value of 0x0000.0063.
Write the PWM0CTL register with a value of 0x0000.0001.
Write the PWMENABLE register with a value of 0x0000.0003.
Preliminary
LM3S8971 Microcontroller
481

Related parts for LM3S8971