lecture 8 digital waveform generator using u-controller 2007/11/09 prof. c.m. kyung

17
Lecture 8 Digital waveform generator using u-controller 2007/11/09 Prof. C.M. Kyung

Upload: skye-bissell

Post on 16-Dec-2015

229 views

Category:

Documents


7 download

TRANSCRIPT

Page 1: Lecture 8 Digital waveform generator using u-controller 2007/11/09 Prof. C.M. Kyung

Lecture 8 Digital waveform generator using u-

controller

2007/11/09

Prof. C.M. Kyung

Page 2: Lecture 8 Digital waveform generator using u-controller 2007/11/09 Prof. C.M. Kyung

Experimental Goal

GOAL is to get familiar with.. Intel 8051 microcontroller The concept of D/A converter The concept of Timer Function generator

Sine wave, square wave

Page 3: Lecture 8 Digital waveform generator using u-controller 2007/11/09 Prof. C.M. Kyung

D/A Converter : DAC0800

Fast settling output current: 100 ns Full scale error: ±1 LSB Nonlinearity over temperature: ±0.1% Full scale current drift: ±10 ppm/°C High output compliance: −10V to +18V Complementary current outputs Interface directly with TTL, CMOS, PMOS and others 2 quadrant wide range multiplying capability Wide power supply range: ±4.5V to ±18V Low power consumption: 33 mW at ±5V Low cost

Page 4: Lecture 8 Digital waveform generator using u-controller 2007/11/09 Prof. C.M. Kyung

Top Architecture of DAC

D/A Converter : DAC0800

Page 5: Lecture 8 Digital waveform generator using u-controller 2007/11/09 Prof. C.M. Kyung

DAC Interface Circuit

Digital Value LatchedDigital Value

AnalogOutput

DAC0800DAC

74F573Flip-Flop

8051MCU

Oscilloscope

0101100

Page 6: Lecture 8 Digital waveform generator using u-controller 2007/11/09 Prof. C.M. Kyung

DAC Interface Circuit

Page 7: Lecture 8 Digital waveform generator using u-controller 2007/11/09 Prof. C.M. Kyung

DAC Interface Circuit

C100H mapping cmpact51.h 참조 unsigned char xdata DAC_0800 _at_ 0xC100;

수학함수 library 이용 Sine function 이용 @ <math.h> Floating point 연산 속도 느림 Specification 에 알맞은 방법 찾아보기

Page 8: Lecture 8 Digital waveform generator using u-controller 2007/11/09 Prof. C.M. Kyung

Timer / Counter

Count the machine cycle (1/12 of internal system cycle) or external clock / event

When the 8bit or 16bit timer overflows, timer interrupt occurs

8051 has 2 timers – Timer0, Timer1 Timers are controlled by TMOD, TCON

registers 4 modes are available

Page 9: Lecture 8 Digital waveform generator using u-controller 2007/11/09 Prof. C.M. Kyung

Timer Module

Timer Interface Circuit

Page 10: Lecture 8 Digital waveform generator using u-controller 2007/11/09 Prof. C.M. Kyung

Timer Mode

Mode0 8bit TH0 / lower 5bit TL0

Mode1 16bit timer TH0/TL0

Mode2 8bit timer with auto reload

Mode3 Separated 8bit TH0 / 8bit TL0

Page 11: Lecture 8 Digital waveform generator using u-controller 2007/11/09 Prof. C.M. Kyung

Timer Mode

Page 12: Lecture 8 Digital waveform generator using u-controller 2007/11/09 Prof. C.M. Kyung

Timer Mode

Mode2 TL 8bit counter 사용

Auto reload 지원 Overflow bit setting

– 사용자가 TF clear– TH 에 저장되어 있는 값이 TL 로 auto reload

Auto reload 는 수동 reload 보다 정확하다 .

Timer 주기가 짧은 경우에만 사용 가능

Page 13: Lecture 8 Digital waveform generator using u-controller 2007/11/09 Prof. C.M. Kyung

Timer Registers

Page 14: Lecture 8 Digital waveform generator using u-controller 2007/11/09 Prof. C.M. Kyung

Problem State 1

Sine wave generation 한 주기 내에 샘플의 개수 선택 , 또는 타이머 인터럽트

주기 결정

COMPACT51 보드로 만들 수 있는 정현파의 최대주파수

버튼을 누를 때마다 주파수가 바뀌는 정현파 발생기 만들어보기

Page 15: Lecture 8 Digital waveform generator using u-controller 2007/11/09 Prof. C.M. Kyung

Problem State 2

Square wave generation 한 주기 내에 샘플의 개수 선택 , 또는 타이머 인터럽트

주기 결정

COMPACT51 보드로 만들 수 있는 구형파의 최대주파수

버튼을 누를 때마다 주파수가 바뀌는 구형파 발생기 만들어보기

Page 16: Lecture 8 Digital waveform generator using u-controller 2007/11/09 Prof. C.M. Kyung

Experiment Requirements

COMPACT51 보드 KEIL uVisionII 프로그램 PC PC 와 COMPACT51 보드를 연결하기 위한 UART

cable Oscilloscope

Page 17: Lecture 8 Digital waveform generator using u-controller 2007/11/09 Prof. C.M. Kyung

References & Contact Textbook

8051 user’s manual 8255 user’s manual 8051 & C Programming, 문왕환 , 도서출판 세화 DAC0800/DAC0804 manual COMPACT51 실험보드 회로도 cmpt51.h 헤더파일 KEIL uVisionIII 매뉴얼 (HELP)

7th Week T.A. E-mail

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