USB Sensor Node

Created a project doc

PCB Layout Review — Programmable Function Generator

View Document

Board outline set to 100 mm × 80 mm with 2 mm rounded corners. Stackup set to 4 copper layers for USB, SPI, analog output, and multi-rail po...
PCB layout placement is complete on a 100 × 80 mm, 4-layer board: USB/power is on the left, LT3471 power is lower-left, DDS/control/conditioning are central, and the THS3091/BNC output is on the right. I ran placement, DRC, and BOM checks; details are captured in PCB Layout Review.
Open items:
  • Board is not routed yet, so airwires are expected.
  • DRC still reports exposed-pad footprint copper overlap on U3, U6, and U10.
  • Generic resistors/capacitors/inductors still need final orderable MPNs for assembly.
Suggested next steps:
  1. Repair or replace U3/U6/U10 exposed-pad footprints.
  2. Assign real MPNs/packages to generic passives and inductors.
  3. Route the PCB, then re-run full DRC.
Fix footprints and BOM
Fix footprint overlaps
Assign passive MPNs
Route the PCB
Run full checks
X1
J3
J1
U4
U9
U7 V_{SS} - C31 P1
U1 SOURCE - C2 P1
R3 P2 - U4 PA11[PA9]
R30 P2 - R31 P1
R15 P2 - R16 P1
U1 VCC - C1 P1
U4 PA7 - U5 SDATA
U6 A2 - R14 P1
U7 V_{SS} - C31 P1
U5 VDD - C7 P1
U8 VIN- - R26 P2
R32 P2 - R33 P1
U5 CAP/2.5V - C9 P1
U4 PA15 - U7 ~{CS}
U10 OUT 2 - R24 P1
U4 VBAT - U4 VREF+
R28 P2 - R29 P1
U4 PF2-NRST - R8 P2
U6 A1 - R13 P1
U5 VDD - C7 P1
U1 SOURCE - C2 P1
U1 EN - R5 P2
J1 DN1 - J1 DN2
U1 VCC - C1 P1
U1 VCC - C1 P1
U1 SOURCE - C2 P1
J1 VBUS__1 - U1 VCC
U4 VBAT - U4 VREF+
U1 EN - R5 P2
U7 V_{SS} - C31 P1
U3 VREF - C22 P1
U3 ~SHDN~/SS2 - R35 P2
U7 V_{SS} - C31 P1
U7 V_{DD} - C30 P1
U6 A1 - R13 P1
U5 VDD - C7 P1
X1 OUT - U5 MCLK
U9 VREFIO - C18 P1
U7 V_{DD} - C30 P1
U4 PA5 - U5 SCLK
U4 PF2-NRST - R8 P2
U6 A2 - R14 P1
U6 EN - R11 P2
U3 ~SHDN~/SS1 - R34 P2
U1 ILIMIT - R6 P1
U4 PA14-BOOT0 - R7 P1
U3 ~SHDN~/SS1 - R34 P2
U5 COMP - C10 P1
R20 P2 - R21 P2
U4 PA13 - J3 SWDIO/TMS
R20 P2 - R21 P2
U7 V_{DD} - C30 P1
R22 P2 - R23 P1
R28 P2 - R29 P1
U7 V_{SS} - C31 P1
U4 PA13 - J3 SWDIO/TMS
U1 SOURCE - C2 P1
U7 V_{SS} - C31 P1
U7 V_{DD} - C30 P1
J1 DP1 - J1 DP2
U4 PA5 - U5 SCLK
U7 V_{DD} - C30 P1
U6 EN - R11 P2
U5 VDD - C7 P1
U7 V_{DD} - C30 P1
R32 P2 - R33 P1
U6 A2 - R14 P1
U1 SOURCE - C2 P1
J1 DN1 - J1 DN2
U6 EN - R11 P2
U7 W - U8 VIN+
U4 PA15 - U7 ~{CS}
R4 P2 - U4 PA12[PA10]
U10 OUT 2 - R24 P1
U7 V_{SS} - C31 P1
U4 VBAT - U4 VREF+
U5 VDD - C7 P1
R3 P2 - U4 PA11[PA9]
R15 P2 - R16 P1
R32 P2 - R33 P1
U4 PA7 - U5 SDATA
U5 VDD - C7 P1
U5 VDD - C7 P1
U9 SPI2C - R10 P1
U6 D - R22 P1
U4 PA5 - U5 SCLK
U4 PA8 - R15 P1
U3 ~SHDN~/SS1 - R34 P2
U4 PF2-NRST - R8 P2
U7 V_{DD} - C30 P1
U1 SOURCE - C2 P1
U4 PA7 - U5 SDATA
R21 P1 - U10 OUT 1
U5 CAP/2.5V - C9 P1
R17 P2 - C20 P1
U1 GATE - C3 P1
R30 P2 - R31 P1
J1 DP1 - J1 DP2
U7 W - U8 VIN+
U4 VBAT - U4 VREF+
R17 P2 - C20 P1
U8 VIN- - R26 P2
U3 SW2 - L2 P2
J1 DN1 - J1 DN2
U4 PA6 - U7 SDO
U9 VREFIO - C18 P1
U3 SW2 - L2 P2
U5 VDD - C7 P1
U7 V_{SS} - C31 P1
U3 VREF - C22 P1
U5 VDD - C7 P1
U3 SW1 - L1 P2
U3 VREF - C22 P1
U7 V_{SS} - C31 P1
U4 PA5 - U5 SCLK
U8 VOUT - R26 P1
R30 P2 - R31 P1
U4 VBAT - U4 VREF+
J1 DP1 - J1 DP2
U9 VOUT - R20 P1
J1 CC2 - R2 P1
U5 COMP - C10 P1
U7 V_{SS} - C31 P1
U8 VOUT - R26 P1
U1 SOURCE - C2 P1
J1 CC2 - R2 P1
U3 SW1 - L1 P2
U4 PA7 - U5 SDATA
R4 P2 - U4 PA12[PA10]
U3 ~SHDN~/SS2 - R35 P2
U4 PA14-BOOT0 - R7 P1
R22 P2 - R23 P1
U5 VOUT - R17 P1
U6 A0 - R12 P1
R32 P2 - R33 P1
U5 VDD - C7 P1
R17 P2 - C20 P1
C25 P2 - D2 A
U9 VOUT - R20 P1
U7 V_{SS} - C31 P1
U10 -IN 2 - R24 P2
U3 SW1 - L1 P2
U10 OUT 2 - R24 P1
J1 CC1 - R1 P1
U4 PB0 - U9 ~SYNC~/A0
J1 DN1 - J1 DN2
U5 VDD - C7 P1
U6 A0 - R12 P1
U7 V_{DD} - C30 P1
J1 CC1 - R1 P1
U10 -IN 2 - R24 P2
R15 P2 - R16 P1
U4 PA4 - U5 ~FSYNC
U7 V_{DD} - C30 P1
J1 VBUS__1 - U1 VCC
U5 VDD - C7 P1
U5 VDD - C7 P1
R20 P2 - R21 P2
R28 P2 - R29 P1
J1 CC2 - R2 P1
U6 A1 - R13 P1
U7 V_{DD} - C30 P1
J1 DP1 - J1 DP2
R21 P1 - U10 OUT 1
U4 VBAT - U4 VREF+
C25 P2 - D2 A
U4 PA6 - U7 SDO
U4 PA8 - R15 P1
C25 P2 - D2 A
U7 V_{DD} - C30 P1
U6 A0 - R12 P1
U7 V_{SS} - C31 P1
U1 ILIMIT - R6 P1
U4 PF2-NRST - R8 P2
U8 VOUT - R26 P1
U1 GATE - C3 P1
U4 PA14-BOOT0 - R7 P1
U4 VBAT - U4 VREF+
U8 VIN- - R26 P2
U10 -IN 2 - R24 P2
U3 SW2 - L2 P2
U4 PA6 - U7 SDO
U5 VDD - C7 P1
U1 SOURCE - C2 P1
U9 SPI2C - R10 P1
U3 VREF - C22 P1
X1 OUT - U5 MCLK
U5 VOUT - R17 P1
U5 VDD - C7 P1
U5 VDD - C7 P1
U1 SOURCE - C2 P1
U6 D - R22 P1
U5 VDD - C7 P1
R22 P2 - R23 P1
R30 P2 - R31 P1
U4 PB0 - U9 ~SYNC~/A0
U4 PA4 - U5 ~FSYNC
U3 ~SHDN~/SS2 - R35 P2
R21 P1 - U10 OUT 1
U1 SOURCE - C2 P1
J1 CC1 - R1 P1
U5 VDD - C7 P1
R10
Resistance
10kΩ
C23
Capacitance
4.7uF
C28
Capacitance
330nF
R6
Resistance
2kΩ
C30
Capacitance
100nF
R28
Resistance
49.9Ω
C24
Capacitance
4.7uF
R35
Resistance
4.7kΩ
R34
Resistance
4.7kΩ
C25
Capacitance
1uF
R7
Resistance
10kΩ
R21
Resistance
10kΩ
C7
Capacitance
100nF
C37
Capacitance
6.8uF
R17
Resistance
100Ω
R23
Resistance
10kΩ
R4
Resistance
22Ω
C10
Capacitance
10nF
C15
Capacitance
100nF
C9
Capacitance
100nF
R9
Resistance
10kΩ
R24
Resistance
2.32kΩ
R2
Resistance
5.1kΩ
R33
Resistance
150kΩ
R1
Resistance
5.1kΩ
C6
Capacitance
10uF
C8
Capacitance
10uF
R12
Resistance
100kΩ
R13
Resistance
100kΩ
C29
Capacitance
330nF
C14
Capacitance
100nF
C2
Capacitance
10uF
R16
Resistance
10kΩ
R31
Resistance
4.99kΩ
R29
Resistance
1MΩ
C33
Capacitance
100nF
R32
Resistance
10kΩ
R3
Resistance
22Ω
R25
Resistance
1kΩ
R26
Resistance
866Ω
C4
Capacitance
1uF
C34
Capacitance
100nF
R11
Resistance
10kΩ
R5
Resistance
300kΩ
C32
Capacitance
100nF
C31
Capacitance
100nF
C1
Capacitance
1uF
C12
Capacitance
4.7uF
R27
Resistance
95.3Ω
R8
Resistance
10kΩ
R15
Resistance
45.3kΩ
R30
Resistance
69.8kΩ
C16
Capacitance
100nF
C35
Capacitance
100nF
R22
Resistance
10kΩ
R14
Resistance
100kΩ
C26
Capacitance
47pF
C18
Capacitance
150nF
C5
Capacitance
1uF
C20
Capacitance
1nF
R20
Resistance
10kΩ
C19
Capacitance
100nF
C11
Capacitance
100nF
C21
Capacitance
4.7uF
C36
Capacitance
6.8uF
C22
Capacitance
100nF
C17
Capacitance
1uF
C3
Capacitance
100pF
C13
Capacitance
100nF
C27
Capacitance
22pF
D1
J1 GND__1 - J1 GND
U7 GND - C30 P2
J1 GND__1 - J1 GND
U5 AGND - C7 P2
U2 GND - C4 P2
C20 P2 - R16 P2
U7 GND - C30 P2
U5 AGND - C7 P2
U7 GND - C30 P2
U2 GND - C4 P2
C20 P2 - R16 P2
U7 GND - C30 P2
U5 AGND - C7 P2
J1 GND__1 - J1 GND
U7 GND - C30 P2
U2 GND - C4 P2
U3 GND - C22 P2
J1 GND__1 - J1 GND
C20 P2 - R16 P2
U5 AGND - C7 P2
U3 GND - C22 P2
U2 GND - C4 P2
U2 GND - C4 P2
D2
U5 AGND - C7 P2
U3 GND - C22 P2
U3 GND - C22 P2
U2 GND - C4 P2
J1 GND__1 - J1 GND
U5 AGND - C7 P2
U5 AGND - C7 P2
U5 AGND - C7 P2
U7 GND - C30 P2
C20 P2 - R16 P2
U7 GND - C30 P2
C20 P2 - R16 P2
GND
C20 P2 - R16 P2
U2 GND - C4 P2
J1 GND__1 - J1 GND
U3 GND - C22 P2
J1 GND__1 - J1 GND
U3 GND - C22 P2
U2 GND - C4 P2
U7 GND - C30 P2
J1 GND__1 - J1 GND
GND
GND
U3 GND - C22 P2
GND
U5 AGND - C7 P2
GND
U2 GND - C4 P2
GND
GND
C20 P2 - R16 P2
GND
U5 AGND - C7 P2
GND
GND
GND
U5 AGND - C7 P2
U5 AGND - C7 P2
U7 GND - C30 P2
U2 GND - C4 P2
U7 GND - C30 P2
U5 AGND - C7 P2
C20 P2 - R16 P2
U3 GND - C22 P2
C20 P2 - R16 P2
U3 GND - C22 P2
J1 GND__1 - J1 GND
U2 GND - C4 P2
J1 GND__1 - J1 GND
U5 AGND - C7 P2
L3
Inductance
10uH
L1
Inductance
10uH
J2
U1
U2
U8
L2
Inductance
10uH
D3
U6
U10
U3
U5
U7

