Description
CH9121 Ethernet Serial Port Server Serial Port to Ethernet Adapter Single Chip Microcomputer Networking Module
Product Description
CH9121 serial port to Ethernet module is equipped with CH 19121 network serial port transparent transmission chip. CH9121 integrates TCP/IP protocol stack, which can realize two-way transparent transmission of network data packets and serial data. It has 4 working modes: TCP CL lIENT, TCP SERVER, UDPCL .IENT, UDP SERVER, and the serial port baud rate can support up to 921600bps , It can be easily configured through host computer software or serial port commands, which is convenient and quick.
Specification
1
|
Built-in Ethernet media transport layer (MAC) and physical layer (PHY)
|
2
|
Realize two-way transparent transmission of serial data and network data
|
3
|
Support 10/100M, full duplex/half duplex adaptive Ethernet interface, compatible with 802.3 protocol
|
4
|
Support MDI/MDIX line automatic conversion
|
5
|
Support DHCP to obtain IP address automatically, support DNS domain name access
|
6
|
Set the chip working mode, port, IP and other network parameters through the host computer software/serial AT command
|
7
|
Working mode supports TCP CL .IENT, TCP SERVER and UDP CL IENT, UDP SERVER 4 modes
|
8
|
Serial port baud rate supports 300bps ~ 921600bps
|
9
|
String OTTL level, compatible with 3.3V and 5V
|
10
|
The serial port supports full-duplex and half-duplex serial communication, supports automatic switching of RS485 transceiver
|
11
|
Support 0~2000ms serial timeout time setting
|
12
|
Support 0~2000ms serial timeout time setting
|
13
|
Support DNS domain name system
|
14
|
Support KEEPAL IVE mechanism
|
15
|
Supply voltage: 3.3V/5V
|
Installation Instructions
Pin name
|
Types
|
Pin description
|
RESET
|
Input
|
Restore factory settings, chip power-on detection, active low
|
RSTI
|
Input
|
External reset input, active low
|
DIR
|
Output
|
Used to control RS485 transceiver switch
|
CFG
|
Input
|
Serial port configuration mode setting pin, built-in pull-up, when low level is detected, enter the serial port configuration mode, high level to exit the configuration mode
|
TCPS
|
Output
|
In TCP client mode, the port connection status indicator pin, the connection is successful, output low level
|
RXD
|
Input
|
UART data input, connect to TXD of external MCU
|
GUN
|
Output
|
Module running status indicator pin, output 2Hz square wave
|
TXD
|
Output
|
UART data output, connect to RXD of external MCU
|
GND
|
Power supply
|
Power ground
|
3V3
|
Power supply
|
3.3V power supply, choose one from 5V power supply
|
5V
|
Power supply
|
5V power supply, or 3.3V power supply, choose one
|
Module configuration and working mode description
Module parameter configuration is divided into two parts: basic setting and port configuration. The basic configuration mainly includes the device name, network parameters, and serial port negotiation and authentication functions. The serial port negotiation authentication function is turned off by default. By default, the serial port setting mode is entered through the hardware CFG0 pin. After it is turned on, the serial port setting mode can be entered through the serial port negotiation. CH9121 supports DHCP and manual setting of basic network parameters. TCP CLIENT mode In TCPCLIENT mode, after the module is powered on, it will actively connect to the TCP SERVER end. After the connection is established, two-way transparent transmission of network data and serial data can be realized. In this mode, the IP of the TCP SERVER needs to be visible to the module. The visible meaning means that the server IP can be directly pinged through the IP of the module (see section 4 for details). In TCP CLIENT mode, it supports random local ports and access to remote service areas through domain names. The internal TCP underlying Keep Alive keep-alive mechanism is enabled by default inside the chip, which can detect device disconnection. The TCP client application model is as follows, which is suitable for field data collection and upload server mode.
TCP SERVER mode In TCP SERVER mode, after the module is powered on, it will monitor whether there is a client request connection on the local port. After the connection is established, two-way transparent transmission of network data and serial data can be realized. In this mode, the IP of TCP CLIENT needs to be visible to the module, and the visible meaning means that the module IP can be directly pinged through the client IP (see section 4 for details). The network parameters that the module needs to configure are: working mode, device IP, subnet mask, default gateway, and device port. The destination IP, destination port, and this mode can only support one TCP client connection at the same time. UDP CLIENT mode In UDP CLIENT mode, after the module is powered on, the data sent to the local port (from the destination IP and port) will be transparently forwarded to the module serial port. Similarly, the data sent to the module serial port will also be forwarded to the setting via UDP The destination IP and port. In this mode, the network parameters that the module needs to configure are: working mode, device IP, subnet mask, default gateway, device port, destination IP, and destination port. UDP SERVER mode In UDP SERVER mode, all data sent to the local IP and port are received and forwarded to the serial port. The data sent to the module serial port will also be forwarded to the IP and port of the UDP communicating with it through UDP. In this mode, the network parameters that the module needs to configure are: working mode, device IP, subnet mask, default gateway, and device port. Configuration software instructions and examples The CH9121 module supports the setting of chip working mode, port, IP and other parameters through the host computer software/serial AT command. Here, using the host computer software to set the chip to "TCPCLIENT mode", and the computer as the TCP Server for TCP communication as an example, the steps as follows: Reminder: It is recommended to turn off anti-virus software, 360 security guards and other firewall software before testing
Wiring: Prepare a TTL serial port module (such as CH340/FT232, etc.) and a network cable, and connect the CH9121 module to the host computer and the router. The connection method of the serial port module is as follows:
CH9121 module
|
TTL serial port module
|
5V/3.3V
|
5V/3.3V
|
GND
|
GND
|
TXD
|
RXD
|
RXD
|
TXD
|
Details Images