슬라이드 1

Similar documents
< E20C6DFBFFEBEEE20C0DBBCBAC0BB20C0A7C7D12043BEF0BEEE20492E707074>

<4D F736F F F696E74202D20BBB7BBB7C7D15F FBEDFB0A3B1B3C0B05FC1A638C0CFC2F72E BC8A3C8AF20B8F0B5E55D>

<4D F736F F F696E74202D20B8B6C0CCC5A9B7CEC7C1B7CEBCBCBCAD202839C1D6C2F7207E203135C1D6C2F >

PowerPoint 프레젠테이션

(Asynchronous Mode) ( 1, 5~8, 1~2) & (Parity) 1 ; * S erial Port (BIOS INT 14H) - 1 -

MicrocontrollerAcademy_Lab_ST_040709

T100MD+

[8051] 강의자료.PDF

Microsoft PowerPoint - 부호기와 복호기.PPT

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션

Microsoft PowerPoint - o8.pptx

Microsoft PowerPoint - polling.pptx

PowerPoint 프레젠테이션

PowerPoint Presentation

hd1300_k_v1r2_Final_.PDF

untitled

IoT FND8 7-SEGMENT api

슬라이드 1

SRC PLUS 제어기 MANUAL

PowerPoint 프레젠테이션

MPLAB C18 C

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D D382E687770>

// 변수선언 unsigned char i; unsigned char FONT[]={0xC0, 0xF9, 0xA4, 0xB0, 0x99, 0x92, 0x82, 0xD8, 0x80, 0x98}; //PORTA 를출력으로설정하고초기값은모두 0 PORTA = 0x00; DD

프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어

iii. Design Tab 을 Click 하여 WindowBuilder 가자동으로생성한 GUI 프로그래밍환경을확인한다.

슬라이드 1

untitled

ºÎ·ÏB

airDACManualOnline_Kor.key

API 매뉴얼

Microsoft PowerPoint - es-arduino-lecture-03

BMP 파일 처리

LCD Display

10X56_NWG_KOR.indd

Microsoft Word - PEB08_USER_GUIDE.doc

MAX+plus II Getting Started - 무작정따라하기

untitled

SHT-KT3010AX 3070AXAF(3.1) R2 M.ai

Microsoft Word - logic2005.doc

<4D F736F F F696E74202D20B8B6C0CCC5A9B7CEC7C1B7CEBCBCBCAD202834C1D6C2F7207E2038C1D6C2F729>

2 PX-8000과 RM-8000/LM-8000등의 관련 제품은 시스템의 간편한 설치와 쉬운 운영에 대한 고급 기술을 제공합니다. 또한 뛰어난 확장성으로 사용자가 요구하는 시스템을 손쉽게 구현할 수 있습니다. 메인컨트롤러인 PX-8000의 BGM입력소스를 8개의 로컬지

DSP_MON 프로그램 메뉴얼

Microsoft Word doc

歯superimp.PDF

Microsoft Word - FS_ZigBee_Manual_V1.3.docx

Microsoft PowerPoint - ch03ysk2012.ppt [호환 모드]

Microsoft Word - Automap3

KEY 디바이스 드라이버

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션

,,,,,, (41) ( e f f e c t ), ( c u r r e n t ) ( p o t e n t i a l difference),, ( r e s i s t a n c e ) 2,,,,,,,, (41), (42) (42) ( 41) (Ohm s law),

FMX M JPG 15MB 320x240 30fps, 160Kbps 11MB View operation,, seek seek Random Access Average Read Sequential Read 12 FMX () 2

슬라이드 1

목차 1. 개요 USB 드라이버 설치 (FTDI DRIVER) FTDI DRIVER 실행파일 USB 드라이버 확인방법 DEVICE-PROGRAMMER 설치 DEVICE-PROGRAMMER

<4D F736F F F696E74202D20BBB7BBB7C7D15F FBEDFB0A3B1B3C0B05FC1A634C0CFC2F72E BC8A3C8AF20B8F0B5E55D>

