Skip to the content
2 layers21.4 × 26.5 mmPUYA Prototype PY32F030F28P6TU, the printed circuit board in 3D

PUYA Prototype PY32F030F28P6TU

ElectronicCats/puya-projects9

PUYA Projects

Size
21.4 × 26.5 mm
Copper layers
2
Thickness
1.6 mm
Parts
41
Nets
22
Pads
67
Tracks, vias
149, 23
Pours
1
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
19 May 2023
Updated
18 Feb 2025

Overview

PUYA Prototype PY32F030F28P6TU is an open-source printed circuit board by ElectronicCats, from the ElectronicCats/puya-projects repository on GitHub. It is a 2-layer board of 21.4 × 26.5 mm with 41 parts on 22 nets, routed with 149 tracks and 23 vias.

It is built around the PY32F030F28P6TU and XC6220B331MR-G. Its parts include 5 capacitors, 3 connectors, 2 resistors, 2 ICs and 2 switches.

Main components

2

README

README.md

PUYA Projects

PUYA projects is an experiment to use low-cost ARM PUYA microcontrollers.

PY32F002A key features and specifications:

  • MCU Core – 32-bit Arm Cortex-M0+ @ 24 MHz
  • Memory – 3KB SRAM
  • Storage – 20KB flash
  • Peripherals:
    • 5 GPIOs (PF0, PA1, PA5, PA6, PA7)
    • 1x USART
    • 1x I2C, 1x SPI, 1x PWM (PA1 AF13 TIM1_CH4)
    • Up to 9-channel 12-bit ADC
  • Timers
    • 1x general-purpose 16-bit timers
    • 1x 16-bit advanced control timer
    • 1x low-power timer (LPTIM) to support wake-up from stop mode
    • 1x SysTick timer
    • 1x watchdog timers (IWDT)
  • Clocks
    • 4/24MHz RC (HSI)
    • 32.768KHz RC (LSI)
    • 4~24MHz HSE (External crystal oscillator)
    • Supply Voltage – 1.7V to 5.5V DC
    • Packages – SOP8 (4.9×3.7×1.75 mm), SOP16, ESSOP10, TSSOP20
    • Temperature Range – – 40°C to +85°C

FOR WINDOWS

Requirements

  • PUYA microcontroller (We used a PUYA Dev Board with a PY32F002AA15M6TU microcontroller)
  • J-Link Segger Debugger
  • Visual Studio Code (mandatory)
  • Git (Recommended)

Tools Installation

  1. Install GNU Arm Embedded Toolchain:

    • Download the appropriate version from Arm GNU Toolchain Downloads (We use arm-none-eabi v12.3 rel1).
    • Add the tool's binary directory to the Windows PATH.

    To add the environment variable we look in the windows bar: "Edit environment variables for your account".

Open "Edit environment variables for your account".

Open "Environment Variables...".

Select "Path" and then "Edit...".

Add "New" variable and add the path: "C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\12.3 rel1\bin".

  1. Open the Command Line: To open the "Command Line" search "cmd" or "PowerShell" in your windows bar. In this case "Windows PowerShell" was used, and a window like the following should open:

  1. Verify GNU Toolchain Installation: In your Command Line verify if GNU Toolchain Installation was correct.
    powershell
    &"C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\12.3 rel1\bin\arm-none-eabi-gcc" -v 
    If it has been installed correctly you should obtain a result similar to the following:

  1. Install Make:

    • Download Make from GnuWin.
    • Add Make to the environment variables.
  2. Check Make Installation:

    powershell
    make -v
  3. Install SEGGER J-Link:

Project Configuration

  1. Clone the PY32 Examples Repository: Copy code

    git clone https://github.com/TDLOGY/py32f0-template-project

  2. Copy the JLinkDevices Directory: Copy [PY32 Directory]/Misc/Flash/JLinkDevices to C:\Users\[User]\AppData\Roaming\SEGGER\JLinkDevices\.

  3. Find the JLink Path: Locate the path where JLink is installed, typically something like: "C:\Program Files\SEGGER\JLink\JLink". Save it for future configurations.

  4. Connect J-Link and Verify: In Windows PowerShell, use the following command to verify the J-Link connection:

    powershell
       &"C:\Program Files\SEGGER\JLink\JLink"
  5. Open Visual Studio Code:

    • Open the py32f0-template-project folder.
  6. Adjust Makefile for Your Chip (The "Makerfile" is located in the project folder):

Located in the project folder.

    • Edit the Makefile to change the tools references, it uses the path references of the previously installed tools.

Tools references.

    • Edit the Makefile to change all the chip reference to `"PY32F002AX5"`.
  1. Compile the Project:

    • In Visual Studio Code open a terminal.