Refine this doc
Ask about this doc
Firmware Starter — STM32G0B1CBT6 Function Generator
Platform & Toolchain
  • MCU: STM32G0B1CBT6
  • Framework: STM32 HAL
  • Build system: STM32CubeIDE / CMake / PlatformIO STM32 HAL project
  • USB: USB FS device on PA11/PA12; suggested user interface is USB CDC serial commands.
Pin Mapping

Table


FunctionMCU PinNetConnected ToDirectionNotes
USB DMPA11USB_DMUSB-C D- via 22 ΩUSBUSB FS device
USB DPPA12USB_DPUSB-C D+ via 22 ΩUSBUSB FS device
SPI SCKPA5SPI1_SCKAD9833, AD5290, DAC80501OutputSPI1
SPI MOSIPA7SPI1_MOSIAD9833 SDATA, AD5290 SDI, DAC SDINOutputSPI1
SPI MISOPA6SPI1_MISOAD5290 SDOInputOpen-drain SDO has 10 kΩ pull-up
DDS CSPA4DDS_CSAD9833 FSYNCOutputActive low
Digipot CSPA15DIGIPOT_CSAD5290 CSOutputActive low
DAC CSPB0DAC_CSDAC80501 SYNCOutputActive low
Square outputPA8SQUARE_TIMERSquare attenuatorTimer outputTIM1_CH1 target
Mux enablePB9MUX_ENADG758 ENOutputAlso 10 kΩ pull-up
Mux A0PB6MUX_A0ADG758 A0OutputSelects waveform channel
Mux A1PB7MUX_A1ADG758 A1OutputSelects waveform channel
Mux A2PB8MUX_A2ADG758 A2OutputSelects waveform channel
SWDIOPA13SWDIOSWD headerDebug10-pin SWD
SWCLK/BOOT0PA14SWCLK_BOOT0SWD header, BOOT0 pull-downDebug/boot10 kΩ pull-down
ResetPF2-NRSTNRSTSWD reset, RC resetReset10 kΩ + 100 nF
Register/Device Notes
  • AD9833: 16-bit SPI frames, data clocked on SCLK falling edge; FSYNC low during each 16-bit frame. Frequency word = freq * 2^28 / 25e6.
  • AD5290: 8-bit SPI data, CS rising edge loads wiper register; 0 = minimum, 255 = maximum.
  • DAC80501: 24-bit SPI frames; internal 2.5 V reference enabled by default. Configure gain for 0–2.5 V output range before using offset trim.
  • ADG758: EN high enables mux. Address 0 selects S1 = DDS path. Address 1 selects S2 = square path.
