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 010 πππ = 2 10 = 1024 = 4.9ππ/πππ’ 001 000 0 V DD /2 n V DD Analog Voltage
PIC 16F18324 A/D Converter β’ 10-bit Converter β’ 11 External Channels Available β’ External V REF+ and V REF- Available β’ Auto Conversion Trigger
10-bit A/D Result Format
ADC Clock Selection 5π£π
ANSELA: PORTA Analog Select
ADCON0
ADCON1
Pulse Width Modulation (PWM) 1 Cycle 50% Vdd Voltage Effective Voltage 50% Duty Cycle Voltage = Vdd*0.50 0 Time
PWM 20% Duty Cycle 1 Cycle 20% Vdd Voltage Effective Voltage 20% Duty Cycle Voltage = Vdd*0.20 0 Time
PWM 80% Duty Cycle 1 Cycle 80% Vdd Effective Voltage 80% Duty Cycle Voltage Voltage = Vdd*0.80 0 Time
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: Outputs: Each Peripheral Has A PPS Register Each I/O Pin Has A PPS Register XXX β Specifies the Peripheral Rxy β Specifies the Pin
RxyPPS Output Select
Recommend
More recommend