odroid-h2:application_note:uart

Pin# Pin Label dev node Pin# Pin Label dev node
3 UART2_TXD /dev/ttyS1 8 UART1_RXD /dev/ttyS0
5 UART2_RXD 10 UART1_TXD
7 UART2_RTS 12 UART1_CTS
9 UART2_CTS 14 UART1_RTS

Wire by crossing RX and TX pins.

H2+

H2

Download fritzing
- Wiring part(H2) ☞ loopback_uart_h2.fzz
- Wiring part(H2+) ☞ h2plus_loopback_uart_h2.fzz
- ODROID-H2 part ☞ odroid-h2.fzpz
- ODROID-H2+ part ☞ odroid-h2plus.fzpz

Wire pin #3(UART2_TX) with pin #8(UART1_RX) and pin #5(UART2_RX) with pin #10(UART1_TX).

Open two terminal windows

Press Ctrl + Alt + T

Grant tty access to user

sudo usermod -aG dialout $USER
sudo reboot

Configure your tty devices

Enter these commands to set the baud rate to 9600, 8 bits, 1 stop bit, no parity

stty -F /dev/ttyS0 9600 cs8 -cstopb -parenb
stty -F /dev/ttyS1 9600 cs8 -cstopb -parenb

Read and write characters

In one terminal, read from the ttyS0 with this command.

cat /dev/ttyS0

In the other terminal, write to the ttyS1 with this command.

echo "123" > /dev/ttyS1

RTS (Request To Send): OUTPUT
CTS (Clear To Send): INPUT

The RTS pins operate as active low. If you set the RTS to HIGH, it is 0V, if you set it to LOW, it is 3.3V.

import serial
 
# '/dev/ttyS0' or '/dev/ttyS1'
uart = '/dev/ttyS0'
 
ser = serial.Serial(uart, 9600)
 
ser.setRTS(1)
import serial
 
# '/dev/ttyS0' or '/dev/ttyS1'
uart = '/dev/ttyS0'
 
ser = serial.Serial(uart, 9600)
 
ser.getCTS()

The Oscilloscope shows the RTS toggling speed. Its toggling frequency is around 43.5kHz

  • odroid-h2/application_note/uart.txt
  • Last modified: 2020/06/12 17:09
  • by neal