Analog Digital Signal Analog Signal Digital Signal Analog

  • Slides: 23
Download presentation

Analog & Digital Signal Analog Signal Digital Signal

Analog & Digital Signal Analog Signal Digital Signal

Analog to Digital Converter Sampling and Hold Quantize

Analog to Digital Converter Sampling and Hold Quantize

Sampling Rate Selection Sampling Rate fs >= 2 Bandwidth

Sampling Rate Selection Sampling Rate fs >= 2 Bandwidth

Sampling Rate Selection Resolution LSB = (Vref+-Vref-)/2 k

Sampling Rate Selection Resolution LSB = (Vref+-Vref-)/2 k

ADC ชนด Successive Approximation

ADC ชนด Successive Approximation

ADC ของ PIC 18 F 8722 • PIC 18 F 8722 มวงจร Analog to

ADC ของ PIC 18 F 8722 • PIC 18 F 8722 มวงจร Analog to Digital Converter ขนาด 10 bit ทงหมด 16 วงจร (AN 0 -AN 15)

ADC ของ PIC 18 F 8722

ADC ของ PIC 18 F 8722

ADC ของ PIC 18 F 8722

ADC ของ PIC 18 F 8722

ADC ของ PIC 18 F 8722

ADC ของ PIC 18 F 8722

Register ของ ADC • PIC ม Register ทเกยวกบ ตวคอ 1. 2. 3. 4. 5.

Register ของ ADC • PIC ม Register ทเกยวกบ ตวคอ 1. 2. 3. 4. 5. ADC ทงหมด A/D Result High Register (ADRESH) A/D Result Low Register (ADRESL) A/D Control Register 0 (ADCON 0) A/D Control Register 1 (ADCON 1) A/D Control Register 2 (ADCON 2) 5

ADCON 0

ADCON 0

ADCON 1

ADCON 1

ADCON 2 • ADCON 2 เปน Register ทใชกำหน ด Acquisition Time ของวงจร ADC

ADCON 2 • ADCON 2 เปน Register ทใชกำหน ด Acquisition Time ของวงจร ADC

Acquisition Time

Acquisition Time

#include <p 18 f 8722. h> #include <adc. h> #include <delays. h> #include <timers.

#include <p 18 f 8722. h> #include <adc. h> #include <delays. h> #include <timers. h> ADCON 0 bits. ADON = 1; while(1) { ADCON 0 bits. GO=1; while(ADCON 0 bits. GO); result = ADRES; result >>=2; if(result==0) result = 1; #define NUMBER_OF_LEDS 8 #pragma code int result; int shift; void main(void) { TRISAbits. TRISA 0=1; TRISD = 0; PORTD = 0; ADCON 1 = 0 b 00001110; ADCON 2 = 0 b 10001010; // } PORTD = result; PORTD=1<<shift; shift++; shift %=8; } Delay 10 KTCYx(20);