Open Source Debugging Tool: High-Speed USB to UART, SPI, I2C, JTAG

In the previous article on dynamic library encapsulation examples, a CH347 high-speed USB to UART, SPI, I2C, JTAG bridging module was used, which is now open source 👉 GitHub Repository[1].

Introduction

CH347 USB High Speed Bridge is a debugging tool designed based on the CH347[2] chip, supporting high-speed USB, allowing USB to UART, USB to SPI, USB to I2C, USB JTAG, and USB to GPIO functionalities.

Open Source Debugging Tool: High-Speed USB to UART, SPI, I2C, JTAG
TOP
Open Source Debugging Tool: High-Speed USB to UART, SPI, I2C, JTAG
BOTTOM
Open Source Debugging Tool: High-Speed USB to UART, SPI, I2C, JTAG
Physical Image

Features

Overview

  • Type-C interface, USB2.0, supports 480Mbps high-speed mode
  • Button to switch work modes, supports hot swapping, no need to unplug USB
  • Built-in EEPROM, configurable working mode, chip VID, PID, maximum current value, vendor and product information strings, etc.
  • Onboard high-efficiency DCDC, supports 5V, 3.3V power output, maximum 1A current, with short circuit protection
  • Compact size, space-saving, easy to use

UART

  • Built-in firmware simulates standard serial port for upgrading original serial peripheral devices, or adding additional serial ports via USB
  • Serial applications on Windows operating system are fully compatible without modification
  • Hardware full-duplex serial port, with independent transmit and receive buffers, supporting baud rates from 1200bps to 9Mbps
  • Serial port supports 8 data bits, odd, even, or no parity, and 1 or 2 stop bits
  • Each serial port has a built-in 12K byte receive FIFO and 4K byte transmit FIFO
  • Supports common MODEM control signals RTS, DTR, DCD, RI, DSR, CTS
  • Supports CTS and RTS hardware automatic flow control
  • Supports half-duplex, provides serial port sending status indication TNOW, can be used to control RS485 transmit-receive switching
  • Supports RS232, RS485, RS422 interfaces through external level conversion devices

SPI

  • Host/Master mode
  • Provides SCS line, SCK/CLK line, MISO/SDI/DIN line, MOSI/SDO/DOUT four signal lines
  • Supports 2 chip select signal lines, can operate 2 SPI interface devices in time division
  • Supports 8-bit/16-bit data structure, supports MSB and LSB transmission
  • Supports SPI modes 0/1/2/3, supports transmission frequency configuration, transmission frequency can reach 60MHz
  • Supports hardware DMA for sending and receiving
  • Can flexibly operate 4-wire interface FLASH, MCU, sensors, etc., using computer API

I2C

  • Host/Master mode
  • Provides SCL and SDA signal lines, supports 4 transmission speeds
  • Can flexibly operate 2-wire interface A/D, D/A, EEPROM, and sensor devices using computer API

JTAG

  • Host/Master mode
  • Provides TMS line, TCK line, TDI line, TDO line, and TRST line (optional)
  • Supports high-speed USB data transmission
  • Can flexibly operate CPU, DSP, FPGA, CPLD, MCU devices using computer API

GPIO

  • Supports up to 8 GPIO input/output functionalities

Working Modes

K1 and K2 pressed output low level, released output high level. The table below ‘0’ indicates pressed, ‘1’ indicates released.

K1 K2 Mode Interface Function
1 1 0 UART0 + UART1
0 1 1 UART1 + SPI + I2C (CDC)
1 0 2 UART1 + SPI + I2C (HID)
0 0 3 UART1 + JTAG

Switching working modes:

The default is mode 0 when powered on; hold K1 and press RST to switch to mode 1; hold K2 and press RST to switch to mode 2; simultaneously hold K1 and K2 and press RST to switch to mode 3.

PINOUT

Open Source Debugging Tool: High-Speed USB to UART, SPI, I2C, JTAG
PINOUT

Shell

Debug Records

Open Source Debugging Tool: High-Speed USB to UART, SPI, I2C, JTAG
CH347 High-Speed USB Bridge Board
  1. CH347 Dynamic Library Encapsulation Example

Related Projects

  • [WIP]CH347 Chip Python Library[3]

Future work will continue to improve the Python software library and enrich its functionalities.

Currently, I have a few samples available, feel free to contact me if you need any.

References

[1]

GitHub Repository: https://github.com/pengwon/ch347-hs-usb-bridge

[2]

CH347: https://www.wch.cn/products/CH347.html

[3]

[WIP] CH347 Chip Python Library: https://github.com/pengwon/pych347

Leave a Comment