Analog to Digital Conversion and Pulse Width Modulation ECE Senior - - PowerPoint PPT Presentation
Analog to Digital Conversion and Pulse Width Modulation ECE Senior - - PowerPoint PPT Presentation
Analog to Digital Conversion and Pulse Width Modulation ECE Senior Design 28 February 2017 Analog to Digital Conversion 2 n -1 111 = 110 2 101 10-bit Conversion and V ref = 5V Digital Value 100 011 5 5
Analog to Digital Conversion
2n-1
000
Digital Value Analog Voltage VDD/2n VDD
001 010 011 100 101 110 111
πππ = πΊππ 2π 10-bit Conversion and Vref = 5V πππ =
5 210 = 5 1024 = 4.9ππ/πππ’
PIC 16F18324 A/D Converter
- 10-bit Converter
- 11 External Channels Available
- External VREF+ and VREF- Available
- Auto Conversion Trigger
10-bit A/D Result Format
ADC Clock Selection
5π£π
ANSELA: PORTA Analog Select
ADCON0
ADCON1
Pulse Width Modulation (PWM)
Vdd Voltage Time Effective Voltage
1 Cycle 50% 50% Duty Cycle Voltage = Vdd*0.50
PWM 20% Duty Cycle
Vdd Voltage Time Effective Voltage
1 Cycle 20% Duty Cycle Voltage = Vdd*0.20 20%
PWM 80% Duty Cycle
Vdd Voltage Time Effective Voltage
1 Cycle 80% Duty Cycle Voltage = Vdd*0.80 80%
PWM Sine Generation
CCP & PWM
- 2 CCP Modules
- 2 PWM Modules
- Timer 2 Sets Freq
Dedicated PWM Module
PWM Output on PPS Registers:
- TMR2
- PR2
- PWMxCON
- PWMxDCH
- PWMxDCL
PWMxCON
T2CON
Peripheral Pin Select
Inputs:
Each Peripheral Has A PPS Register XXX β Specifies the Peripheral
Outputs:
Each I/O Pin Has A PPS Register Rxy β Specifies the Pin