下載/瀏覽

Download Report

Transcript 下載/瀏覽

Presentation:
ADC – Analog to Digital Converter
and PWM Waveform Generation
with EZDSP2812
Professor: Chen, Pei-Chung
陳沛仲
Student: Thanh-Nhan Nguyen
阮誠仁
2008, December, 11th
1
1. ADC module introduction
2. PWM waveform generation
3. An example
2
ADC – Analog to Digital Converter
EZDSP 2812 ADC module consists of a 12-bit ADC.
Functions of the ADC module include:
• 12-bit ADC core with built-in S/H
• Analog input: 0.0 V to 3.0 V (Voltages above 3.0 V produce full-scale conversion result5s.)
• Fast conversion rate: 80 ns at 25-MHz ADC clock, 12.5 MSPS
• 16-channel, MUXed inputs
• Sixteen result registers (individually addressable) to store conversion values
− The digital value of the input analog voltage is derived by:
Digital Value = 0
Digital Value = 4096 * ((Input Analog Voltage- ADCLO)/3)
Digital Value = 4095
When input <= 0V
When 0V < input <3V
When input >=3V
ADC voltage resolution is: (0V - 3V) / 4096 codes
= 3V / 4096 codes ~ 0.000732 volts/code
~ 0.732 mV/code
3
Fig 1. ADC pin connections with internal reference
4
Initialize System Control
Initialize GPIO
Clear all interrupts and initialize PIE vector table
Initialize all the Device Peripherals
Specific code for A/D conversion
Fig 2. The procedure to use ADC – Analog to Digital Converter
5
Characteristics of the PWMs are as follows:
• 16-bit registers
• Wide range of programmable deadband for the PWM output pairs
• Change of the PWM carrier frequency for PWM frequency wobbling as needed
• Change of the PWM pulse widths within and after each PWM period as needed
• External-maskable power and drive-protection interrupts
• Pulse-pattern-generator circuit, for programmable generation of asymmetric,
symmetric, and four-space vector PWM waveforms
• Minimized CPU overhead using auto-reload of the compare and period registers
• The PWM pins are driven to a high-impedance state when the PDPINTx pin is
driven low and after
6
EVA
EVB
Fig 3. The procedure to generate the PWM waveform
7
Initialize System Control
Initialize GPIO
Clear all interrupts and initialize PIE vector table
Initialize all the Device Peripherals
Specific code for PWM waveform generation
Fig 4. The procedure to generate the PWM waveform
8
 Get the analog signal from ADCINA0 (P9)
 A/D conversion
 Using Digital signal to change the duty cycle of PWM waveform generation
 Output PWM waveform to P8
Processing…
Input
Analog
Voltage
3V
AD conversion
Digital
Value
For
PWM waveform
Output
Fig 5. The steps for A/D conversion and PWM waveform generation
9
Osciloscope Display
+5V
R
1K
DSP power source
Var-R
10K
2812 CPU
Zener
3V
ADC
GND
PWM
PWM1
(P8)
ADCLO
(P9)
Fig 6. The connections for ADC and PWM generation
10
Thank you very much
for your listening!
11