Opening a Terminal.

    • Execute: make -j4 in the Visual Studio Code (VSC) terminal and verify that it compiles correctly, otherwise, it could be that the "Makefile" has not been configured correctly.
  1. Modify the Code:

    • Open the /User/main.c file.
    • Adjust pin references from ports B and F to A as needed.
  2. Compile Again: Execute make clean to clean the compilation and after make -j4 to compile with the changes made.

  3. Program the Board: Use make flash to upload the code to your board using J-Link. (You must have your J-Link connected to your computer and with the corresponding connections to the development board)

  4. Save Your Changes: Remember to save the modified files before compiling.

  5. Clean Previous Compilation: If you make changes to the code, run make clean before compiling again.

PUYA Dev Board with the PY32F002AA15M6TU microcontroller should now be configured and ready to go!

The development board can be programmed via SWD by a J-Link (The J-link connections will depend on which J-Link and connector you are going to use).

What is SWD?

SWD is a bidirectional communication protocol that allows for fast and efficient microcontroller debugging and programming.

SWD uses two signal lines, one for data (SWDIO) and one for clock (SWCLK), to communicate with the microcontroller. Through these lines, you can load programs into the microcontroller, stop code execution to inspect variables and debug errors, and perform other debugging operations. It is faster and more efficient than older debugging methods, such as JTAG.

J-Link Connections to the Dev Board

As mentioned earlier, SWD communication involves two key lines: SWDIO for data and SWCLK for the clock signal. However, in addition to these two lines, we also require two more connections:

  • GND (Ground): This connection is essential to establish a common reference point for electrical potential and ensure proper communication.
  • VRef (Voltage Reference): In this case, our PUYA Dev board works with a logical voltage level of 3.3V so it is necessary to provide this voltage to the J-Link tool. This voltage, known as VRef, is necessary to support the communication between the J-Link and the target board.

Note: You need to power up the PUYA Dev board with an external 5V power supply.

Instructions to use the J-Link PLUS Compact

To program the PUYA Dev Board with the J-Link PLUS Compact we will need the following components:

Imagen 0
USB Cable.
Imagen 1
J-Link PLUS Compact.
Imagen 2
Dupont Wires.

In addition to this, in order to make the connections we must know what the J-Link pinout is, take the image below as a reference and connect each wire from your PUYA Dev Board to the corresponding one on the J-Link:

J-Link PLUS Compact connector.

Instructions to use the J-Link EDU Mini:

To program the PUYA Dev Board with the J-Link EDU Mini we will need the following components:

Imagen 0
USB Cable.
Imagen 1
J-Link EDU Mini.
Imagen 2
J-Link EDU Mini PCB Adapter.
Imagen 3
J-Link EDU Mini Cable.
Imagen 2
Dupont Wires.

As shown in the required material, the J-Link EDU Mini PCB Adapter helps us a lot in identifying where we need to connect each wire from our PUYA development board to the PCB adapter. After connecting the corresponding wires you can program your board.

Connection example:

Illustrative image of connections.

The image above is just a reference image of the connections. The board is being powered directly with 5V and there are the following connections:

PUYA Dev BoardJ-Link CompactJ-Link EDUPower Supply
3.3VVTrefVrefX
GNDGNDGNDGND
DIOSWDIOSWIOX
CLKSWCLKCLKX
5VXX5V

Thanks / Contributors

This example is based on the Example Code PY32F0

Maintainer

Electronic Cats invests time and resources providing this open source design, please support Electronic Cats and open-source hardware by purchasing products from Electronic Cats!

Parts

