Cermetek CH232BGN User manual

Cermetek Microelectronics, Inc Page 1 of 42 Document NO. 607-00xx Revision A (12/13)
CH232BGN
Embedded WiFi Module
User Manual

Cermetek Microelectronics, Inc Page 2 of 42 Document NO. 607-00xx Revision A (12/13)
Table of Contents
1 PRODUCT OVERVIEW 3
1.1 GENERAL SPECIFICATIONS 3
1.2 HARDWARE INTRODUCTION 4
1.3 HARDWARE REFERENCE DESIGN 8
1.4 SOFTWARE REFERENCE DESIGN 11
2 FUNCTIONAL DESCRIPTION 14
2.1 WIRELESS NETWORKING 14
2.2 AUTO-FREQUENCY FUNCTION 16
2.3 SECURITY 16
2.4 UART FRAME SCHEME 17
2.5 ADDRESS BINDING 17
2.6 ETHERNET INTERFACE COMMUNICATIONS 17
2.7 WIRELESS DISTRIBUTION SYSTEM (WDS) 19
2.8 SEARCH FUNCTION FOR STATION 19
2.9 WORK MODE 20
2.10 PARAMETERS CONFIGURATION 20
3 ONLINE CONFIGURATION 21
3.1 WEB MANAGEMENT INTERFACE 21
3.2 MODE SELECTION PAGE 21
3.3 ACCESS POINT INTERFACE CONFIGURATION PAGE 22
3.4 STATION INTERFACE CONFIGURATION PAGE 22
3.5 UART CONFIGURATION PAGE 23
3.6 ACCOUNT CONFIGURATION PAGE 24
4 AT+ COMMAND INTRODUCTION 25
4.1 CONFIGURATION MODE 25
4.2 AT+ COMMANDS 25
APPENDIX A EVALUATION BOARD REFERENCE DESIGN 42
APPENDIX B EXTERNAL POWER SHUTDOWN MODE REFERENCE DESIGN 43
CONTACT INFORMATION 44

Cermetek Microelectronics, Inc Page 3 of 42 Document NO. 607-00xx Revision A (12/13)
1.PRODUCT OVERVIEW
1.1. General Specifications
Table 1: CH232BGN Technical Specifications
Class
Item
Parameters
Wireless
Parameters
Certification
FCC/CE
Wireless standard
802.11 b/g/n
Frequency range
2.412GHz-2.484GHz
Transmit Power
802.11b: +20 dBm (Max.)
802.11g: +18 dBm (Max.)
802.11n: +15 dBm (Max.)
Configurable
Receiver Sensitivity
802.11b: -89 dBm
802.11g: -81dBm
802.11n: -71dBm
Antenna Option
External:I-PEX Connector (Thru-hole)
Internal:On-board chip antenna
Hardware
Parameters
Data Interface
UART: 1200bps - 230400bps
GPIOs
Ethernet: 100Mpbs
Operating Voltage
3.3V (+/-5%)
Operating Current
170mA~300mA
Operating Temperature
-25˚ C - 85 ˚ C
Storage Temperature
-40 ˚ C - 100 ˚ C
Dimensions and Size
25×40×8mm
Software
Parameters
Network Type
Station /Access Point mode/STA+AP
Security Mechanisms
WEP/WAP-PSK/WAP2-PSK/WAPI
Encryption
WEP64/WEP128/TKIP/AES
Work Mode
Transparent Transmission
Serial command
AT+ Command set
Network Protocol
TCP/UDP/ARP/ICMP/DHCP/DNS/HTTP
Max. TCP Connection
32
User Configuration
Web Server or AT+ command
configuration.

Cermetek Microelectronics, Inc Page 4 of 42 Document NO. 607-00xx Revision A (12/13)
1.2. Hardware Introduction
1.2.1. CH232BGN Pin Definitions
Figure 1: CH232BGN Pin Assignments

