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

Similar documents
SRC PLUS 제어기 MANUAL

K&R2 Reference Manual 번역본

[8051] 강의자료.PDF

untitled

1

CANTUS Evaluation Board Ap. Note

hd1300_k_v1r2_Final_.PDF

Microsoft Word - FS_ZigBee_Manual_V1.3.docx

AN_0005B_UART

T100MD+

PowerPoint 프레젠테이션

untitled

<4D F736F F F696E74202D20B8B6C0CCC5A9B7CEC7C1B7CEBCBCBCAD202839C1D6C2F7207E203135C1D6C2F >

untitled

PowerPoint 프레젠테이션

슬라이드 1

한글사용설명서

Microsoft PowerPoint - polling.pptx

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

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

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션

<4D F736F F F696E74202D20BBB7BBB7C7D15F FBEDFB0A3B1B3C0B05FC1A636C0CFC2F72E BC8A3C8AF20B8F0B5E55D>

untitled

PowerPoint 프레젠테이션

<4D F736F F F696E74202D20B8B6C0CCC5A9B7CEC7C1B7CEBCBCBCAD202834C1D6C2F7207E2038C1D6C2F729>

03장.스택.key

untitled

6주차.key

UART.h #ifndef _UART_H_ #define _UART_H_ #define DIR_TXD #define DIR_RXD sbi(portd,4) cbi(portd,4) #define CPU_CLOCK_HZ UL UART PORT1 void UAR

5.스택(강의자료).key

C프로-3장c03逞풚

MicrocontrollerAcademy_Lab_ST_040709

<4D F736F F F696E74202D20BBB7BBB7C7D15F FBEDFB0A3B1B3C0B05FC1A638C0CFC2F72E BC8A3C8AF20B8F0B5E55D>

