Labs / Electronic modules

GraftSense: TTL to RS232 Module Based on MAX3232 Chip (Open Version)

Author: Li Zisheng · Source: FreakStudio open documentation, v1.2 · License: CC BY 4.0

Contents
MAX3232 RS232 D-DMR009PF-D002
MAX3232 RS232

I. Module Introduction

TTL to RS232 Module Based on MAX3232 Chip Adopting the MAX3232 chip, it enables bidirectional conversion between TTL level (0V to + 5V) and RS232 standard level (±3V to ±25V). Integrated with a DC-DC 5V-to-3.3V circuit, power filtering and power indicator, and using the D-DMR009PF-D002 terminal block as the RS232 interface, this module is applicable to scenarios such as industrial control and device serial port expansion, solving the communication compatibility problem of serial port devices with different levels, and providing a convenient conversion solution for communication between TTL level devices (e. g., microcontrollers) and RS232 level devices (e. g., industrial computers, legacy instruments).

II. Introduction to Main Chips

2.1 Chip Overview

MAX3232 is a commonly used RS-232 to TTL (or CMOS) level converter chip. It supports a data transmission rate of up to 250kbps and dual-channel RS-232 to TTL (or CMOS) level conversion, and is widely used for serial communication between microcontrollers and devices such as computers, modems and printers.

MAX3232 17A5 N2DX
MAX3232CDR 3.0V 5.5V RS-232 0.1 TIA/EIA-232-F V.28 250kbps 35V SOP-16

2.2 Pin Definition

MAX3232 6 5.5V RS-232
MAX3232 16 1 2 3 4 5 6 5.5V 7

They are divided into the following three categories according to their functions:

2.3 Functional Block Diagram

Its working principle can be briefly summarized as follows: MAX3232 converts the input low voltage (e. g., 3.3V or 5V) into a high voltage that complies with the RS-232 standard (typically + 5V to + 15V and -5V to -15V) through its built-in charge pump circuit and inverters.

GraftSense: TTL to RS232 Module Based on MAX3232 Chip (Open Version)
MAX3232 chip internal structure and reference circuit

Here, the capacitance value required for the operation of the internal charge pump is related to the supply voltage:

MAX3232 RS232 3.0 3.6V 3.15 4.5 5.5V C1 C2 C3

RS-232 communication typically uses DB9 connectors;DB9 connectors have 9 pins, each of which serves a specific function in RS-232 communication. The pin numbers and corresponding functions are as follows:

DB9 9 RS-232

Here, we only use the DB9 connector's RXD, TXD and GND pins.

DB9 connectors come in two types:

DB9 9 RS-232

2.4 Performance Parameters

16
GraftSense: TTL to RS232 Module Based on MAX3232 Chip (Open Version)
MAX3232 RS232

2.5 Reference Circuit

None.

2.6 Chip Configuration

None.

None.

2.8 PCB Routing Precautions

None.

III. Instructions for Circuit Engineering and Module Usage

3.1 Circuit Source Engineering

To obtain the source code of the circuit, please follow the official account [Freak Embedded]

3.2 Module Usage Instructions

The schematic diagram of this module is shown below:

SCH_MAX3232-Based TTL to RS232 Module_v1.0_2025-11-22.pdf 2.0 MB

MAX3232 RS232 U1 C1 V1.0

This module provides a UART interface: the MRX (corresponding to the UART MCU serial port RXD) of this module is actually connected to the TXD pin of the module, and the MTX (corresponding to the UART MCU serial port TX) is actually connected to the RXD pin of the module. Note that cross connection is strictly prohibited.

Next, use the USB to DB9 adapter to connect to the DB9 connector on the module.

Typically, the serial port of a computer or device uses a DB9 female connector, while one end of a serial cable is a DB9 male connector; the DB9 connector used on our module is a female type. On modern computers, DB9 connectors have long been phased out, but virtual serial ports (implemented via USB to serial conversion) are still functional. We can use a USB to DB9 adapter to enable communication between a microcontroller and a computer via the RS232 protocol.

RS232 RS-232 9

Here USB to RS232 adapters often use built-in FT232 chips to complete the conversion of different Communication Protocols, FT232 is a USB to serial chip designed by FTDI , which is widely used in embedded systems, microcontroller development and debugging, as well as the traditional RS-232 or TTL serial interface to USB interface, allowing modern devices to communicate with old serial devices.

FT232RL 1 28 1632 D6993801 FT232

