LM3S1133 Luminary Micro, Inc, LM3S1133 Datasheet - Page 429

no-image

LM3S1133

Manufacturer Part Number
LM3S1133
Description
Lm3s1133 Arm Microcontroller
Manufacturer
Luminary Micro, Inc
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
LM3S1133-EQC50-A2
Manufacturer:
Texas Instruments
Quantity:
10 000
Part Number:
LM3S1133-EQC50-A2T
Manufacturer:
Texas Instruments
Quantity:
10 000
Part Number:
LM3S1133-IBZ50-A2
Manufacturer:
Texas Instruments
Quantity:
135
Part Number:
LM3S1133-IBZ50-A2
Manufacturer:
Freescale
Quantity:
41
Part Number:
LM3S1133-IBZ50-A2
Manufacturer:
Texas Instruments
Quantity:
10 000
Part Number:
LM3S1133-IBZ50-A2T
Manufacturer:
Texas Instruments
Quantity:
10 000
Part Number:
LM3S1133-IQC50-A2
Manufacturer:
Texas Instruments
Quantity:
135
Part Number:
LM3S1133-IQC50-A2
Manufacturer:
Texas Instruments
Quantity:
10 000
17.3
17.4
July 26, 2008
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.
Register Map
Table 17-1 on page 430 lists the PWM registers. The offset listed is a hexadecimal increment to the
register’s address, relative to the PWM base address of 0x4002.8000.
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
LM3S1133 Microcontroller
429

Related parts for LM3S1133