Something that can be seen, touched or otherwise sensed

DDX4038BT DDX4038BTM DDX4038 DDX4038M 2010 Kenwood Corporation All Rights Reserved. LVT A (MN)

Orcad Capture 9.x

歯15-ROMPLD.PDF

CANTUS Evaluation Board Ap. Note

Microsoft Word - Installation and User Manual_CMD V2.2_.doc

API 매뉴얼

목차 1. 제품 소개 특징 개요 Function table 기능 소개 Copy Compare Copy & Compare Erase

歯AG-MX70P한글매뉴얼.PDF

Remote UI Guide

<4D F736F F F696E74202D C61645FB3EDB8AEC7D5BCBA20B9D720C5F8BBE7BFEBB9FD2E BC8A3C8AF20B8F0B5E55D>

Microsoft Word - ASG AT90CAN128 모듈.doc

PowerPoint 프레젠테이션

untitled


< C6AFC1FD28B1C7C7F5C1DF292E687770>

<4D F736F F D20B1E2BCFAC0DAB7E1202D20454F435220B8F0B5E5B9F6BDBA20C5EBBDC5C1A6C7B020BBE7BFEBB9FD202D F302E646F63>

슬라이드 1

Oracle Apps Day_SEM

슬라이드 제목 없음

Microsoft PowerPoint - 30.ppt [호환 모드]

Microsoft Word - KPMC-400,401 SW 사용 설명서

CPX-E-EC_BES_C_ _ k1

Mango220 Android How to compile and Transfer image to Target

PRO1_09E [읽기 전용]

9

MR-3000A-MAN.hwp

정보보안 개론과 실습:네트워크

강의10

User Guide

<4D F736F F F696E74202D20BBB7BBB7C7D15F FBEDFB0A3B1B3C0B05FC1A636C0CFC2F72E BC8A3C8AF20B8F0B5E55D>


Microsoft Word ARM_ver2_0a.docx

강의개요

MAGIC-6004M_K

untitled

hwp

R50_51_kor_ch1

슬라이드 1

untitled

歯7장.PDF

2011년 10월 초판 c 2011 Sony Corporation. All rights reserved. 서면 허가 없이 전체 또는 일부를 복제하는 것을 금합니다. 기능 및 규격은 통보 없이 변경될 수 있습니다. Sony와 Sony 로고는 Sony의 상표입니다. G L

CPX-E-PB_BES_C_ _ k1

Transcription:

Chap7. LED, LCD 와 7- 세그먼트 켜기및 IIC 통신

LED 를켜기위한순서 1. 프로그램코딩및빌드 ( 헥사파일만들기 ) 2. 프로그램메모리라이팅

M-IDE 빌드해서핵사파일만들기

강의계획 Chap1. 강의계획및디지털논리이론 Chap2. 펌웨어작성을위한 C 언어 I Chap3. 펌웨어작성을위한 C 언어 II Chap4. AT89S52 메모리구조 Chap5. SD-52 보드구성과코드메모리프로그래밍방법 Chap6. 어드레스디코딩 ( 매핑 ) 과어셈블리어코딩방법 Chap7. LED, LCD 와 7- 세그먼트켜기및 IIC 통신 Chap8. 인터럽트와타이머 Chap9. 직렬통신과 PS2 키보드인터페이스 Chap10. 리모콘수신과 RTC 및 Speaker Chap11. AD 컨버터와 DA 컨버터 Chap12. OSD (On-Screen Display)

Keil-C 컴파일러사용하기 (1/5) Project New Atmel AT89C52 확인

Keil-C 컴파일러사용하기 (2/5) Target 1 에서마우스오른쪽버튼후 Option for target target 1

Keil-C 컴파일러사용하기 (3/5)

Keil-C 컴파일러사용하기 (4/5) Source Group 1 에서마우스오른쪽버튼후 Add files to Group Source Group 1 프로그램을작성하신후 Project Build Target or F7

