Skip to the content
PCBKitNew board
2 layers19.3 × 31.8 mmPUYA Prototype, the printed circuit board in 3D

PUYA Projects

Size
19.3 × 31.8 mm
Copper layers
2
Thickness
1.6 mm
Parts
26
Nets
13
Pads
44
Tracks, vias
120, 23
Pours
1
Routed
Yes
KiCad
KiCad 7 (file 20221018)
Created
19 May 2023
Updated
18 Feb 2025

Overview

PUYA Prototype is an open-source printed circuit board by ElectronicCats, from the ElectronicCats/puya-projects repository on GitHub. It is a 2-layer board of 19.3 × 31.8 mm with 26 parts on 13 nets, routed with 120 tracks and 23 vias.

It is built around the PY32F002AA15M6TU and AP2112K-3.3TRG1. Its parts include 3 capacitors, 3 connectors, 2 resistors, 2 ICs and 1 diode.

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

26
QtyValueFootprintReferences
21uFCapacitor_SMD:C_0805_2012MetricC1, C2
10.1uFCapacitor_SMD:C_0805_2012MetricC3
110KResistor_SMD:R_0805_2012MetricR2
1330RResistor_SMD:R_0805_2012MetricR1
1AP2112K-3.3TRG1Package_TO_SOT_SMD:TSOT-23-5U2
1G***kibuzzard-646D3B4Akibuzzard-646D3B4A
1G***kibuzzard-646D3C54kibuzzard-646D3C54
1G***kibuzzard-646D3CABkibuzzard-646D3CAB
1G***kibuzzard-646D3C24kibuzzard-646D3C24
1G***kibuzzard-646D3CA0kibuzzard-646D3CA0
1G***kibuzzard-646D3B19kibuzzard-646D3B19
1G***kibuzzard-646D3CFDkibuzzard-646D3CFD
1G***kibuzzard-646D3C07kibuzzard-646D3C07
1G***kibuzzard-646D3CBCkibuzzard-646D3CBC
1G***kibuzzard-646D3A66kibuzzard-646D3A66
1G***kibuzzard-646D3BD4kibuzzard-646D3BD4
1G***kibuzzard-646D3C34kibuzzard-646D3C34
1LOGOAesthetics:electronic_cats_logo_8x6G***
1L_TerminalConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ2
1ONLED_SMD:LED_0805_2012MetricD1
1PY32F002AA15M6TULibrarie:PY32F002AA15MU1
1R_TerminalConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ3
1SWDConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ1
1SW_RSTButton_Switch_SMD:SW_SPST_TL3342SW1

The 25 most common of 26 parts.

Questions

How big is the PUYA Prototype PCB?

It measures 19.3 × 31.8 mm and has 2 copper layers, 1.6 mm thick.

What parts does the PUYA Prototype use?

26 parts, built around the PY32F002AA15M6TU and AP2112K-3.3TRG1. 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 KiCad files?

From the ElectronicCats/puya-projects repository on GitHub, at the commit this page was made from: the board is hardware/PUYA_Prototype_PY32F002AA15M6TU/PUYA_Prototype.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 design in my own project?

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

More from ElectronicCats/puya-projects

1

Similar boards

  • 2 layers84 × 37.7 mmSidebar, the printed circuit board in 3D

    Sidebar

    Professor-plum/SaintCon-RE-Topper

    A reverse engineering themed SaintCon 2024 badge topper

    9 parts3MIT
  • 2 layers16.7 × 14.4 mmSolderingChallenge, the printed circuit board in 3D

    SolderingChallenge

    ElectronicCats/SolderingChallenge

    The classic Soldering challenge

    28 parts2MIT
  • 2 layers11.2 × 16.3 mmPY32F002 ESSOP10 minimal board, the printed circuit board in 3D

    PY32F002 ESSOP10 minimal board

    michpro/PY32F002_ESSOP10_minimal_board

    Puya PY32F002A ARM M0+ minimal development board (ESSOP10 package)

    9 parts1CERN-OHL-P-2.0
  • 2 layers50 × 50 mmBADGE MALWARE SPACE-2025, the printed circuit board in 3D

    BADGE MALWARE SPACE-2025

    ElectronicCats/BADGE-MALWARE-SPACE-2025

    Prerequisites: You must have the Arm GNU Toolchain ( ) installed on your system.

    23 parts
  • 4 layers100 × 50 mmController, the printed circuit board in 3D

    Controller

    usbalbin/hw-half-bridge

    226 parts
  • 2 layers39 × 26 mmConnector, the printed circuit board in 3D

    Connector

    Professor-plum/SAINTCON-BADGE-2026

    Electronic badge for SAINTCON2026

    8 parts5MIT
  • 2 layers45.6 × 50 mmAddon Websec, the printed circuit board in 3D

    Addon Websec

    ElectronicCats/Badge_Tropicon-2026

    Badge Oficial Tropicon 2026

    22 parts1