Template: 2-CH UART TO ETH Spec

From Waveshare Wiki
Jump to: navigation, search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Features

  • Embedded Ethernet MAC and PHY layers.
  • Bi-direction transparent data transmission between UART and Ethernet.
  • 10/100M, full-duplex/half-duplex auto-negotiation Ethernet interface, 802.3-compliant.
  • Auto-MDI/MDIX, detect and switch cable type automatically.
  • Supports DHCP auto-obtained IP and DNS domain access.
  • Network parameter configuration like chip operating mode, port, IP, via host computer software or UART command.
  • Four operating modes: TCP CLIENT, TCP SERVER, UDP CLIENT, UDP SERVER.
  • 2-CH UART concurrent operation, standalone transparent transmission for each channel.
  • Full-duplex or half-duplex UART communication supports RS485 RX/TX auto switch.
  • Supports virtual serial port software (provided).
  • KEEPALIVE mechanism support.

Specifications

  • Operating voltage: 3.3V/5V
  • Operating current: 140mA
  • Operating mode: TCP/UDP
  • UART baud rate: 300bps ~ 921.6Kbps
  • UART TTL level: 3.3V/5V compatible
  • Storage temperature: -55°C ~ 125°C
  • Operating temperature: -40°C ~ 85°C
  • Dimensions: 53.00 x 22.00mm

Pinout

2-CH-UART-TO-ETH-4.jpg
5V/3V3 power positive, use any pin of 5V/3.3V pins for power supply
GND ground
RST1 external reset input, low active
RESET restore to factory setting, detected when chip power on, low active
TXD1 asynchronous UART 1 data output (enabled by default)
TXD2 asynchronous UART 2 data output (disabled by default)
RXD1 asynchronous UART 1 data input (enabled by default)
RXD2 asynchronous UART 2 data input (disabled by default)
CFG0 UART config mode, low level to enter configuration, high level to exit configuration
RUN Operating status indicating pin
DIR1 UART 1 RS485 RX/TX switch (connects to external RS485 controller)
DIR2 UART 2 RS485 RX/TX switch (connects to external RS485 controller)

CH9121

CH9121 is the chip for network serial port transparent transmission, which can realize the two-way transparent transmission of serial data and network data. It supports 4 working modes such as TCP CLIENT, SERVER, UDP CLIENT, and SERVER, and the serial port baud rate is 300bps~921600bps. Before use, it is necessary to configure the network parameters and serial port parameters of the chip through the host computer software NetModuleConfig.exe or serial commands. After the configuration is completed, CH9121 will save the parameters to the internal storage space. After the chip is reset, CH9121 will work according to the saved configuration values.

Default configuration

The UART2 is disabled, UART1 works in TCP CLIENT mode by default. The default setting of ETH is as below:

  • Device IP: 192.168.1.200
  • Subnet Mask: 255.255.255.0
  • Gateway: 192.168.1.1
  • Device Port: 2000
  • Target IP: 192.168.1.100
  • Target port: 1000

The default setting of the UART1 is as below:

  • Baud rate: 9600
  • Timeout: 0
  • data bit: 8
  • Stop bit: 1
  • Parity: None
  • Clearing buffer: Never

TCP CLIENT

1. Select SSCOM to select the protocol type as TCPServre, and then view the target IP and target port number through SSCOM (that is, 1 and 2 in the figure).
SSCOM-1.jpg
2. Run NetModuleConfig.exe to set the module parameters, as follows:
(1) Click "Search Device", and the device list will show the modules in the subnet;
(2) Double-click the module in the device list, modify the parameters on the left, and then click "Configure Device Parameters";
(3) After the configuration is completed, the module will restart, wait a while, click "Search Device", find the module, and view the configuration result.
(4) Modify the module parameters according to actual needs, for example: set the network mode to TCP CLIENT, destination IP, destination port, and TCP SERVER.
The IP and port are the same, and then modify the baud rate and other parameters as required. Then click Configure Device Parameters.
NetModuleConfig-1.jpg
3. After the configuration is complete, click on SSCOM to connect to it.
SSCOM-2.jpg

TCP SERVER

1. Run NetModuleConfig.exe to set the module parameters, as follows:
(1) Click "Search Device", the device list will show the modules in the subnet;
(2) Double-click the module in the device list, modify the network mode to TCPServre on the left, then modify the module parameters as required, and finally click "Configure Device Parameters".
NetModuleConfig-2.jpg
2. Connect to the module configured as TCP SERVER through SSCOM, the connection will be shown as follows:
SSCOM-3.jpg

UDP CLIENT/SERVER

1. Run NetModuleConfig.exe to set the module parameters, as follows:
(1) Click "Search Device", the device list will show the modules in the subnet;
(2) Double-click the module in the device list, modify the network mode to UDP CLIENT/Servre on the left, then modify the module parameters as required, and finally click "Configure Device Parameters".
NetModuleConfig-3.jpg
2. Connect the module configured as UDP CLIENT/Servre through SSCOM (the UDP mode of SSCOM will automatically connect, no matter if your mode is configured as CLIENT/Servre), the connection will be shown as follows:
SSCOM-4.jpg