-. Data Field 의, 개수, data 등으로구성되며, 각 에따라구성이달라집니다. -. Data 모든 의 data는 2byte로구성됩니다. Data Type는 Integer, Float형에따라다르게처리됩니다. ( 부호가없는 data 0~65535 까지부호가있는

chap7.key

CPX-E-PB_BES_C_ _ k1

歯9장.PDF


商用

lecture4(6.범용IO).hwp

C++-¿Ïº®Çؼ³10Àå

Poison null byte Excuse the ads! We need some help to keep our site up. List 1 Conditions 2 Exploit plan 2.1 chunksize(p)!= prev_size (next_chunk(p) 3

Microsoft PowerPoint - lab14.pptx

KEY 디바이스 드라이버

PowerPoint 프레젠테이션

untitled

제품소개 MODBUS Tester 는 MODBUS 프로토콜을사용하는산업장비테스트및점검하기위해 PC 를휴대및설치할필요없이쉽고빠르게장비와연결하여원하는작업을진행할수있도록휴대성을강조한 MODBUS 프로토콜테스트장치입니다. MODBUS Tester 에는 3 가지의기능이지원되며,

untitled

Motor

untitled

BMP 파일 처리

bn2019_2

Smart Power Scope Release Informations.pages

슬라이드 1

PowerPoint Presentation


PowerPoint 프레젠테이션

< E20C6DFBFFEBEEE20C0DBBCBAC0BB20C0A7C7D12043BEF0BEEE20492E707074>

0.1-6

MODBUS SERVO DRIVER( FDA7000 Series ) STANDARD PROTOCOL (Ver 1.00) 1

MR-3000A-MAN.hwp

[ 융합과학 ] 과학고 R&E 결과보고서 뇌파를이용한곤충제어 연구기간 : ~ 연구책임자 : 최홍수 ( 대구경북과학기술원 ) 지도교사 : 박경희 ( 부산일과학고 ) 참여학생 : 김남호 ( 부산일과학고 ) 안진웅 ( 부산일과학고 )

MPLAB C18 C

<443A5C4C C4B48555C B3E25C32C7D0B1E25CBCB3B0E8C7C1B7CEC1A7C6AE425CBED0C3E0C7C1B7CEB1D7B7A55C D616E2E637070>

. PC DP-1VR P15 1ch 1 Input Tool 4ch RS-232C RS-232C. Input Tool P14 MUX-10F P16 MeasureReport P21 GO/NG 2 MeasurLink Real-Time P19 MeasurLink STATMea

13주-14주proc.PDF

본 강의에 들어가기 전

hlogin2

0. 표지에이름과학번을적으시오. (6) 1. 변수 x, y 가 integer type 이라가정하고다음빈칸에 x 와 y 의계산결과값을적으시오. (5) x = (3 + 7) * 6; x = 60 x = (12 + 6) / 2 * 3; x = 27 x = 3 * (8 / 4

(SW3704) Gingerbread Source Build & Working Guide

105È£4fš

untitled

Chapter_06

chap8.PDF

LCD Display

Microsoft PowerPoint - AVR 시리얼 통신.ppt [호환 모드]


Microsoft PowerPoint - es-arduino-lecture-03

PowerPoint 프레젠테이션

PRO1_16E [읽기 전용]

강의10

歯FDA6000COP.PDF

歯설명서_020925_.PDF

고급 프로그래밍 설계

슬라이드 제목 없음

Microsoft PowerPoint - 9.Serial.pptx

<4D F736F F F696E74202D20B8B6C0CCC5A9B7CEC7C1B7CEBCBCBCAD202834C1D6C2F7207E2038C1D6C2F729>

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


<C3CA3520B0FAC7D0B1B3BBE7BFEB202E687770>

Mango-E-Toi Board Developer Manual

Line (A) å j a k= i k #define max(a, b) (((a) >= (b))? (a) : (b)) long MaxSubseqSum0(int A[], unsigned Left, unsigned Right) { int Center, i; long Max

3. 1 포인터란 3. 2 포인터변수의선언과사용 3. 3 다차원포인터변수의선언과사용 3. 4 주소의가감산 3. 5 함수포인터

BJFHOMINQJPS.hwp

2009년2학기 임베디드시스템 응용

À©µµ³×Æ®¿÷ÇÁ·Î±×·¡¹Ö4Àå_ÃÖÁ¾

PowerPoint 프레젠테이션

5 167 Python Jon Franklin Python Python Python Python USB USB RS485 C Python DLL Python Python dll Python Python ctypes dll ctypes Python C Linux Wind

Transcription:

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

UART (Univ ers al As y nchronous Receiver / T rans mitter) 8250A 8250A { COM1(3F8H). - Line Control Register : (data,stop bit, parity bit ) 3FBH - Line Status Register : 3FDH - Modem Control Register : 3FCH - Modem Status Register : 3FEH (CT S(Clear T o Send), DSR(Data Set Ready)line report - Baud Rate Generator : Baud Rate - Interrupt Enable Register : 8250A 4 3F9H - Interrupt ID Register : 3FAH - Receiver Buffer Register : 3F8H - T ransmitter Holding Register : " - 2 -

8250A Base Address - 3 -

EIA RS 232C 25pin 9pin ( ) - 4 -

* Polling, - Polling. F1 ~ F2 ~ F3 ~ F4 ~ F5 ~ Polling #include <stdio.h> #include <conio.h> #include <dos.h> #define COM_PORT 1 /* COM2 */ #define LF 0x0a #define CR 0x0d #define ESC 27 char status_ah; /* Line Status */ char status_al; /* Modem Status */ void init_serial(int port, unsigned char code) /* open com port*/ { union REGS r; r.x.dx = port; r.h.ah = 0; r.h.al = code; /* initialization code ---> main( ) */ int86(0x14, &r, &r); /* ROM BIOS INT 14H call. */ - 5 -

void check_rx(int port) { union REGS r; void r.x.dx = port; r.h.ah = 3; /* function 03H(Status Read) */ int86(0x14, &r, &r); /* BIOS INT 14H */ status_ah=r.h.ah; /* Line Status */ status_al=r.h.al; /* Modem Status */ menu(void) { int i; void clrscr(); window(1,1,80,7); clrscr(); for (i=0;i<80;i++) printf("="); printf("\t F1 = Serial Port Initialization \n"); printf("\t F2 = Line and Modem Status printf("\t F3 = Transmission Mode Set printf("\t F4 = Receiver Mode Set printf("\t F5 = Tx/Rx Polling Mode Set for (i=0;i<80;i++) printf("="); win(void) { int i; void for (i=0;i<80;i++) printf("="); window(1,10,80,25); clrscr(); tx_char(int port, char ch) { union REGS r; \n"); \n"); \n"); \n"); do { check_rx(com_port); /* Status Checking */ while(!(status_ah & 0x60));/* LSR and THR register empty? */ r.x.dx = port; r.h.ah = 1; r.h.al = ch; /* */ /* */ /* */ 0 1 1 0 * * * * - - - - - - - - - - - - - - - - - - - - T ransmitter Break Error Rx 0 Empty Detect Ready T ransmitter Buffer Empty int86(0x14, &r, &r); /* INT 14h for Transmission of 1 char. */ - 6 -

void tx(void) { char ch; while(1) { textattr(7); if(kbhit()) /* Transmission Request */ { ch=getch(); switch(ch) { case ESC : return; case CR : putch(cr); putch(lf); tx_char(com_port, CR); tx_char(com_port, LF); default : putch(ch); tx_char(com_port, ch); char rx_char(int port) { union REGS r; char ch; check_rx(com_port); /* Status Checking */ if(status_ah & 0x01) { r.x.dx=port; r.h.ah=2; int86(0x14, &r, &r); return r.h.al; /* Rx Data return */ else return 0x00; /* Data Empty */ void rx(void) { char ch; while(1) { textattr(7); if(kbhit()) { ch=getch(); - 7 -

if(ch==esc) return; else { ch=rx_char(com_port); if(ch!=0) { textattr(7<<4); /* Reversed Text Attribute */ putch(ch); /* Received Data */ textattr(7); /* Original Text Attribute */ void polling(void) { char ch; while(1) { textattr(7); if(kbhit()) /* Transmission Request */ { ch=getch(); switch(ch) { case ESC : return; case CR : tx_char(com_port, ch); tx_char(com_port, LF); putch(ch); putch(lf); default : tx_char(com_port, ch); putch(ch); else /* Receive Request */ { ch=rx_char(com_port); /* Data Receive */ if(ch!=0) { textattr(7<<4); /* Reversed Text */ putch(ch); /* Data Received */ textattr(7); /* Original Text Attribute */ - 8 -

void main(void) { union REGS r; char textattr(7); menu(); i, ch, fch, fkey=0; window(1,8,80,9); clrscr(); printf(" Function Key? (F1/F2/F3/F4/F5) "); while(1) { if (kbhit()) { ch=getch(); if (ch==0) { fch=getch(); /* function key input */ fkey=1; /* function key inputed */ window(1,8,80,9); clrscr(); printf(" Current Function : "); switch(fch) 1 1 1 0 0 1 1 1 - - - - - - - - - - - - - - - - - - - - - Baud stop rate ( ) bit (9600) (2) (8 ) { case 0x3b :/* F1 = serial port initialization */ init_serial(com_port, 0xe7); printf("serial Port Initialization \n"); win(); case 0x3c : /* F2 = Line and Modem Status */ check_rx(com_port); printf("line Status = %x H", status_ah); printf("\t Modem Status = %x H \n", status_al); win(); case 0x3d :/* F3 = Transmission Mode */ printf("transmission Mode \n"); win(); tx(); case 0x3e : /* F4 = Receiver Mode */ printf("receiver Mode win(); \n"); - 9 -

rx(); case 0x3f : /* F5 = Polling Function Input */ printf("tx/rx Polling Mode \n"); win(); polling(); default : /* Unknown Function Input */ printf("unknown Fuction \n"); win(); else /* not input function key */ { if (fkey==1) /* inputed function key */ { switch(ch) { case ESC : return; case CR : putch(lf); putch(cr); default : putch(ch); * Polling * (F1)/ (F2)/ (F3)/ (F4)/ ( )(F5) * * ESC Function ESC. - 10 -

MS- DOS MS- DOS BI OS - - - - - > I O. SYS :, SYSI NT MS- DOS ker nel - - - > MSDOS. SYS : I NT21H, C i nt dos( ), i nt dosx( ) MS- DOS Shel l - - - - > command. com :, bat ch f i l e &, rout i ne :. rout i ne :. CALL. [ ] r eg. h. ah = 0x30 ; f unct i on 30H i nt 86( 0x14, &r eg, &r eg) ; - - - - > ml = r eg. h. al ; mh = r eg. h. ah ; i nt dos( ), i nt 86( ), i nt 86x( ) cal l f unct i on. - - - - > dos. h st r uct ur e uni on SREGS : uni on REGS : dos. h. - 11 -