Keil-C 컴파일러사용하기 (5/5) SD-52 Training Board 에있는 CD 나자료실의 AT89S52_HardwareSetting 부분을다운받아서사 용해도됩니다. 기본적인구성이프로그램되어있습니다.

Current (1/2) 소스원이충분할때흐를수있는전류는도선의넓이와비례한다.

Current (2/2) 저항의의해전류량을조절할수있다.

DIODE Symbol of Diode Characteristic of Diode Operation of Diode

LED (1/2) + - R V 5V 2V 3V = = = = 300Ω I 10mA 0.01A

LED (2/2) + - + - + - Case 1 Case 2 Case 3

AT89S52_HardwareSetting Memorymapping.h BYTE xdata LED _at_ 0x0000; BYTE xdata SEG_SIGAL _at_ 0x0100; BYTE xdata SEG_DIGIT _at_ 0x0200; BYTE xdata LCD_WR_COMMAND _at_ 0x0300; BYTE xdata LCD_RD_STATE _at_ 0x0301; BYTE xdata LCD_WR_DATA _at_ 0x0302; BYTE xdata LCD_RD_DATA _at_ 0x0303; BYTE xdata DAC_VALUE _at_ 0x0400; BYTE xdata OUT_CONTROL _at_ 0x0500; void main(void) { BYTE LedVar = 0; Initial_CPU(); while(1){ LED = ~(LedVar++); LongDelay(500); } } Main.c

7-Segment (1/4) Common Anode Type Common cathode Type

7-Segment (2/4) 7-Segment Driving Method Passive Method (Scanning Method) Active Method ( Data Latched Method) MCU Data Latch Latch Latch Latch Latch Enable

7-Segment (3/4) 문제점 : 점유율높다.

7-Segment (4/4) 7- Segment Code Table unsigned char code FND[10] ={ ~(0x01 0x02 0x04 0x08 0x10 0x20), // 0 ~(0x02 0x04), // 1 ~(0x01 0x02 0x40 0x10 0x08),// 2 ~(0x01 0x02 0x40 0x04 0x08),// 3 ~(0x20 0x40 0x02 0x04), // 4 ~(0x01 0x20 0x40 0x04 0x08),// 5 ~(0x20 0x10 0x40 0x04 0x08),// 6 ~(0x20 0x01 0x02 0x04), // 7 ~(0x01 0x02 0x04 0x40 0x08 0x10 0x20), // 8 ~(0x20 0x01 0x02 0x40 0x04), // 9 };

CLCD (1/9) CLCD Interface Part

CLCD (2/9) - 4bit, 8bit interface - 5X8 dots or 5X7 dots character font - Display Data RAM (DDRAM), Character Generator ROM (CGROM) and CGRAM - Display clear, cursor home, display on/off, cursor on/off, display character blink, cursor shift, display shift. - instruction register (IR) and an data register (DR) By RS and R/W input signals, these two registers can be selected. (if RS = 0 then IR, else DR)

ASCII Table 과호환 : ex) A = 0x41 printf( A ); CLCD (3/9)

CLCD (4/9) Write Timing

CLCD (5/9) Read Timing

CLCD (6/9) Clear Display : 전체화면을지우고 DDRAM 어드레스를 0으로 clear한후커서를 home 위치로옮긴다. Return Home : 커서를홈으로위치시킨다. Entry Mode Set : I/D=1: Increment the DDRAM address, I/D=0, Decrement the DDRAM address S = 1 : shifts the entire display, S=0, the display does not shift. Display on/off control : D = 1 : Displaly On, D = 0 : Display Off C = 1 :Cursor On, C = 0 : Cursor Off B = 1 : Cursor Blink On, B = 0 : Cursor Blink Off

CLCD (7/9) Cursor or display shift : 00: Shifts the cursor position to the left, 01: Shifts the cursor position to the right : 10: Shifts the entire display to the left. 11: Shifts the entire display to the right. Function set DL:Sets the interface data length. 1: Data are sent or received in 8-bit lengths (DB7 to DB0) 0: Data are sent or received in 4-bit lengths (DB7 to DB4) * 4-bit length is selected, data must be sent or received twice. N:Sets the number of display lines. 1 : 2 행 0 : 1 행 F:Sets the character font. 1 : 5 X 11 0 : 5 X 8 Read busy flag and address

