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