The FT232 chip requires the driver provided by FTDI to be installed in most operating systems, which can be downloaded from FTDI's official website:

https://ftdichip.com/drivers/vcp-drivers/

FT232 X86 X64 2.12.36.64 2021 7 15

-to- USB -to- RS232 adapter we provide adopts the domestic MS3020 chip, and its corresponding driver also needs to be installed. If you directly connect the USB -to- RS232 adapter to a computer without installing the matching driver, normal communication will not be available. The following content will be displayed when you open the Device Manager:

COM8 RS232

The driver download link is as follows: http://www.dtech.cn/download/download.php? class3= 410

Open the PDF file of the driver installation instructions and follow the steps to complete the installation:

RS232 msusb2serial_bit64.exe 4 152
USBSerialV1.0.7.21 usb2serial_ms msusb2serial_bit32.exe msusb2serial_bit64.exe RS232

After the installation is successful, click on Device Manager again, and you will find that the small exclamation mark on the original device has disappeared, indicating that the device can be used normally. In the corresponding serial port communication software assistant, you can also select its port normally:

3.3 Application Experiment

Here, we use the GraftPort-RP2040 development board for testing, and connect the TTL-to-RS232 module based on the MAX3232 chip to communicate with the main controller via the UART interface.

Here, we first use the HY2.0-4P cable to connect the module to the GraftPort-RP2040 development board's UART1 interface, and meanwhile use the USB to RS232 adapter to connect to the module's DB9 interface:

The module connections are shown in the following table:

Development Board Pins

Module Pins

Description

Pin 8

MTX

UART data transmission line, corresponding to the transmit pin of the development board

Pin 9

MRX

UART data transmission line, corresponding to the receiving pin of the development board

-

Db-9

Connect to a computer for reading

Serial Port Debugging Software XCOM, XCOM parameter configuration is as follows:

COM1 16

Copy the following test code for verifying the function of the validation module main.py into our project:

# Python env   : MicroPython v1.23.0
# -*- coding: utf-8 -*-
# @Time    : 2025/09/04 10:00
# @Author  : 侯钧瀚
# @File    : main.py
# @Description : 232 serial port loopback test code

# ======================================== Import Modules =========================================

from machine import UART, Pin
import time

# ======================================== Global Variables ============================================

# Test message counter
count = 1

# ======================================== Functions ============================================

# ======================================== Custom Classes ============================================

# ======================================== Initialization ==========================================

# Power-on delay of 3 s
time.sleep(3)
print("FreakStudio: UART loopback test started. Sending data every 2 seconds...")

# Initialize UART1: TX=Pin8, RX=Pin9, baud rate 9600
uart = UART(1, baudrate=9600, tx=Pin(8), rx=Pin(9))

# ========================================  Main Program  ===========================================

try:
    while True:
        # Build test message with counter
        test_msg = f"Test message {count}: Hello, UART loopback!"
        print(f"\nSent: {test_msg}")

        # Send message
        uart.write(test_msg.encode('utf-8'))

        # Wait a short time to receive data
        time.sleep(0.1)

        # Read and print received data
        if uart.any():
            received = uart.read(uart.any()).decode('utf-8')
            print(f"Received: {received}")
        else:
            print("Received: No data (check connections)")

        # Increment counter and wait 2 seconds before the next send
        count += 1
        time.sleep(2)
except KeyboardInterrupt:
    print("\nTest stopped by user")

To flash the code, open a terminal and use the mpremote tool to connect to the main controller; the output is as follows:

MAX3232 RS232

It can be seen that our module can normally complete the loopback test function of the serial port.

IV. Drivers

ttl_232_code.zip 1 KB

None.

VI. Revision History

Document Version

Date of Revision

Modifier

Revised Content

v1.0

2025-11-22

Li Zisheng

Initialize the document

The BOM sheet has not been finally checked, the driver has not been re-verified, and the 3.3 application experiment

Not yet specified.

v1.1

2025-12-29

Li Zisheng

Added application experiments and production files

v1.2

2025-12-31

Xin Ruili

Create an open version of the document based on the internal document version v1.1.

VII. Relevant Materials

7.1 Chip Datasheet

C141882_D-SUB-VGA Connector_D-DMR009PF-D002_Datasheet_WJ227792.PDF 563 KB

C22449673_RS232 Chip_MAX3232IPWR(UMW)_Datasheet_UMW+MAX3232IPWR.PDF 498 KB

7.2 Unique Icons for PCB Silk Screen

MAX3232 RS232