Cermetek Microelectronics, Inc Page 5 of 42 Document NO. 607-00xx Revision A (12/13)
Table 2: CH232BGN Pin Descriptions
Pin
Description
Name
Direction
Notes
1,2
VCC
3.5V
Power
3.3V maximum 350 mA
power input
3
Ground
GND
Power
Ground
4
UART Receive Data
UART_RXD
Output
If the UART is not used this
pin can serve as a general
purpose I/O
General Purpose I/O
GPIO3
Input/Output
5
UART Transmit Data
UART_TXD
Input
If the UART is not used this
pin can serve as a general
purpose I/O
General Purpose I/O
GPIO4
Input/Output
6
UART Clear to Send
UART_CTS
Output
If the UART is not used this
pin can serve as a general
purpose I/O
General Purpose I/O
GPIO5
Input/Output
7
UART Request to Send
UART_RTS
Input
If the UART is not used this
pin can serve as a general
purpose I/O
General Purpose I/O
GPIO6
Input/Output
8
Ethernet Transmit +
PHY_TX+
Output
1.8 Volt Ethernet Data I/F
9
Ethernet Transmit -
PHY_TX-
Output
1.8 Volt Ethernet Data I/F
10
Ethernet Receive +
PHY_RX+
Input
1.8 Volt Ethernet Data I/F
11
Ethernet Receive -
PHY_RX-
Input
1.8 Volt Ethernet Data I/F
12, 13
No Connection
NC
NC
Do not Connect
14
WiFi Status Indicator
Nlink
Output
High –WiFi Link available
Low –No WiFi Link
15
Reset
nRST
Input
Active low; must be held for a
minimum of 300 msec
16
Boot Status
nReady
Output
Active low boot sequence
complete; a high indicates
boot in progress
17
Restore Factory Defaults
nReload
Input
Holding this pin low for more
than 1 second resets the
configuration to the factory
defaults
18,19,
20
Ground
GND
Power
Ground
21, 22
No Connection
NC
NC
Do not Connect
23
1.8 Volt Output
1.8V
Output
1.8V 300 mA power for
Ethernet connection
24
Ground
GND
Power
Ground
25
Antenna Connection
ANT
Output
50 ohm impedance for
antenna connection
26
Ground
GND
Power
Ground

Cermetek Microelectronics, Inc Page 6 of 42 Document NO. 607-00xx Revision A (12/13)
1.2.2. CH232BGN Mechanical Dimensions
Figure 2: CH232BGN Mechanical Dimensions
1.2.3. On-board Chip Antenna
The CH232BGN supports a built-in antenna option. When the customer chooses to utilize a built-
in antenna, the customer circuit board must comply with the following rules:
The antenna may not be located in the (6X8MM) red region, see Figure 3 below.
The antenna must located away from any metal or any components taller than 10MM;
The antenna cannot be shielded by any meal enclosure. Any cover or enclosure must be at
least 10MM from the antenna.
Figure 3: CH232BGN Circuit Board
We recommend that the CH232BGN module be placed in a corner of the user’s circuit board.
This location provides optimal placement for antenna efficiency and helps to isolate the module
from other circuits.

Cermetek Microelectronics, Inc Page 7 of 42 Document NO. 607-00xx Revision A (12/13)
1.2.4. External Antenna
CH232BGN modules support internal antenna and external antenna options. If user selects to use an
external antenna, CH232BGN modules must be connected to the 2.4G antenna according to IEEE
802.11b/g/n standards. The antenna parameters required as follows:
Table 3: CH232BGN External Antenna Parameters
1.2.5. Evaluation Kit
An evaluation kit is available to assist users develop their applications. The evaluation kit, shown
below, allows the user to connect the CH232BGN module directly to an RS-232 port, 100Base-T
Ethernet port or Wireless port.
Figure 4: CH232BGN Evaluation Kit
Item
Parameters
Frequency range
2.4~2.5GHz
Impedance
50 Ohm
VSWR
2 (Max)
Return Loss
-10dB (Max)
Connector Type
I-PEX or populate directly

