lecture 8 digital waveform generator using u-controller 2007/11/09 prof. c.m. kyung
TRANSCRIPT
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
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
Top Architecture of DAC
D/A Converter : DAC0800
DAC Interface Circuit
Digital Value LatchedDigital Value
AnalogOutput
DAC0800DAC
74F573Flip-Flop
8051MCU
Oscilloscope
0101100
DAC Interface Circuit
DAC Interface Circuit
C100H mapping cmpact51.h 참조 unsigned char xdata DAC_0800 _at_ 0xC100;
수학함수 library 이용 Sine function 이용 @ <math.h> Floating point 연산 속도 느림 Specification 에 알맞은 방법 찾아보기
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
Timer Module
Timer Interface Circuit
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
Timer Mode
Timer Mode
Mode2 TL 8bit counter 사용
Auto reload 지원 Overflow bit setting
– 사용자가 TF clear– TH 에 저장되어 있는 값이 TL 로 auto reload
Auto reload 는 수동 reload 보다 정확하다 .
Timer 주기가 짧은 경우에만 사용 가능
Timer Registers
Problem State 1
Sine wave generation 한 주기 내에 샘플의 개수 선택 , 또는 타이머 인터럽트
주기 결정
COMPACT51 보드로 만들 수 있는 정현파의 최대주파수
버튼을 누를 때마다 주파수가 바뀌는 정현파 발생기 만들어보기
Problem State 2
Square wave generation 한 주기 내에 샘플의 개수 선택 , 또는 타이머 인터럽트
주기 결정
COMPACT51 보드로 만들 수 있는 구형파의 최대주파수
버튼을 누를 때마다 주파수가 바뀌는 구형파 발생기 만들어보기
Experiment Requirements
COMPACT51 보드 KEIL uVisionII 프로그램 PC PC 와 COMPACT51 보드를 연결하기 위한 UART
cable Oscilloscope
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/