English
Language : 

LM3S618 Datasheet, PDF (324/396 Pages) List of Unclassifed Manufacturers – Microcontroller
Pulse Width Modulator (PWM)
15.4
5. 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.
– Write the PWM0LOAD register with a value of 0x0000018F.
6. Set the pulse width of the PWM0 pin for a 25% duty cycle.
– Write the PWM0CMPA register with a value of 0x0000012B.
7. Set the pulse width of the PWM1 pin for a 75% duty cycle.
– Write the PWM0CMPB register with a value of 0x00000063.
8. Start the timers in PWM generator 0.
– Write the PWM0CTL register with a value of 0x00000001.
9. Enable PWM outputs.
– Write the PWMENABLE register with a value of 0x00000003.
Register Map
Table 15-2 lists the PWM registers. The offset listed is a hexadecimal increment to the register’s
address, relative to the PWM base address of 0x40028000.
Table 15-1. PWM Register Map (Sheet 1 of 2)
Offset Name
Reset
Type Description
See
page
PWM Module Control
0x000 PWMCTL
0x00000000 R/W Master control of the PWM module
326
0x004 PWMSYNC
0x00000000 R/W Counter synchronization for the PWM generators
327
0x008 PWMENABLE
0x00000000 R/W Master enable for the PWM output pins
328
0x00C PWMINVERT
0x00000000 R/W Inversion control for the PWM output pins
329
0x010 PWMFAULT
0x00000000 R/W Fault handling for the PWM output pins
330
0x014 PWMINTEN
0x00000000 R/W Interrupt enable
331
0x018 PWMRIS
0x00000000 RO Raw interrupt status
332
0x01C PWMISC
0x00000000 R/W1C Interrupt status and clear
333
0x020 PWMSTATUS
0x00000000 RO Value of the Fault input signal
334
PWM Generator 0
0x040 PWM0CTL
0x00000000 R/W Master control of the PWM0 generator block
335
0x044 PWM0INTEN
0x00000000 R/W Interrupt enable
336
0x048 PWM0RIS
0x00000000 RO Raw interrupt status
337
0x04C PWM0ISC
0x00000000 R/W1C Interrupt status and clear
338
0x050 PWM0LOAD
0x00000000 R/W Load value for the counter
339
324
May 4, 2007
Preliminary