Cermetek Microelectronics, Inc Page 8 of 42 Document NO. 607-00xx Revision A (12/13)
Table 4: Evaluation Kit Interface Description:
1.3. Hardware Reference Design
1.3.1. Hardware Typical Application
Figure 5: CH232BGN Hardware Typical Application
Notes:nRST is an active low input serving as the CH232BGN hardware reset signal. The signal
includes a 100K Ohm pull-up resister. This signal must be asserted for at least 300
milliseconds when power is initially applied to the module.
nReady is an active low output that signals that the module has completed its initial boot
sequence and is ready for use. This signal includes an internal 4.7K Ohm pull-up resister.
The module provides a low output or a square wave output after normal boot up.
Function
Name
Description
External
Interface
DB9
Male 9pin serial jack
RJ-45
100M Eth Interface
Mini USB
B-type interface,AS 5v@1A power input port
Module
2x7 2mm DIP connector
LED
Power (Red)
3.3V Power Indicator
CTS (Green 1)
CTS/GPIO Indicator
RTS (Green 2)
RTS/GPIO Indicator
Reload (Green 3)
nReload/GPIO Indicator
Ready(Green 4)
nReady/GPIO Indicator
Link(Green 5)
NLink/GPIO Indicator
Button
Reset
Used to reset the module.
Reload
Module restored to factory default configuration.

Cermetek Microelectronics, Inc Page 9 of 42 Document NO. 607-00xx Revision A (12/13)
nLink is an active low output that indicates a WiFi link is established. There is an internal
4.7K Ohm pull-up resister on this signal.
nReload is an active low input. When activated for more than three (3) seconds, it causes the
module to reset the internal configuration to factory defaults. A 4.7K pull up resistor must be
installed at the nReload pin.
UART_TXD/RXD signals provide the pathway for serial data to and from the UART; transmit
data (TXD) and received data (RXD). These signals include a 1L ohm pull-up resistor.
1.3.2. 10/100M Ethernet Interface
The CH232BGN provides one 10/100M Ethernet PHY layer interface for data transfer or user
configuration. The User circuit board must include an Ethernet transformer and RJ-45 connector. This
creates a standard 10/100M Ethernet physical layer connection. See the reference design below:
Figure 6: Ethernet Reference Design with Transformer
1.3.3. UART Interface
UART interface is the serial data transmission interface primarily used for the CH232BGN. The User
can add RS-232 drivers on their board to convert the signals to RS-232 voltage levels for
communications with outside equipment or sensors. CH232BGN modules UART interface include 4
signals: Transmit Data (TXD), Received Data (RXD), Request to Send (RTS), and Clear to Send
(CTS). The hardware reference design with RS-232 chipset as following:

Cermetek Microelectronics, Inc Page 10 of 42 Document NO. 607-00xx Revision A (12/13)
Figure 7: UART Interface Reference Design
Notes:CH232BGN modules incorporate an internal pull-down resister on the serial interface signals;;
therefore, the User cannot add pull-up or pull-down resisters to the serial interface signals.
1.3.4. Power
CH232BGN module utilizes a single +3.3V power supply. The typical peak current is 350mA. During
normal WiFi operation the module draws about 200mA. Current draw with WiFi OFF is 100mA.
Cermetek recommends decoupling be added at the power pin of the CH232BGN. At least one 100uF
and one 10uF capacitor are recommended for maximum reliability and performance. The decoupling
capacitors should be added as close to the CH2332BGN power pin as possible.
1.4. Software Reference Design
The following flow chart illustrates the prober flow for user code should on CH232BGN boot-up:
Figure 8: User Software Boot Flow Chart

Cermetek Microelectronics, Inc Page 11 of 42 Document NO. 607-00xx Revision A (12/13)
CH232BGN modules operate in either Transparent Transmission Mode or Configuration Mode.
Configuration is accomplished through AT+ commands.
1.4.1. Transparent Transmission Mode
The CH232BGN supports transparent data transmission through its serial interface. Once power is
applied, the CH232BGN connects automatically to the wireless network with minimal configuration
changes.
Notes: Transparent transmission requires flow control to be active to prevent data transfer errors.
Enable hardware flow control (RTS/CTS) on the UART port to prevent buffer overflow.
1.4.2. Configuration Mode
In configuration mode, the user can set CH232BGN configuration. The user can switch from
transparent transmission to the configuration mode using the AT+ commands described in Chapter 4.
1.4.3. Multi-TCP Link Connection
When the CH232BGN module is configured as TCP Server, it supports Multiple TCP connections. A
maximum of 32 TCP clients can connect to one CH232BGN module. Figure 9 below illustrates
Multiple TCP Connections
Upstream: Data from each TCP connection or client is transmitted to the serial port in sequence.
Downstream: The CH232BGN duplicates and broadcasts data from the serial port to every TCP
connection or client.
Figure 9: Data Flow for Multiple TCP Connections

