lecture 10 a/d and d/a converter for digital filter 2007. 11. 23 prof. c.m kyung

13
Lecture 10 A/D and D/A converter for Digital Filter 2007. 11. 23 Prof. C.M Kyung

Upload: belinda-cameron

Post on 17-Dec-2015

218 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Lecture 10 A/D and D/A converter for Digital Filter 2007. 11. 23 Prof. C.M Kyung

Lecture 10 A/D and D/A converter for Digital

Filter

2007. 11. 23

Prof. C.M Kyung

Page 2: Lecture 10 A/D and D/A converter for Digital Filter 2007. 11. 23 Prof. C.M Kyung

Experimental Goal GOAL is to get familiar with..

A/D converter (ADC0804)

A/D – D/C converting

Simple FIR filter design

Page 3: Lecture 10 A/D and D/A converter for Digital Filter 2007. 11. 23 Prof. C.M Kyung

A/D converter

A/D converter 직류 또는 교류의 아날로그 신호를 마이크로프로세서에서 인식할

수 있도록 디지털 값으로 변환해 주는 소자

ADC0804

<Specification> Easy interface to all

microprocessors Differential analog voltage inputs 0V to 5V analog input voltage

range with single 5V supply Works with 2.5V voltage reference Resolution : 8 bits Conversion time : 100 ㎲

Page 4: Lecture 10 A/D and D/A converter for Digital Filter 2007. 11. 23 Prof. C.M Kyung

Usage of ADC0804

Pin usagePin name Function

/CS 칩 선택 (active low)

/RD ADC 변환 값 읽을 때 (low)

/WR ADC 변환 (low)

CLK IN ADC 변환 clock 입력

/INTR ADC 변환 끝났을 때 low 출력

VIN(+) 차동 입력의 +

VIN(–) 차동 입력의 –

A GND 아날로그 접지

VREF/2 기준 전압의 ½ (2.5V)

D GND 디지털 접지

DB0 ~ DB7 변환된 디지털 출력

CLK R ADC 변환 clock 출력

VCC (or VREF) 전원 (5V)

Page 5: Lecture 10 A/D and D/A converter for Digital Filter 2007. 11. 23 Prof. C.M Kyung

Usage of ADC0804 Typical Application

Page 6: Lecture 10 A/D and D/A converter for Digital Filter 2007. 11. 23 Prof. C.M Kyung

Usage of ADC0804 Timing diagram

Write operationWrite operation

Read operationRead operation

/CS/CS

/WR/WR

Internal Internal state of state of

converterconverter/INTR/INTR

Not BusyNot BusyBusyBusy

Not Not BusyBusy

/INTR/INTR

/CS/CS

/RD/RD

Out put Out put DataData

TRI-STATETRI-STATE

Page 7: Lecture 10 A/D and D/A converter for Digital Filter 2007. 11. 23 Prof. C.M Kyung

A/D – D/C converting

MicroprocessorMicroprocessor

ADCADC

DACDAC

Function generatorFunction generator

OscilloscopeOscilloscope

입력입력

출력출력

일정 지연 시간 일정 지연 시간 (( 대기시간대기시간 ) = ) = ADC conversion time + processing time of microprocessorADC conversion time + processing time of microprocessor

Page 8: Lecture 10 A/D and D/A converter for Digital Filter 2007. 11. 23 Prof. C.M Kyung

A/D – D/C converting

대기시간 구현 방식 Delay function: Source code 의 main 함수에서 delay

function 을 구현하여 일정 시간을 기다림 Interrupt: microprocessor 의 interrupt pin 을 이용하여 구현

Delay function vs. interrupt

구현 방식 내용 장점 단점

Delay function 입력을

기다리는 방식

구현이 용이 입력을 기다리는 중 다른 연산 수행 불가능

Interrupt입력을 기다리는 중 다른 연산 수행 가능

이벤트 발생시 미리 정해진 루틴을 따라야 함

Page 9: Lecture 10 A/D and D/A converter for Digital Filter 2007. 11. 23 Prof. C.M Kyung

A/D – D/C converting

대기시간 구현 방식 예 – Delay function

void delay(unsigned char void delay(unsigned char time){time){        while(time--){while(time--){                time++;time++;                time--;time--;          }} }}

void main (void) {void main (void) {      ADC ADC 변환 시작변환 시작 delay(100);delay(100);        ADC ADC 변환 값 변환 값 readread }}

Delay function Delay function 구현구현 Delay function Delay function 이용이용

Page 10: Lecture 10 A/D and D/A converter for Digital Filter 2007. 11. 23 Prof. C.M Kyung

A/D – D/C converting

MicroprocessorMicroprocessor

ADCADC

DACDAC

Function generatorFunction generator

OscilloscopeOscilloscope

입력입력

출력출력

Maximum sampling rate =Maximum sampling rate =1 / 1 / 대기시간 대기시간 [Hz] [Hz]

Maximum frequency =Maximum frequency =Maximum sampling rate / 2 [Hz]Maximum sampling rate / 2 [Hz]

Page 11: Lecture 10 A/D and D/A converter for Digital Filter 2007. 11. 23 Prof. C.M Kyung

FIR filter design

Decimal calculation in FIR filter design 8051 microprocessor does not have floating

point operation unit. Decimal calculation is very slow in 8051

microprocessor.

Modifying decimal calculation to integer calculation Providing significantly higher performance while

maintaining fidelity accuracy of FIR filter How to do? Pre-report!

Page 12: Lecture 10 A/D and D/A converter for Digital Filter 2007. 11. 23 Prof. C.M Kyung

Experiment Requirements

COMPACT51 board

KEIL uVisionII program

PC

UART cable

Oscilloscope

Function Generator

Page 13: Lecture 10 A/D and D/A converter for Digital Filter 2007. 11. 23 Prof. C.M Kyung

References & Contact Textbook

8051 user’s manual

8051 & C Programming, 문왕환 , 도서출판 세화

ADC 0804 manual

10th Week T.A. [email protected] [email protected]

Lecture Homepage http://wink.kaist.ac.kr/course/ee306/