hardware features - owntech-foundation/SPIN GitHub Wiki

The SPIN board focuses on delivering a simple and elegant solution for power electronics control specifically for very high-precision measurements and PWM generation. This page explains the features of the board, its schematics, and pins.

Board sub-systems

There are 4 main sub-systems inside the SPIN board.

  • The USB connection and its protection
  • The LDO
  • The JTAG
  • The Microcontroller

The image below illustrates their interconnection.

graph LR
    subgraph ide1 [SPIN]
    B[USB] --> C[Protection]    
    C --> |Data| E    
    C --> |+5V| D[LDO]
    D --> |+3.3V| E[Micro-Controller]
    F[JTAG] --> E
    end

The USB Connection and protection

Using a classic USB-C connector, this part allows the user to connect to the computer to either send data and/or power the SPIN board.

USB_connector_and_TVS_protection_schematic

The schematic of the USB connector and its TVS protection.

There are three protections in this board.

  1. Electrostatic discharges and Overvoltages protection (TVS)
  2. Computer reverse current/voltage protection (Diode)
  3. Computer USB port short circuit (PTC fuse)

The LDO

The USB provides the board with +5VDC power. However, the microcontroller requires +3.3V, which is provided via an onboard low dropout (LDO) component. Its schematics are given in the image below.

ldo_circuit_schematics

The schematics of the LDO implementation used in the SPIN board

Important note: The stability of the LDO requires a dedicated resistor to raise the equivalent series resistance (ESR) of its output capacitor. This is done by resistor R1 in the schematic above.

For safety reasons, a PTC fuse is connected to the input of the LDO to protect the microcontroller from short-circuits.

The JTAG

A JTAG allows programming the microcontroller when it does not have a bootloader or using advanced debugging features when necessary. Its schematic is shown in the image below.

jtag_spin_schematics

Schematics of the JTAG implementation in the SPIN board

Notice the pull down resistor needed by the STLINKv3 to operate.

The microcontroller block

The microcontroller is the brain of the power converter. To drive power electronics, power converters require:

  • A high-resolution PWM peripheral to allow very precise control of the voltage, current, or power in the input or output,
  • A PWM peripheral that supports different types of modulation, mainly left-aligned and center-aligned
  • A very strict timing of the ADC trigger, which provides a very good control of the noise in the measurements used by the control
  • A dedicated floating point unit peripheral for fast calculations needed by complex control loops
  • Support for communication peripherals, which provides the power converter with the means of deploying high-level control algorithms

All of these features are present in the microcontroller used in the spin board, the SMT32G474RE. It was implemented onto the SPIN with a few support sub-systems, shown in the image below.

graph LR
    subgraph ide1 [STM32G474RE]
    B[HSE] --> G[IC]   
    C[Dec. Cap.] -->G   
    D[BOOT] -->G
    E[RST] --> G
    G --> F[LEDs]
    end

HSE Oscillator

The High-Speed External Oscillator (HSE) was chosen to match the design present in the nucleoG474RE board. Its schematic is shown below.

HSE_schematic_spin

Schematic of the crystal oscillator implemented in the SPIN board

The capacitors were chosen to match the 24MHz frequency and chosen according to the datasheet criteria explained in the image above.

Decoupling Capacitors

Powering the MCU requires not only a +3.3VDC supply from the LDO but also a good noise rejection. This is achieved with the decoupling capacitors whose schematics are shown in the image below.

decoupling_capacitors_mcu_spin

Details of the decoupling capacitors chosen to filter the input voltage of the spin board.

A ferrite bead is introduced to filter common mode noise, providing the analog pins with the +3.3VA, which is a stable DC potential.

A voltage reference of 2048mV is also filtered, providing the board with a clear and stable voltage to be used with its ADC peripherals.

The RST and BOOT buttons

Two buttons were deployed in the SPIN board:

  • The RESET (RST) to reset the MCU
  • The BOOT button to trigger the bootloader into a mode that allows the user to upload the code

The bootloader function has been developed in a more advanced state, and now it is possible to flash the microcontroller via USB without pressing the button. Their schematic detail is shown in the image below.

schematic_RST_BOOT_buttons_spin

Detail of the schematic showing both buttons

Notice that the GPIO used by the bootloader is the PC14 as it provides no advanced feature to the board.

Finally, the MCU will be detailed below by exposing its pins and their functions.

Pins and roles

The SPIN board gives access to all but one pin of the STM32G474RE. The pins, their names, and their functions are detailed in the image below.

schematic_castellated_holes_spin_board

Detail of the pins available at the castellated hole edges of the SPIN board and its inner holes on the right

There are several groups of pins available at the edges of the board. Notice that ground pins are regularly connected. This guarantee a good signal integrity on the board. Also, notice that the SPIN board comes with inner holes which can be connected to unlock extra features.

The holes are mainly used for:

  • HRTIM PWM pins: available at the HRTIM_CHXX pins
  • Measurement pins: These pins are the input ports of the microcontroller ADCs. In the current implementation, ADC1 and ADC2 are available. Other ADCs will be made available in the longer term, but their pins are already accessible.
  • SPI pins: Used to communicate in SPI between micro-controllers
  • USART pins: Used as serial communication pins by the micro-controller