Complete Firmware Source Skeleton

C


#include "main.h"
#include <stdint.h>
#include <stdbool.h>
#include <math.h>

SPI_HandleTypeDef hspi1;
TIM_HandleTypeDef htim1;

#define DDS_CS_GPIO_Port      GPIOA
#define DDS_CS_Pin            GPIO_PIN_4
#define SQUARE_GPIO_Port      GPIOA
#define SQUARE_Pin            GPIO_PIN_8
#define DIGIPOT_CS_GPIO_Port  GPIOA
#define DIGIPOT_CS_Pin        GPIO_PIN_15
#define DAC_CS_GPIO_Port      GPIOB
#define DAC_CS_Pin            GPIO_PIN_0
#define MUX_A0_GPIO_Port      GPIOB
#define MUX_A0_Pin            GPIO_PIN_6
#define MUX_A1_GPIO_Port      GPIOB
#define MUX_A1_Pin            GPIO_PIN_7
#define MUX_A2_GPIO_Port      GPIOB
#define MUX_A2_Pin            GPIO_PIN_8
#define MUX_EN_GPIO_Port      GPIOB
#define MUX_EN_Pin            GPIO_PIN_9

#define AD9833_MCLK_HZ        25000000UL
#define AD9833_B28            0x2000
#define AD9833_RESET          0x0100
#define AD9833_FREQ0          0x4000
#define AD9833_PHASE0         0xC000
#define AD9833_MODE_TRI       0x0002
#define AD9833_SLEEP12        0x0040

