CH552/CH554 Development Guide - macOS

CH552G/CH554G Pinout

(Get original SVG image from GitHub)

CH552G/CH554G Pinout

# Pin Timer SPI PWM UART Timer Interrupt Touch USB ADC From Datasheet
1 P3.2 TXD1_ INT0 VBUS1 AIN3 P3.2/TXD1_/INT0/VBUS1/AIN3
2 P1.4 T2_/CAP1_ SCS TIN2 UCC1 AIN1 P1.4/T2_/CAP1_/SCS/TIN2/UCC1/AIN1
3 P1.5 MOSI PWM1 TIN3 UCC2 AIN2 P1.5/MOSI/PWM1/TIN3/UCC2/AIN2
4 P1.6 MISO RXD1 TIN4 P1.6/MISO/RXD1/TIN4
5 P1.7 SCK TXD1 TIN5 P1.7/SCK/TXD1/TIN5
6 RST T2EX_/CAP2_ RST/T2EX_/CAP2_
7 P3.1 PWM2_ TXD P3.1/PWM2_/TXD
8 P3.0 PWM1_ RXD P3.0/PWM1_/RXD
9 P1.1 T2EX/CAP2 TIN1 VBUS2 AIN0 P1.1/T2EX/CAP2/TIN1/VBUS2/AIN0
10 P3.3 INT1 P3.3/INT1
11 P3.4 PWM2 RXD1_ T0 P3.4/PWM2/RXD1_/T0
12 P3.6 UDP P3.6/UDP
13 P3.7 UDM P3.7/UDM
14 GND GND
15 VCC VCC
16 V33 V33

Documents

Development Environment Setup

SDCC and Arduino are available for CH552 development.

Set up SDCC on macOS

  1. Install sdcc and binutils (for objcopy).

    1
    2
    
    brew install sdcc
    brew install binutils
    

    Add the binutils path to $PATH environment variable.

    1
    2
    3
    4
    
    # macOS arm64
    /opt/homebrew/opt/binutils/bin
    # macOS x86_64
    /usr/local/opt/binutils/bin
    
  2. Clone ch554_sdcc.

    1
    
    git clone https://github.com/Blinkinlabs/ch554_sdcc.git
    
  3. Install CH55x flash tool.

    1
    2
    3
    4
    5
    
    brew install libusb
    # Find the python version
    python3 --version
    # For example - Python 3.11.2
    python3.11 -mpip install ch55xtool
    

    Replace WCHISP in ch554_sdcc/examples/Makefile.include

    1
    2
    3
    
    WCHISP ?= python3 -m ch55xtool -f
    # Or explicitly point to the python version
    WCHISP ?= python3.11 -m ch55xtool -f
    
  4. Build and flash the examples.

    1
    2
    3
    4
    
    cd ch554_sdcc/examples
    make
    cd blink
    make flash