Difference between revisions of "Template:2-CH UART TO ETH Spec"

From Waveshare Wiki
Jump to: navigation, search
(Created page with "==Features== *Embedded Ethernet MAC and PHY layers *Bi-direction transparent data transmission between UART and Ethernet *10/100M, full-duplex/half-duplex auto-negotiation Eth...")
 
 
Line 67: Line 67:
 
*Clearing buffer: Never
 
*Clearing buffer: Never
  
<!--
 
 
==TCP CLIENT==
 
==TCP CLIENT==
1、Use the SSCOM software, set the protocol mode as TCPServer, and check the Target IPand Target port as the picture below.<br />
+
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)<br />
[[File:SSCOM-1.jpg|700px]]<br />
+
[[File:SSCOM-1.jpg|800px]]<br />
2、Run the NetModuleConfig.exe to configure the module as below:<br />
+
2. Run NetModuleConfig.exe to set the module parameters, as follows:<br />
(1).点击“搜索设备”,设备列表会显示出子网内模块;<br />
+
(1). Click "Search Device", the device list will show the modules in the subnet;<br />
(2).双击设备列表里面的模块,在左侧修改参数,然后点击“配置设备参数”;<br />
+
(2). Double-click the module in the device list, modify the parameters on the left, and then click "Configure Device Parameters";<br />
(3).配置完成后,模块会重启,稍等一会,点击 “搜索设备”,找到模块,查看配置结果。<br />
+
(3). After the configuration is completed, the module will restart, wait a while, click "Search Device", find the module, and view the configuration result. <br />
(4).根据实际需求修改模块参数,例如:设置网络方式为 TCP CLIENT,目的 IP,目的端口与 TCP SERVER <br />
+
(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<br />
IP 和端口一致,再根据需求修改波特率等参数。然后点击配置设备参数。<br />
+
The IP and port are the same, and then modify the baud rate and other parameters as required. Then click Configure Device Parameters. <br />
 
[[File:NetModuleConfig-1.jpg|800px]]<br />
 
[[File:NetModuleConfig-1.jpg|800px]]<br />
3、配置完之后,点击SSCOM的侦听,就连接起来了。<br />
+
3. After the configuration is complete, click on SSCOM to connect to it. <br />
 
[[File:SSCOM-2.jpg|800px]]<br />
 
[[File:SSCOM-2.jpg|800px]]<br />
 
==TCP SERVER==
 
==TCP SERVER==
1、运行NetModuleConfig.exe设置模块参数,如下操作:<br />
+
1. Run NetModuleConfig.exe to set the module parameters, as follows:<br />
(1).点击“搜索设备”,设备列表会显示出子网内模块;<br />
+
(1). Click "Search Device", the device list will show the modules in the subnet;<br />
(2).双击设备列表里面的模块,在左侧修改网络模式为TCPServre,再根据需求修改模块参数,最后点击“配置设备参数”;<br />
+
(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";<br />
 
[[File:NetModuleConfig-2.jpg|800px]]<br />
 
[[File:NetModuleConfig-2.jpg|800px]]<br />
2、通过SSCOM去连接配置成TCP SERVER的模块,连接起来会如下图显示:<br />
+
2. Connect to the module configured as TCP SERVER through SSCOM, the connection will be shown as follows:<br />
 
[[File:SSCOM-3.jpg|800px]]<br />
 
[[File:SSCOM-3.jpg|800px]]<br />
 
==UDP CLIENT/SERVER==
 
==UDP CLIENT/SERVER==
1、运行NetModuleConfig.exe设置模块参数,如下操作:<br />
+
1. Run NetModuleConfig.exe to set the module parameters, as follows:<br />
(1).点击“搜索设备”,设备列表会显示出子网内模块;<br />
+
(1). Click "Search Device", the device list will show the modules in the subnet;<br />
(2).双击设备列表里面的模块,在左侧修改网络模式为UDP CLIENT/Servre,再根据需求修改模块参数,最后点击“配置设备参数”;<br />
+
(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";<br />
 
[[File:NetModuleConfig-3.jpg|800px]]<br />
 
[[File:NetModuleConfig-3.jpg|800px]]<br />
2、通过SSCOM去连接配置成UDP CLIENT/Servre的模块(SSCOM的UDP模式会自动连接,不管你的模式配置成CLIENT/Servre),连接起来会如下图显示:<br />
+
2. Connect the module configured as UDP CLIENT/Servre through SSCOM (the UDP mode of SSCOM will automatically connect, no matter your mode is configured as CLIENT/Servre), the connection will be shown as follows:<br />
 
[[File:SSCOM-4.jpg|800px]]<br />
 
[[File:SSCOM-4.jpg|800px]]<br />
-->
 

Latest revision as of 07:29, 16 September 2021

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 a network serial port transparent transmission chip, which can realize the two-way transparent transmission of serial data and network data. It supports 4 working modes of TCP CLIENT/SERVER, UDP CLIENT/SERVER, and the serial port baud rate support range is 300bps~921600bps, which needs to be configured before use. The host computer software NetModuleConfig.exe or serial command configures the network parameters and serial parameters of the chip. After the configuration is completed, CH9121 will saves the configuration 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", 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 your mode is configured as CLIENT/Servre), the connection will be shown as follows:
SSCOM-4.jpg