User Tools

Site Tools


workshop:uart

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
workshop:uart [2012/08/13 14:32] dongheeworkshop:uart [2018/07/18 14:10] (current) – external edit 127.0.0.1
Line 3: Line 3:
    
 UART(Universal Asynchronous Receiver/Transmitter) 이름으로 알 수 있듯이 리시버와 트랜시버가 따로 존재하고  UART(Universal Asynchronous Receiver/Transmitter) 이름으로 알 수 있듯이 리시버와 트랜시버가 따로 존재하고 
-시간 클럭 정보가 없는 비동기식 이다.+시간 클럭 정보가 없는 비동기식 통신 형태를 말한다.  
 + 
 +그럼 클럭 정보 없이 데이터를 어떻게 구분할것인가 궁금할 것 이다.
  
 {{http://www.terms.co.kr/asynchronous.gif}}  {{http://www.terms.co.kr/asynchronous.gif}} 
  
-시작(start bit)과 끝(stop bit) 신호가 있고 그 사이를 일정 시간으로 잘라서 비트를 구분한다.+시작(start bit)과 끝(stop bit) 신호가 있고 그 사이를 일정 시간으로 잘라서 데이터의 비트를 구분한다.
  
-속도 설정가능하고 데이터포맷 설정이 가능하다. 종류로  RS-232, RS-422, RS-485 등이 있다.+UART는 통신의 속도가 설정가능하고 데이터의 형식(갯수) 설정이 가능하다. UART의 종류로  RS-232, RS-422, RS-485 등이 있다.
      
-컴퓨터와 RS232를 통해서 통신을 해보자. UART 디버깅 할때 유용함.+ 
 +====== 컴퓨터와 RS232 통신 ====== 
 +컴퓨터와 RS232를 통해서 통신을 해보자. 펌웨어 디버깅 할 때 유용함. 
  
 ==== Python 설치 ==== ==== Python 설치 ====
   * Python 2.7.3 http://python.org/download/   * Python 2.7.3 http://python.org/download/
   * Pyserial Win32  (pyserial-2.5.win32.exe) google에서 pyserial win32 검색   * Pyserial Win32  (pyserial-2.5.win32.exe) google에서 pyserial win32 검색
- +  * 빠른 다운로드  http://okin.cc/~donghee/hw/ 
-{{http://i.imgur.com/1wwVJ.png}}+ 
 ==== arduino code ==== ==== arduino code ====
  
Line 33: Line 38:
     value = Serial.read();     value = Serial.read();
     if (value == '1') {      if (value == '1') { 
-    digitalWrite(ledPin, HIGH);+      digitalWrite(ledPin, HIGH);
     } else {     } else {
-    digitalWrite(ledPin, LOW);+      digitalWrite(ledPin, LOW);
     }     }
   }   }
workshop/uart.1344868343.txt.gz · Last modified: 2018/07/18 14:09 (external edit)