1 / 7

DK-128 ADC 실습

DK-128 ADC 실습. 아이티즌 기술연구소 2010.04.21. ADC= 아날로그신호입력. Port A : I/O, 상위어드레스 (ALE 의한제어 ). 아날로그전원. 프로그램 쓰기. 전원. Port E : I/O, 외부인터럽트 , ISP 프로그래밍. 데이터 / 주소 모드. ATMEGA128. LED. 전원. Port B : I/O, 타이머 , 카운터 , PWM, SPI. 외부데이터메모리 접근 모드. Oscillator. Port D : I/O, TWI, UART 직렬통신.

lisle
Télécharger la présentation

DK-128 ADC 실습

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DK-128 ADC 실습 아이티즌 기술연구소 2010.04.21

  2. ADC=아날로그신호입력 Port A : I/O, 상위어드레스(ALE의한제어) 아날로그전원 프로그램 쓰기 전원 Port E : I/O, 외부인터럽트, ISP 프로그래밍 데이터/주소 모드 ATMEGA128 LED 전원 Port B : I/O, 타이머, 카운터, PWM, SPI 외부데이터메모리 접근 모드 Oscillator Port D : I/O, TWI, UART직렬통신 Real time clock시 Oscillator

  3. A/D 컨버터의 개요 • 연속적인 신호인 아날로그 신호를 디지털 신호로 변환하는 일을 하는 기계장치 • ADC 관련 레지스터 • ADMUX (ADC Multiplexer Selection Register) • ADCSRA (ADC Control and Status Register A) • ADCL/H (ADC Data Register)

  4. A/D 컨버터 구현 순서 • ADC 초기화 1. 기준전압 설정 : 기준전압 2. ADC 데이터 정렬 위치 조정 3. ADC 허용(Enable), 프리스케일러 값 사용 : 64 • AD 변환(Conversion) 1. 아날로그 데이터가 입력되는 핀을 선택(ADC0) 2. AD 변환(Conversion) 시작 3. AD 변환 완료 여부 확인 AD 변환 완료될 때까지 대기, 완료 확인되면 다음 진행 4. AD 변환 완료된 데이터 반환

  5. 실습 예제 1/3 (조도 센서값 출력) #include <개인용 헤더파일>

  6. 실습 예제 2/3 (조도 센서값 출력) If(ch_ADC < 최소값) //yellow LED ON else if(ch_ADC >= 최소값 && ch_ADC < 최대값) //green LED ON else //red LED ON

  7. 실습 예제 3/3 • 앞에 선언한 함수를 구현하기 • LED_init 함수 • ADC_init 함수 • ADConversion 함수

More Related