CLCD (8/9) LCD 초기화 lcd_command_write(0x38); lcd_command_write(0x08); lcd_command_write(0x01); lcd_command_write(0x06); lcd_command_write(0x0c); LCD Initial 이성공하면 LCD 위에나타나는바가없어진다.

CLCD (9/9) Programming Method 1. command write와 display write 함수를만들어라 2. 쉬운접근을위한 String 함수를만들어라. ex) LcdString(BYTE line, char *str) LcdString(0x80, Smartdisplay World ) void LcdString(BYTE line, char *str) { BYTE index; BYTE character; lcd_command_write(line); // LCD command : cursor position index = 0; character = str[index]; while(character!= '\0') { lcd_char_display(character); // LCD character display index++; character = str[index]; } }

IIC Protocol(1/7) Introduction to IIC(I2C) Philips originally developed a simple bi-directional 2-wire, Serial Data (SDA) and Serial Clock (SCL) bus for inter-ic control. A complete system usually consists of at least one microcontroller (Master) and other peripheral devices (Slave). IIC Protocol is made up start condition, memory addressing bit data input, acknowledge bit, and stop condition.

IIC Protocol(2/7) The IIC-BUS Concept Micro Controller Video Processor Audio Processor ADC SDA SCL Memory OSD LCD DRIVER Example of IIC-Bus Application Two wires, serial data (SDA) and serial clock (SCL), carry information between devices connected to the bus. Each device has a its own address. (ex, Memory : 0xA0, Audio Processor: 0xA8) It appears that Micro-controller is the master device, the others are slave devices.

IIC Protocol(3/7) General Characteristics VDD Pull-Up Resistors SDA(Serial Data Line) SCL(Serial Clock Line) SCLK1 OUT DATA1 OUT SCLK1 OUT DATA1 OUT SCLK IN DATA IN SCLK IN DATA IN Device 1 Device 2 Connection of device to the IIC-bus Both SDA and SCL are bi-directional lines, connected to Pull-up resistors. When the bus is free, both line is HIGH. The output stage must have an open-drain or open-collector to perform to Wired-AND function

IIC Protocol(4/7) Start and Stop Conditions Start Condition : A HIGH to LOW transition on the SDA line while SCL line is HIGH. Stop Condition : A LOW to HIGH transition on the SDA line while SCL line is HIGH. Data Validity The data on the SDA line must be stable during the HIGH period of clock.

IIC Protocol(5/7) Write Operation Byte Write Page Write

IIC Protocol(6/7) Read Operation Current Address Read Random Read

IIC Protocol(7/7) Read Operation Sequential Read

Tip (1/2)

Tip (2/2) #define SetRtcSCLK (P1 = 0x04) #define SetSCL (OUT_CONTRL_REGISTER = 0x20); OUT_CONTROL = OUT_CONTRL_REGISTER P1 : Register 개념으로비트단위로제어가가능 OUT_CONTROL : 외부번지로비트단위로제어불능 ( 저장기능없음 ) 따라서비트단위로제어를하기위해서는저장기능을갖는레지스터를만들어줘야함

숙제 1. 지난주에어셈으로작성하였던 LED 프로그램 C 로작성 2. 7-Segment 0~9999 까지카운팅하기 3. CLCD 의첫번째열에자기이름쓰기 4. CLCD 에 7-Segment 와같은숫자나오게하기 5. EEPROM(24C04) 을가지고 Byte Write, Page Write, Current Address Read, Random Read, Sequential Read 구현하기 (24C04 는 SD-52 보드에실장되어있음 ) 회로도보는연습을하자. 데이터쉬트보는연습을하자. 다음시간에는인터럽트와타이머를학습합니다.