static void Error_Handler(void) { __disable_irq(); while (1) {} }

static void gpio_write(GPIO_TypeDef *port, uint16_t pin, bool high) {
    HAL_GPIO_WritePin(port, pin, high ? GPIO_PIN_SET : GPIO_PIN_RESET);
}

static void spi_tx(uint8_t *data, uint16_t len) {
    if (HAL_SPI_Transmit(&hspi1, data, len, HAL_MAX_DELAY) != HAL_OK) Error_Handler();
}

static void ad9833_write16(uint16_t word) {
    uint8_t b[2] = { (uint8_t)(word >> 8), (uint8_t)(word & 0xFF) };
    gpio_write(DDS_CS_GPIO_Port, DDS_CS_Pin, false);
    spi_tx(b, 2);
    gpio_write(DDS_CS_GPIO_Port, DDS_CS_Pin, true);
}

static void ad9833_set_frequency(float hz, bool triangle) {
    if (hz < 1.0f) hz = 1.0f;
    if (hz > 1000000.0f) hz = 1000000.0f;
    uint32_t fw = (uint32_t)((hz * 268435456.0f) / (float)AD9833_MCLK_HZ);
    ad9833_write16(AD9833_B28 | AD9833_RESET | (triangle ? AD9833_MODE_TRI : 0));
    ad9833_write16(AD9833_FREQ0 | (fw & 0x3FFF));
    ad9833_write16(AD9833_FREQ0 | ((fw >> 14) & 0x3FFF));
    ad9833_write16(AD9833_PHASE0);
    ad9833_write16(AD9833_B28 | (triangle ? AD9833_MODE_TRI : 0));
}

