110 likes | 249 Views
SOUTHERN TAIWAN UNIVERSITY. Presentation:. ADC – A nalog to D igital C onverter and PWM Waveform G eneration with EZDSP2812. Professor: Chen, Pei-Chung 陳 沛 仲 Student: Thanh-Nhan Nguyen 阮 誠 仁. 2008, December, 11 th. Outline:. ADC module introduction 2. PWM waveform generation
E N D
SOUTHERN TAIWAN UNIVERSITY Presentation: ADC – Analog to Digital Converter and PWM Waveform Generation with EZDSP2812 Professor: Chen, Pei-Chung陳 沛 仲 Student: Thanh-Nhan Nguyen 阮 誠 仁 2008, December, 11th
Outline: • ADC module introduction 2. PWM waveform generation 3. An example
1. ADC module introduction 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 When input <= 0V Digital Value = 4096 * ((Input Analog Voltage- ADCLO)/3) When 0V < input <3V Digital Value = 4095When input >=3V ADC voltage resolution is: (0V - 3V) / 4096 codes = 3V / 4096 codes ~ 0.000732 volts/code ~ 0.732 mV/code
1. ADC module introduction Fig 1. ADC pin connections with internal reference
Initialize System Control Initialize GPIO Clear all interrupts and initialize PIE vector table Initialize all the Device Peripherals Specific code for A/D conversion 1. ADC module introduction Fig 2. The procedure to use ADC – Analog to Digital Converter
2. PWM Waveform Generation 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
EVA EVB 2. PWM Waveform Generation Fig 3. The procedure to generate the PWM waveform
Initialize System Control Initialize GPIO Clear all interrupts and initialize PIE vector table Initialize all the Device Peripherals Specific code for PWM waveform generation 2. PWM Waveform Generation Fig 4. The procedure to generate the PWM waveform
3. An example • 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… Analog Voltage 3V AD conversion Digital Value For PWM waveform Input Output Fig 5. The steps for A/D conversion and PWM waveform generation
Osciloscope Display +5V R 1K Var-R 10K Zener 3V PWM1 (P8) ADCLO (P9) GND 3. An example DSP power source 2812 CPU ADC PWM Fig 6. The connections for ADC and PWM generation