# victortagayun/basic_dsmps_tutorial architecture

> Architecture diagram of the GitHub repository victortagayun/basic_dsmps_tutorial, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/victortagayun/basic_dsmps_tutorial
- Repository: https://github.com/victortagayun/basic_dsmps_tutorial

## Overview

This repository is tutorial firmware for configuring STM32 boards to demonstrate digital-SMPS timing—not a complete power converter or feedback-control product. The workflow is to initialize clocks and peripherals, generate a timed HRTIM waveform, acquire ADC samples at a selected timer event, and inspect GPIO/ADC timing on external instruments. The F334 variant includes an ADC interrupt handler and callback; the G474 variant has its own firmware entry and conversion callback. README capabilities are shown where useful, but unsampled implementation details and peripheral wiring are not inferred.

Main entry points: [`NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c`](https://github.com/victortagayun/basic_dsmps_tutorial/blob/main/NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c) (F334 Firmware), [`NUCLEO-G474RE_DSMPS_Tutor/Core/Src/main.c`](https://github.com/victortagayun/basic_dsmps_tutorial/blob/main/NUCLEO-G474RE_DSMPS_Tutor/Core/Src/main.c) (G474 Firmware), [`NUCLEO-F334R8_DSMPS_Tutor/Core/Src/stm32f3xx_it.c`](https://github.com/victortagayun/basic_dsmps_tutorial/blob/main/NUCLEO-F334R8_DSMPS_Tutor/Core/Src/stm32f3xx_it.c) (F334 ADC ISR)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_firmware["Board Firmware"]
  node_f334_main["F334 Firmware<br/>[main.c]"]
  node_f334_irq["F334 ADC ISR<br/>[stm32f3xx_it.c]"]
  node_g474_main["G474 Firmware<br/>[main.c]"]
end

subgraph group_timing["Timing And Sampling"]
  node_f334_clock["F334 Clock Setup<br/>[main.c]"]
  node_f334_hrtim["F334 HRTIM<br/>[main.c]"]
  node_f334_adc["F334 ADC Setup<br/>[main.c]"]
  node_f334_callback["F334 ADC Callback<br/>[main.c]"]
  node_g474_hrtim["G474 HRTIM<br/>[main.c]"]
  node_g474_adc["G474 ADC Setup<br/>[main.c]"]
  node_g474_callback["G474 ADC Callback<br/>[main.c]"]
end

subgraph group_observation["Measurement And Debug"]
  node_gpio_debug["GPIO Timing Debug<br/>[main.c]"]
  node_scope(("Oscilloscope"))
  node_rc_setup["RC Test Circuit"]
  node_adc_pin(("ADC Pin Signal"))
end

node_engineer(("Engineer"))

node_engineer -->|"runs firmware"| node_f334_main
node_engineer -->|"runs firmware"| node_g474_main
node_f334_main -->|"configures"| node_f334_clock
node_f334_main -->|"initializes and starts"| node_f334_hrtim
node_f334_main -->|"initializes and starts"| node_f334_adc
node_f334_hrtim -->|"triggers conversion"| node_f334_adc
node_f334_irq -.->|"dispatches callback"| node_f334_callback
node_f334_callback -->|"updates compare"| node_f334_hrtim
node_f334_irq -->|"toggles timing pin"| node_gpio_debug
node_f334_callback -->|"marks conversion"| node_gpio_debug
node_g474_main -->|"initializes and starts"| node_g474_hrtim
node_g474_main -->|"initializes and starts"| node_g474_adc
node_g474_hrtim -.->|"triggers conversion"| node_g474_adc
node_g474_callback -->|"reads sample"| node_g474_adc
node_gpio_debug -->|"probes timing"| node_scope
node_f334_hrtim -->|"shows waveform"| node_scope
node_rc_setup -->|"drives test input"| node_adc_pin
node_adc_pin -->|"probes acquisition"| node_scope

click node_f334_main "https://github.com/victortagayun/basic_dsmps_tutorial/blob/main/NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c"
click node_f334_irq "https://github.com/victortagayun/basic_dsmps_tutorial/blob/main/NUCLEO-F334R8_DSMPS_Tutor/Core/Src/stm32f3xx_it.c"
click node_g474_main "https://github.com/victortagayun/basic_dsmps_tutorial/blob/main/NUCLEO-G474RE_DSMPS_Tutor/Core/Src/main.c"
click node_f334_clock "https://github.com/victortagayun/basic_dsmps_tutorial/blob/main/NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c"
click node_f334_hrtim "https://github.com/victortagayun/basic_dsmps_tutorial/blob/main/NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c"
click node_f334_adc "https://github.com/victortagayun/basic_dsmps_tutorial/blob/main/NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c"
click node_f334_callback "https://github.com/victortagayun/basic_dsmps_tutorial/blob/main/NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c"
click node_g474_hrtim "https://github.com/victortagayun/basic_dsmps_tutorial/blob/main/NUCLEO-G474RE_DSMPS_Tutor/Core/Src/main.c"
click node_g474_adc "https://github.com/victortagayun/basic_dsmps_tutorial/blob/main/NUCLEO-G474RE_DSMPS_Tutor/Core/Src/main.c"
click node_g474_callback "https://github.com/victortagayun/basic_dsmps_tutorial/blob/main/NUCLEO-G474RE_DSMPS_Tutor/Core/Src/main.c"
click node_gpio_debug "https://github.com/victortagayun/basic_dsmps_tutorial/blob/main/NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_f334_main,node_f334_irq,node_g474_main toneBlue
class node_f334_clock,node_f334_hrtim,node_f334_adc,node_f334_callback,node_g474_hrtim,node_g474_adc,node_g474_callback toneAmber
class node_gpio_debug,node_scope,node_rc_setup,node_adc_pin toneMint
class node_engineer toneIndigo
```

## Components

### Board Firmware

- [F334 Firmware](https://github.com/victortagayun/basic_dsmps_tutorial/blob/main/NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c): `NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c`
- [F334 ADC ISR](https://github.com/victortagayun/basic_dsmps_tutorial/blob/main/NUCLEO-F334R8_DSMPS_Tutor/Core/Src/stm32f3xx_it.c): `NUCLEO-F334R8_DSMPS_Tutor/Core/Src/stm32f3xx_it.c`
- [G474 Firmware](https://github.com/victortagayun/basic_dsmps_tutorial/blob/main/NUCLEO-G474RE_DSMPS_Tutor/Core/Src/main.c): `NUCLEO-G474RE_DSMPS_Tutor/Core/Src/main.c`

### Timing And Sampling

- [F334 Clock Setup](https://github.com/victortagayun/basic_dsmps_tutorial/blob/main/NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c): `NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c`
- [F334 HRTIM](https://github.com/victortagayun/basic_dsmps_tutorial/blob/main/NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c): `NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c`
- [F334 ADC Setup](https://github.com/victortagayun/basic_dsmps_tutorial/blob/main/NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c): `NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c`
- [F334 ADC Callback](https://github.com/victortagayun/basic_dsmps_tutorial/blob/main/NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c): `NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c`
- [G474 HRTIM](https://github.com/victortagayun/basic_dsmps_tutorial/blob/main/NUCLEO-G474RE_DSMPS_Tutor/Core/Src/main.c): `NUCLEO-G474RE_DSMPS_Tutor/Core/Src/main.c`
- [G474 ADC Setup](https://github.com/victortagayun/basic_dsmps_tutorial/blob/main/NUCLEO-G474RE_DSMPS_Tutor/Core/Src/main.c): `NUCLEO-G474RE_DSMPS_Tutor/Core/Src/main.c`
- [G474 ADC Callback](https://github.com/victortagayun/basic_dsmps_tutorial/blob/main/NUCLEO-G474RE_DSMPS_Tutor/Core/Src/main.c): `NUCLEO-G474RE_DSMPS_Tutor/Core/Src/main.c`

### Measurement And Debug

- [GPIO Timing Debug](https://github.com/victortagayun/basic_dsmps_tutorial/blob/main/NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c): `NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c`
- **Oscilloscope**
- **RC Test Circuit**
- **ADC Pin Signal**

### Other components

- **Engineer**

## Connections

- Engineer → F334 Firmware: runs firmware (evidence: `readme.md`)
- Engineer → G474 Firmware: runs firmware (evidence: `readme.md`)
- F334 Firmware → F334 Clock Setup: configures (evidence: `NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c`)
- F334 Firmware → F334 HRTIM: initializes and starts (evidence: `NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c`)
- F334 Firmware → F334 ADC Setup: initializes and starts (evidence: `NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c`)
- F334 HRTIM → F334 ADC Setup: triggers conversion (evidence: `NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c`)
- F334 ADC ISR → F334 ADC Callback: dispatches callback
- F334 ADC Callback → F334 HRTIM: updates compare (evidence: `NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c`)
- F334 ADC ISR → GPIO Timing Debug: toggles timing pin (evidence: `NUCLEO-F334R8_DSMPS_Tutor/Core/Src/stm32f3xx_it.c`)
- F334 ADC Callback → GPIO Timing Debug: marks conversion (evidence: `NUCLEO-F334R8_DSMPS_Tutor/Core/Src/main.c`)
- G474 Firmware → G474 HRTIM: initializes and starts (evidence: `NUCLEO-G474RE_DSMPS_Tutor/Core/Src/main.c`)
- G474 Firmware → G474 ADC Setup: initializes and starts (evidence: `NUCLEO-G474RE_DSMPS_Tutor/Core/Src/main.c`)
- G474 HRTIM → G474 ADC Setup: triggers conversion (evidence: `NUCLEO-G474RE_DSMPS_Tutor/Core/Src/main.c`)
- G474 ADC Callback → G474 ADC Setup: reads sample (evidence: `NUCLEO-G474RE_DSMPS_Tutor/Core/Src/main.c`)
- GPIO Timing Debug → Oscilloscope: probes timing (evidence: `readme.md`)
- F334 HRTIM → Oscilloscope: shows waveform (evidence: `readme.md`)
- RC Test Circuit → ADC Pin Signal: drives test input (evidence: `readme.md`)
- ADC Pin Signal → Oscilloscope: probes acquisition (evidence: `readme.md`)
