Ir a contenido

Controlling GPIO with FTDI USB-to-Serial Chips

FTDI chips such as the FT232RL are widely used as USB‑UART converters, but they also feature a powerful hidden function: GPIO control via Bit‑Bang mode. Using the official ftd2xx library, we can directly control the ADBUS pins as general‑purpose inputs or outputs from a PC, turning a standard serial adapter into a flexible, multi‑functional I/O controller.

DriverGenius RS232-ESD9C USB to RS232 Adapter

Product: DriverGenius industrial‑grade RS232‑ESD9C adapter with ESD protection

Practical Value of GPIO Control

In industrial control, automated testing, sensor acquisition, and embedded development, the GPIO capability of FTDI‑based products offers significant practical value:

  • Dual functionality: Retains full USB‑to‑serial/UART communication while supporting programmable GPIO, with no need for an external microcontroller.
  • True plug‑and‑play: No firmware flashing or hardware modifications required; ready for immediate use with PC software.
  • Industrial stability: Built with genuine FTDI chips and an official driver architecture, delivering strong anti‑interference performance and reliable operation.
  • Simplified system design: Reduces wiring complexity, saves space, lowers costs, and fits compact test equipment and industrial modules.
  • Wide compatibility: Works reliably on Windows, Linux, and macOS for cross‑platform projects.

Typical Practical Applications

1. PC‑controlled relay switching
In automated testing or equipment control, GPIO can output high/low levels to drive relay modules, enabling remote on/off control of lights, power supplies, solenoid valves, and other external devices. Meanwhile, the same device maintains RS232 serial communication, allowing "one USB cable for both serial communication and I/O control".

2. Industrial sensor signal acquisition & status monitoring
By setting GPIO to input mode, you can directly read digital signals from photoelectric sensors, proximity switches, limit switches, and more. This enables real‑time monitoring of equipment status, position signals, and alarm signals, with data logging and logic processing via host computer software—no extra microcontroller circuit required.

This feature upgrades a standard serial adapter to a flexible miniature I/O control unit, making DriverGenius products highly competitive in industrial automation, embedded testing, relay control, and sensor interfacing.

ADBUS Pin Mapping (Bit‑Bang Mode)

ADBUS Pin Serial Signal Bit Position
ADBUS0 TXD Bit 0 (LSB)
ADBUS1 RXD Bit 1
ADBUS2 RTS Bit 2
ADBUS3 CTS Bit 3
ADBUS4 DTR Bit 4
ADBUS5 DSR Bit 5
ADBUS6 DCD Bit 6
ADBUS7 RI Bit 7 (MSB)

Implementation Using the ftd2xx Library

DriverGenius RS232‑ESD9C fully supports Bit‑Bang mode via the official ftd2xx library, providing stable, standard GPIO control without affecting normal virtual COM port functionality.

Example Code: GPIO Chaser Output

# ftdi_gpio_control.py
import time
import ftd2xx

devices = ftd2xx.listDevices()
if not devices:
    print("No FTDI devices detected")
    exit()

dev = ftd2xx.open(0)
dev.setBitMode(0xFF, 0x01)

patterns = [
    0b11111110,
    0b11111101,
    0b11111011,
    0b11110111,
    0b11101111,
    0b11011111,
    0b10111111,
    0b01111111
]

try:
    while True:
        for p in patterns:
            dev.write(bytes([p]))
            time.sleep(0.5)
except KeyboardInterrupt:
    dev.write(bytes([0xFF]))
    dev.setBitMode(0x00, 0x00)
    dev.close()

Summary

GPIO control based on FTDI chips enables simple, reliable PC‑controlled digital I/O without additional microcontrollers. Full support for this feature makes DriverGenius RS232‑ESD9C far more versatile than traditional serial adapters, ideal for industrial control, automation, embedded development, and integrated system solutions.

Artículo siguiente AV202-B | Intermittent Audacity Recording

Dejar un comentario

Los comentarios deben ser aprobados antes de aparecer

* Campos requeridos

Comparar productos

{"one"=>"Seleccione 2 o 3 artículos para comparar", "other"=>"{{ count }} de 3 artículos seleccionados"}

Seleccione el primer artículo para comparar

Seleccione el segundo artículo para comparar

Seleccione el tercer elemento para comparar

Comparar