static void ad5290_set_wiper(uint8_t value) {
    gpio_write(DIGIPOT_CS_GPIO_Port, DIGIPOT_CS_Pin, false);
    spi_tx(&value, 1);
    gpio_write(DIGIPOT_CS_GPIO_Port, DIGIPOT_CS_Pin, true);
}

static void dac80501_write24(uint8_t addr, uint16_t data) {
    uint8_t b[3] = { (uint8_t)(addr & 0x0F), (uint8_t)(data >> 8), (uint8_t)data };
    gpio_write(DAC_CS_GPIO_Port, DAC_CS_Pin, false);
    spi_tx(b, 3);
    gpio_write(DAC_CS_GPIO_Port, DAC_CS_Pin, true);
}

static void mux_select(uint8_t channel) {
    gpio_write(MUX_EN_GPIO_Port, MUX_EN_Pin, true);
    gpio_write(MUX_A0_GPIO_Port, MUX_A0_Pin, channel & 0x01);
    gpio_write(MUX_A1_GPIO_Port, MUX_A1_Pin, channel & 0x02);
    gpio_write(MUX_A2_GPIO_Port, MUX_A2_Pin, channel & 0x04);
}

static void square_set(float hz, float duty_percent) {
    if (hz < 1.0f) hz = 1.0f;
    if (hz > 1000000.0f) hz = 1000000.0f;
    if (duty_percent < 1.0f) duty_percent = 1.0f;
    if (duty_percent > 99.0f) duty_percent = 99.0f;

    uint32_t timer_clk = HAL_RCC_GetPCLK2Freq();
    uint32_t period = (uint32_t)((float)timer_clk / hz);
    if (period < 2) period = 2;
    __HAL_TIM_SET_AUTORELOAD(&htim1, period - 1);
    __HAL_TIM_SET_COMPARE(&htim1, TIM_CHANNEL_1, (uint32_t)((period * duty_percent) / 100.0f));
    HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_1);
}

void functiongen_set_sine(float hz, uint8_t amplitude_code, uint16_t zero_code) {
    mux_select(0);                 // ADG758 S1 = DDS path
    dac80501_write24(0x08, zero_code);
    ad5290_set_wiper(amplitude_code);
    ad9833_set_frequency(hz, false);
}

void functiongen_set_triangle(float hz, uint8_t amplitude_code, uint16_t zero_code) {
    mux_select(0);                 // AD9833 shares same analog VOUT pin
    dac80501_write24(0x08, zero_code);
    ad5290_set_wiper(amplitude_code);
    ad9833_set_frequency(hz, true);
}

void functiongen_set_square(float hz, float duty_percent, uint8_t amplitude_code, uint16_t zero_code) {
    square_set(hz, duty_percent);
    mux_select(1);                 // ADG758 S2 = attenuated MCU square
    dac80501_write24(0x08, zero_code);
    ad5290_set_wiper(amplitude_code);
}