41
QtyValueFootprintReferences
310uFCapacitor_SMD:C_0603_1608MetricC1, C2, C3
2100nFCapacitor_SMD:C_0603_1608MetricC4, C5
210KResistor_SMD:R_0603_1608MetricR1, R3
2Conn_01x10Connector_PinHeader_2.54mm:PinHeader_1x10_P2.54mm_VerticalJ2, J3
2G***kibuzzard-646D3CFDkibuzzard-646D3CFD, kibuzzard-646D3CFD
1BOOTFootprints:TS1088R02026SW2
1G***kibuzzard-67B50C66kibuzzard-67B50C66
1G***kibuzzard-67B50BF3kibuzzard-67B50BF3
1G***kibuzzard-67B50BE4kibuzzard-67B50BE4
1G***kibuzzard-67B50C01kibuzzard-67B50C01
1G***kibuzzard-646D3CA0kibuzzard-646D3CA0
1G***kibuzzard-67B50C98kibuzzard-67B50C98
1G***kibuzzard-67B50BE9kibuzzard-67B50BE9
1G***kibuzzard-67B50C92kibuzzard-67B50C92
1G***kibuzzard-67B50C80kibuzzard-67B50C80
1G***kibuzzard-646D3CABkibuzzard-646D3CAB
1G***kibuzzard-67B50C7Bkibuzzard-67B50C7B
1G***kibuzzard-67B50C10kibuzzard-67B50C10
1G***kibuzzard-67B50C9Fkibuzzard-67B50C9F
1G***kibuzzard-67B50C75kibuzzard-67B50C75
1G***kibuzzard-646D3CBCkibuzzard-646D3CBC
1G***kibuzzard-67B50C29kibuzzard-67B50C29
1G***kibuzzard-67B50CD8kibuzzard-67B50CD8
1G***kibuzzard-67B50C8Ckibuzzard-67B50C8C
1G***kibuzzard-67B50C14kibuzzard-67B50C14
1G***kibuzzard-67B50C61kibuzzard-67B50C61
1G***kibuzzard-67B50C05kibuzzard-67B50C05
1G***kibuzzard-67B50C2Dkibuzzard-67B50C2D
1G***kibuzzard-67B50CE1kibuzzard-67B50CE1
1G***kibuzzard-67B50C0Bkibuzzard-67B50C0B
1LOGOAesthetics:electronic_cats_logo_8x6G***
1PY32F030F28P6TUPackage_SO:TSSOP-20_4.4x6.5mm_P0.65mmU2
1RESETFootprints:TS1088R02026SW1
1SWDConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ1
1XC6220B331MR-GPackage_TO_SOT_SMD:SOT-23-5U1

More from ElectronicCats/puya-projects

1
  • 2 layers19.3 × 31.8 mmPUYA Prototype, the printed circuit board in 3D

    PUYA Prototype

    ElectronicCats/puya-projects

    PUYA Projects

    26 parts9

Similar boards

  • 2 layers85 × 115 mmOSO BOOK B1, the printed circuit board in 3D

    OSO BOOK B1

    joeycastillo/The-Open-Book

    For details on how to build, test and use Open Book, I've made documentation available here.

    76 parts8.1kCC-BY-SA-4.0
  • 2 layers80 × 107.5 mmMinino, the printed circuit board in 3D

    Minino

    ElectronicCats/Minino

    Minino is an original multiprotocol and multiband board made for sniffing, communicating, and attacking IoT devices. It was designed as a mini Cat that integrates the powerful ESP32C6, GPS, microSD and OLED.

    79 parts183GPL-3.0
  • 4 layers38.4 × 128.5 mmPlantpal, the printed circuit board in 3D

    Plantpal

    teapotlaboratories/plantpal

    Your pal in plant care

    121 parts98MIT
  • 2 layers153.2 × 95.3 mmSkean, the printed circuit board in 3D

    Skean

    krikun98/Skean

    Wireless-first 44-key split keyboard with the Jian's stagger and the Corne's thumb cluster

    80 parts68
  • 2 layers51 × 23.1 mmFeather rak3172, the printed circuit board in 3D

    Feather rak3172

    teapotlaboratories/feather-rak3172

    Teapotlabs Feather RAK3172: Low-cost Low-power LoRaWAN Development Board

    53 parts43MIT
  • 2 layers133 × 114.7 mmBlade right, the printed circuit board in 3D

    Blade right

    ufan/mykeyboard

    A collection of pcb boards designed by me

    106 parts23
  • 2 layers92.1 × 78.1 mmPaperd ink rev3, the printed circuit board in 3D

    Paperd ink rev3

    paperdink/paperd.ink_hw

    Hardware files for paperd.ink

    92 parts9CC-BY-SA-4.0
  • 2 layers133.8 × 110.4 mmKeyboard right, the printed circuit board in 3D

    Keyboard right

    daehyeok/Corne_EEC

    Corne ECWL based keyboard

    108 parts6MIT

Questions

How big is the PUYA Prototype PY32F030F28P6TU PCB?

It measures 21.4 × 26.5 mm and has 2 copper layers, 1.6 mm thick.

What parts does the PUYA Prototype PY32F030F28P6TU use?

41 parts, built around the PY32F030F28P6TU and XC6220B331MR-G. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the PUYA Prototype PY32F030F28P6TU KiCad files?

From the ElectronicCats/puya-projects repository on GitHub, at the commit this page was made from: the board is hardware/PUYA_Prototype_PY32F030F28P6TU/PUYA_Prototype_PY32F030F28P6TU.kicad_pcb and its schematic hardware/PUYA_Prototype_PY32F002AA15M6TU/PUYA_Prototype.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the PUYA Prototype PY32F030F28P6TU design in my own project?

Its repository states no licence, so its author keeps all rights: ask ElectronicCats before reusing the design.