AT91SAM7X256 – Pulse Width Modulation

Download Report

Transcript AT91SAM7X256 – Pulse Width Modulation

-AT91SAM7X256 –
Pulse Width Modulation
YoonMo Yeon
2007. 3. 22.
Contents
• Speed control of DC motor
• Pulse Width Modulation
• AT91SAM7X256
PWM Controller & example
Speed control of DC motor
• Analogue type control
• Varying the voltage applied to motor
• Simple control circuit
• Heat problem (resister at voltage dropper)
• Low power efficiency at low speed
• Torque also varies
• Torque ∝ I
•V ∝ I
∴ It is not proper to vary the voltage
Pulse Width Modulation
• The average voltage applied to the motor is
varied by switching the supply voltage very
rapidly (ON/OFF)
• Duty Cycle
D

T
AT91SAM7X256 - PWMC
• PWM Controller
• Four channels,
One 16-bit counter per channel
• Common clock generator providing 13
different clocks
• 11 : One modulo-n counter
• 2 : Independent linear dividers working on
modulo n counter output
Set up the PWMC in your Application
PIO & PWM lines
• 4 Multiplexed Channel outputs with
PIOB lines
Set up the PWMC in your Application
Enable the PWM Clock
• Clock of peripherals
• Power Management Controller controls the
clocks of each embedded peripheral
• The peripheral clocks are automatically
disabled after a reset
Set up the PWMC in your Application
Set up the Clock Generator
• Per each channel
• Channel Mode Register
• Duty Cycle Register
• Period Register
• Counter Register
• Update Register
CMR = 10 -> CPRE = MCK/1024
CPOL = 0 : start at low level
CALG = 0 : left aligned
CPRDR = 1024 -> CPRE / 1024
-> MCK / 1024 / 1024 ≒ 48Hz
CDTYR = 256 -> Duty Cycle = CDTYR / CPRDR
-> D = 256 / 1024 = 1/4
Set up the PWMC in your Application
Channel Enabling
Modify a channel period/duty cycle
• In running mode, modifying the duty
cycle or the period value can be done
only via PWM_CUPD
End of presentation