AN2475 Freescale Semiconductor / Motorola, AN2475 Datasheet - Page 3

no-image

AN2475

Manufacturer Part Number
AN2475
Description
Generating a PWM Signal Modulated by an Analog Input Using the MC68HC908QY4 Microcontroller
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Timer Interface Module (TIM)
Pulse-Width
Modulation (PWM)
MOTOROLA
data has been read or not. Conversions will continue until the ADCO bit is
cleared. The COCO bit (ADSCR, $003C) is set after each conversion and can
be cleared by writing the ADSCR or reading of the ADR.
In the single conversion mode, once the conversion is completed the ADC puts
the converted result in the ADR, sets a flag, and can generate an interrupt.
Please refer to the MC68HC908QY4, MC68HC908QT4, MC68HC908QY2,
MC68HC908QT2, MC68HC908QY1, and MC68HC908QT1 Data Sheet
(Motorola document order number MC68HC908QY4/D) for ADC features and
electrical specification details.
The timer interface module (TIM) is a 2-channel timer that provides a timing
reference with input capture, output compare, and PWM functions. Software
can read the TIM counter value at any time without affecting the counting
sequence. The two TIM channels are programmable independently as either
input capture or output compare.
Features of the TIM include:
By using the toggle-on-overflow feature with an output compare channel, the
TIM module can generate a PWM signal. The composed value stored in the
TIM counter modulo registers determines the period of the PWM signal. The
channel pin toggles when the counter reaches that composed value. The time
between overflows is the period of the PWM signal.
The composed value of the TIM counter modulo registers and the selected
prescaler output determine the frequency of the PWM output. The frequency of
an 8-bit PWM signal is variable in 256 increments. Writing $00FF (255) to the
TIM counter modulo registers produces a PWM period equal to 256 times the
internal bus clock period if the prescaler select value is set to 000. Writing
$0080 (128) to the TIM channel registers produces a duty cycle of 128/256
or 50%.
Generating a PWM Signal Modulated by an Analog Input
Freescale Semiconductor, Inc.
For More Information On This Product,
Using the MC68HC908QY4 Microcontroller
Two input capture/output compare channels:
Buffered and unbuffered PWM signal generation
Programmable TIM clock input with 7-frequency internal bus clock
prescaler selection
Free-running or modulo up-count operation
Toggle any channel pin on overflow
TIM counter stop and reset bits
Rising-edge, falling-edge, or any-edge input capture trigger
Set, clear, or toggle output compare action
Go to: www.freescale.com
Timer Interface Module (TIM)
AN2475/D
3

Related parts for AN2475