Cermetek Microelectronics, Inc Page 12 of 42 Document NO. 607-00xx Revision A (12/13)
1.4.4. TCPB Function
The CH232BGN supports 2 network connections. The second network connection, TCPB, works only
as a TCP client and can be configured only through the AT commands as follows. For detailed AT
command descriptions refer to Chapter 4.
AT+TCPB=on, Enable TCPB function;
AT+TCPPTB=<port>, Set TCPB port number;
AT+TCPADDB=<IP or domain>, Set TCPB’s server address;
AT+TCPTOB=<time>, Set TCPB timeout;
AT+TCPLKB, Query TCPB link status;
After TCPB is enabled the two network interfaces work as a multiple TCP link. All data from each TCP
connection will be transmitted to the serial port in sequence and all data from user serial port will be
duplicated and broadcast to both TCP connections.
1.4.5. GPIO Function
The CH232BGN module supports two General Purpose Input-Output (GPIO) configurations, GPIO-1
and GPIO-2. In GPIO-1 the user defines TXD, RXD, CTS, and RTS as GPIO lines; the nReady, nLink,
and nReload pins serve has functional pins. In GPIO-2, all seven I/O pins (TXD, RXD, RTS, CTS,
nLink, nReady, and nReload) act as GPIO. With either of the GPIO modes selected the module does
not support serial communications.
GPIOn IN: Sets GPIOn as an input;
GPIOn OUT 0: Sets GPIOn as output equal to a logic 0;
GPIOn OUT 1: Sets GPIOn as output equal to a logic 1;
GPIOn PWM m1 m2: Sets GPIOn output to a square wave where m1 is the duration ‘high and
m2 is the duration ’low’ in milliseconds. The minimum duration is 10 milliseconds;
GPIOn GET: commands the CH232BGN to read the status of GPIOn, responds with I0 (input
low), I1 (input high), O0 (output low), or O1 (output high).
Notes: Pins 3, 4, 5, 6, 8, 9, 10 can be used as GPIO. Pins 4 and 10 can only be defined as inputs,
while Pin 3 can only be defined as an output.
The CH232BGN responds with GPIO OK if the I/O signal is active and GPIO NOK if the I/O
signal is not active.
The command GPIO READ returns the current status of all current IO status.

Cermetek Microelectronics, Inc Page 13 of 42 Document NO. 607-00xx Revision A (12/13)
1.4.6 nReady Output
The nReady signal has two output modes:
Mode One: The module activates nReady (active low) to signal success completion of the
boot sequence.
Mode Two: The module generates a square wave on nReady after a successful boot
sequence. The frequency of the square wave is 0.5 Hz with a 50% duty cycle. The User
software can check for the presence of this square wave to determine if a re-boot is required.
Notes: This nReady output function is user selected.
The AT+RELD command does not operate when this function is active. If user not requires
RELD, the default factory setting is Status One.

Cermetek Microelectronics, Inc Page 14 of 42 Document NO. 607-00xx Revision A (12/13)
2.FUNCTIONAL DESCRIPTION
2.1. Wireless Networking
The CH232BGN module can be configured to operate as either a WiFi Station (STA) or Access Point
(AP). Internally the CH232BGN incorporates separate interfaces for a WiFi Station or Access Point.
When the CH232BGN works as an Access Point, other Stations are able to connect to the wireless
LAN via the CH232BGN module. Figure 10 below shows the functional architecture of the CH232BGN
module:
Figure 10: CH232BGN Functional Architecture
Notes: An Access Point serves as a router providing WiFi services to a network of wireless nodes.
A Station serves as a wireless node to an established network.
2.1.1. Basic WiFi Network Architecture
A basic WiFi network features an Access Point at its hub supporting multiple Stations. All
communications between Stations pass through the Access Point. Figure 11 below shows an
example of a basic WiFi network
Figure 11: Basic Wireless Network Structure

