Difference between revisions of "How to use UART for RSB-4710"

From ESS-WIKI
Jump to: navigation, search
(Created page with " == '''UART''' == The Android/Linux UART/serial port access is via the tty-devices. The tty-devices have different names depending on the UART driver on different boards...")
 
 
Line 36: Line 36:
 
| Support RS-232 and RS-485
 
| Support RS-232 and RS-485
 
|}
 
|}
 +
  
 
== '''How to Configure RS232/485 Mode''' ==
 
== '''How to Configure RS232/485 Mode''' ==
  
 
Enter U-boot interrupt mode.<br/> Connect the device to the debug port and open the debug console.<br/> Press “ctrl + c” before powering on the device. The following information should be&nbsp;displayed on the debug console:
 
Enter U-boot interrupt mode.<br/> Connect the device to the debug port and open the debug console.<br/> Press “ctrl + c” before powering on the device. The following information should be&nbsp;displayed on the debug console:
 +
<pre>Hit any key to stop autoboot: 0
 +
=> <INTERRUPT>
 +
=></pre>
 +
 +
Then input the following command to configure the UART mode.<br/> RS-485 Mode:
 +
<pre>setenv uart_mode 0x0c
 +
saveenv
 +
reset</pre>
 +
 +
RS-232 Mode:
 +
<pre>setenv uart_mode 0x00
 +
saveenv
 +
reset</pre>
  
&nbsp;
+
Note:&nbsp;<br/> The default value is RS-232.&nbsp;<br/> Cp210x supports four ports, but for RSB-4710 only ttyUSB2 and ttyUSB3 support&nbsp;RS-485 mode.<br/> In the above command “setenv uart_mode 0x0c”, 0x0c means set bit2(ttyUSB2) and&nbsp;bit3(ttyUSB3) to 1 (0 means to RS-232; 1 means to RS-485).<br/> To configure just ttyUSB2 (or ttyUSB3) to RS-485 mode, change 0x0c to 0x04 (or&nbsp;0x08).

Latest revision as of 03:59, 25 September 2024

UART

The Android/Linux UART/serial port access is via the tty-devices. The tty-devices have different names depending on the UART driver on different boards. 
RS-485 uses half-duplex communication, which means that one medium is shared for transmitting and receiving data. Therefore the system needs to control the RS- 485 transceiver transmit mode. Usually the UART RTS signal is used to switch the
transmitter on and off.

RSB-4710 UART

Com Name Device Node Remark
COM1 /dev/ttyS4 Support RS-232,no flow control
COM2 /dev/ttyS2 Debug port
COM3 /dev/ttyUSB0 Support RS-232
COM4 /dev/ttyUSB1 Support RS-232
COM5 /dev/ttyUSB2 Support RS-232 and RS-485
COM6 /dev/ttyUSB3 Support RS-232 and RS-485


How to Configure RS232/485 Mode

Enter U-boot interrupt mode.
Connect the device to the debug port and open the debug console.
Press “ctrl + c” before powering on the device. The following information should be displayed on the debug console:

Hit any key to stop autoboot: 0
=> <INTERRUPT>
=>

Then input the following command to configure the UART mode.
RS-485 Mode:

setenv uart_mode 0x0c
saveenv
reset

RS-232 Mode:

setenv uart_mode 0x00
saveenv
reset

Note: 
The default value is RS-232. 
Cp210x supports four ports, but for RSB-4710 only ttyUSB2 and ttyUSB3 support RS-485 mode.
In the above command “setenv uart_mode 0x0c”, 0x0c means set bit2(ttyUSB2) and bit3(ttyUSB3) to 1 (0 means to RS-232; 1 means to RS-485).
To configure just ttyUSB2 (or ttyUSB3) to RS-485 mode, change 0x0c to 0x04 (or 0x08).