static void MX_GPIO_Init(void) {
    __HAL_RCC_GPIOA_CLK_ENABLE();
    __HAL_RCC_GPIOB_CLK_ENABLE();
    GPIO_InitTypeDef g = {0};

    HAL_GPIO_WritePin(GPIOA, DDS_CS_Pin | DIGIPOT_CS_Pin, GPIO_PIN_SET);
    HAL_GPIO_WritePin(GPIOB, DAC_CS_Pin | MUX_EN_Pin, GPIO_PIN_SET);

    g.Mode = GPIO_MODE_OUTPUT_PP;
    g.Pull = GPIO_NOPULL;
    g.Speed = GPIO_SPEED_FREQ_HIGH;
    g.Pin = DDS_CS_Pin | DIGIPOT_CS_Pin;
    HAL_GPIO_Init(GPIOA, &g);
    g.Pin = DAC_CS_Pin | MUX_A0_Pin | MUX_A1_Pin | MUX_A2_Pin | MUX_EN_Pin;
    HAL_GPIO_Init(GPIOB, &g);
}

static void MX_SPI1_Init(void) {
    __HAL_RCC_SPI1_CLK_ENABLE();
    hspi1.Instance = SPI1;
    hspi1.Init.Mode = SPI_MODE_MASTER;
    hspi1.Init.Direction = SPI_DIRECTION_2LINES;
    hspi1.Init.DataSize = SPI_DATASIZE_8BIT;
    hspi1.Init.CLKPolarity = SPI_POLARITY_HIGH;
    hspi1.Init.CLKPhase = SPI_PHASE_2EDGE;
    hspi1.Init.NSS = SPI_NSS_SOFT;
    hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16;
    hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB;
    hspi1.Init.TIMode = SPI_TIMODE_DISABLE;
    hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
    if (HAL_SPI_Init(&hspi1) != HAL_OK) Error_Handler();
}

static void MX_TIM1_Init(void) {
    __HAL_RCC_TIM1_CLK_ENABLE();
    htim1.Instance = TIM1;
    htim1.Init.Prescaler = 0;
    htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
    htim1.Init.Period = 63;
    htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
    htim1.Init.RepetitionCounter = 0;
    if (HAL_TIM_PWM_Init(&htim1) != HAL_OK) Error_Handler();
    TIM_OC_InitTypeDef s = {0};
    s.OCMode = TIM_OCMODE_PWM1;
    s.Pulse = 32;
    s.OCPolarity = TIM_OCPOLARITY_HIGH;
    s.OCFastMode = TIM_OCFAST_DISABLE;
    if (HAL_TIM_PWM_ConfigChannel(&htim1, &s, TIM_CHANNEL_1) != HAL_OK) Error_Handler();
}

int main(void) {
    HAL_Init();
    SystemClock_Config();          // Generate with CubeMX for 64 MHz system clock and USB clock.
    MX_GPIO_Init();
    MX_SPI1_Init();
    MX_TIM1_Init();

    functiongen_set_sine(1000.0f, 128, 32768); // startup: 1 kHz sine, mid amplitude, nominal zero trim

    while (1) {
        // TODO: parse USB CDC commands such as:
        // WAVE SINE|TRI|SQUARE, FREQ <Hz>, AMP <0..255>, DUTY <1..99>, ZERO <0..65535>
        HAL_Delay(10);
    }
}
Build & Flash
  • Generate STM32CubeMX project for STM32G0B1CBT6 with USB device, SPI1 on PA5/PA6/PA7, TIM1_CH1 on PA8, and GPIO outputs listed above.
  • Build in STM32CubeIDE or with cmake --build if using STM32Cube CMake export.
  • Flash using SWD header J3 with STM32CubeProgrammer or ST-LINK.
  • Platform & Toolchain

  • Pin Mapping

  • Register/Device Notes

  • Complete Firmware Source Skeleton

  • Build & Flash

Programmable Function Generator

Programmable Function Generator thumbnail
Programmable 1 Hz–1 MHz function generator PCB with sine, triangle, and adjustable-duty square outputs, programmable amplitude up to ±10 V using a DDS-based signal path and protected power rails.

Properties

Properties describe core aspects of the project.

Pricing & Availability

Distributor

Qty 1

Arrow

$36.81–$51.23

Digi-Key

$20.00

HQonline

$22.03–$22.05

LCSC

$57.46–$57.88

Mouser

$67.08

TME

$10.80

Verical

$25.68–$47.67

Controls