Cermetek Microelectronics, Inc Page 15 of 42 Document NO. 607-00xx Revision A (12/13)
2.1.2. Adhoc Wireless Network
An Adhoc WiFi network, also called an Independent Basic Service Set, uses multiple Stations
without an Access Point. The Stations communicate directly with each other.
As shown in Figure 12 below, Nodes 1, 2 and 3 and the laptop serve as Stations in the Adhoc
network with user devices connected via the serial interface. The CH232BGN modules can be
operated and managed over the network from the laptop.
Figure 12: CH232BGN Adhoc Network Structure
2.1.3. Access Point Plus Station Wireless Network
The CH232BGN module can simultaneously serve as both an Access Point and a Station. Figure 13
below illustrates this type of network.,
Figure 13 CH232BGN Access Point Plus Station Network

Cermetek Microelectronics, Inc Page 16 of 42 Document NO. 607-00xx Revision A (12/13)
This dual network mode is activated by enabling both the Access Point and Station functions on the
CH232BGN. The CH232BGN Station Interface connects to the router and then to the TCP server in
the network. At the same time the CH232BGN Access Point interface is also active. This permits a
mobile phone or tablet to connect to the module through a secondary TCP connection for remote
access to module parameters.
The advantages ofAccess Point plus Station mode include:
Users can easily control and track the user device through a mobile phone or tablet without
affecting the network settings.
Users can modify module parameters over the WiFi connection.
Access Point plus Station Mode Setting:
The serial command below enables Access Point plus Station Mode:
AT+FAPSTA=on
Notes: When user enables Access Point and Station Modes, the Station port must maintain a
connection with the other Access Point to prevent data loss. If the Station port cannot
maintain the connection, disable the Station Scan with the commands below:
AT+STTC=on/off, “on”selects Access Point scanning; “off”disables Access Point
scanning: This command is not saved when the module is restarted.
AT+FSTTC=on/off; “on” selects Access Point scanning; “off” disables Access Point
scanning: This command is saved when the module is re-started.
2.2. Auto- Frequency Function
When module works as a Station, CH232BGN adjusts the wireless communications channel to
maintain the same channel as the associated Access Point. When the module works as an Access
Point and the Auto-frequency function is enabled, the CH232BGN will select the optimal wireless
channel based on the environment on boot-up, it will select the optimal wireless channel based on the
surrounding environment.
2.3. Security
CH232BGN module supports multiple wireless encryption protocols, and enables them to protect user
data transmission, the protocols include:
WEP
WPA-PSK/TKIP
WPA-PSK/AES
WPA2-PSK/TKIP
WPA2-PSK/AES

Cermetek Microelectronics, Inc Page 17 of 42 Document NO. 607-00xx Revision A (12/13)
2.4. UART Frame Scheme
2.4.1. UART Free-Frame
CH232BGN supports the UART free-frame function. This function allows the module set frame breaks
based on the intervals between any two data bytes received through the serial port. If this interval time
exceeds the defined value (default 50ms), the CH232BGN interprets the interval as the end of a frame
and immediately transfers this frame to the WiFi port. If there is no pause in the data, the CH232BGN
buffers up to 4K Bytes of data before transferring the data as a frame to the WiFi port.
This Auto-Frame function is controlled by the commands AT+UARTF (Auto-Frame on/Off),
AT+UARTFT (Auto-Frame interval), andAT+UARTFL (Trigger length in Bytes).
Notes: The default frame interval is 50 milliseconds. The user can select a fast interval of 10
milliseconds; however, this increases the risk of fragmented data.
2.5. Address Binding
The CH232BGN module supports binding the Basic Service Set identification (BSSID) address of the
target network. According to the provisions of 802.11 protocol, different wireless networks can have a
same network name (i.e. SSID / ESSID), but must correspond to a unique BSSID address (i.e. MAC
address). Intruders could create a wireless network with the same SSID / ESSID and permit Stations
in the network to unknowingly connect to a fraudulent Access Point. Binding the BSSID address
prevents the Station from connecting to an intruder improving wireless network security.
2.6. Ethernet Interface Communication
CH232BGN module incluldes a 10/100M Ethernet interface. The Ethernet interface permits the user
to easily realize three types of communications (WiFi, Serial, and Ethernet). This allows the
CH232BGN to be configured as a Bridge or Router.
Notes: The CH232BGN consumes more power with Ethernet mode active. For that reason the default
configuration disables Ethernet. The command “AT+FEPHY=on”activates Ethernet operation.
2.6.1. CH232BGN Ethernet Operation as Access Point
Figure 14: CH232BGN As Access Point
The CH232BGN module can serve as an access point to the Ethernet network. All devices in the
network must use the same network segment within their IP address.

Cermetek Microelectronics, Inc Page 18 of 42 Document NO. 607-00xx Revision A (12/13)
2.6.2. CH232BGN Ethernet Operation As Station (N-Version Code)
Figure 15: CH232BGN Ethernet Interface Station with “N” Version Code
The CH232BGN module operates as a Station (N-Version Software required) when the module is set
as a router. When the module connects to an Access Point, it will receive the wireless port IP address
from the Access Point. At the same time, the module also forms a sub-network (Default 10.10.100.254)
and all devices connected to the modules Ethernet interface will receive an assigned IP address.
Figure 15 shows, PC1 on the sub-network able to initiate a connection with PC2 (With CH232BGN
serving as a router). PC2 cannot initiate a connection to PC1.
2.6.3. CH232BGN Ethernet Operation as Station (Z-Version)
Figure 16 CH23 BGN Ethernet Interface Station with “Z” Version Code
In Figure 16 above, the CH232BGN module operates as a Station(Firmware version Z required)
with the module configured in bridge mode. When the module connects to an Access Point, all
devices connected to the Ethernet interface have an IP address assigned from the Access Point. In
bridge mode the module can be treated as a transparent device. PC1 and PC2 can communicate
without limits.
Notes: This network configuration requires a static IP address be assigned to the CH232BGN in
order to communicate with an Access Point or modify the configuration through a web page.
2.7. Wireless Distribution System (WDS)
The CH232BGN supports the Wireless Distribution System (WDS) function. Through WDS, several
Access Points can connect to each other to build a WiFi network.
Figure 17 below illustrates the WDS network structure. Each of the three CH232BGN modules at the
network core serves as an Access Point to the WDS network. The remaining CH232BGN models
work as Stations and can connect with any Access Point in the network. All modules including the
Access Points and Stations reside on the same local area network (LAN).

Cermetek Microelectronics, Inc Page 19 of 42 Document NO. 607-00xx Revision A (12/13)
The server can connect with an Access Point over the WiFi or Ethernet link. Once the devices are
connected, the server can connect with every user device and control them as if it were a seamless
local area network.
The AT command AT+FVER=w enables the WDS function. WDS can also be enabled from the web
page.
Figure 17: WDS Networking Demo
2.8. Search Function for Station
When using web configuration for the Station Interface, the user can push the “Search” button to
find surrounding Access Points.
2.9. Work Mode
CH232BGN modules communicate only in “Transparent Transmission Mode.”Transparent
transmission mode provides a plug and play serial data port reducing system complexity. On power
up the module will attempt to connect with a compatible wireless network. The parameters which need
to be configured include:
Wireless Network Parameters
Wireless Network Name(AT+WSSSID)
Security Mode & Encryption Key (AT+WSKEY)
TCP/UDP Linking Parameters
Protocol Type; Link Type(Server or Client)(AT+TCPB)
Target Port ID Number (AT+TCPPTB)
Target Port IP Address (AT+TCPADDB)

Cermetek Microelectronics, Inc Page 20 of 42 Document NO. 607-00xx Revision A (12/13)
Serial Port Parameters (AT+UART)
Baud Rate
Data Bit
Parity (Check) Bit
Stop Bit
Hardware Flow Control
Work Mode Selection (AT+TMODE)
Transparent transmission
Transparent transmission mode is illustrated in Figure 18. The CH232BGN modules serve as a
wireless serial link. Data is sent between user devices without modification.
Figure 18: CH232BGN Transparent Transmission Operation
2.10.Parameters Configuration
CH232BGN module supports two methods of configuring parameters; Over the web and through
the serial port using AT+ commands. The user configures the CH232BGN on-line through an
integrated web page. When the module is connected to a wireless network, parameters can be
configured from a PC connected to the same wireless network. Configuration through the serial
port is done with AT+ commands. See Section 4 for full descriptions of the AT+ commands.
Table of contents