2 min read · Automation

What matters about the G4 is its mixed-signal and timer capability in the variant you choose. For measurement work tied to a control signal, the timing of each sample matters more than how fast you can read averaged values on Serial. Starting with a simulated signal lets you learn triggering and timing checks without involving a power circuit.
What this covers and the order of experiments
- Plan which event triggers the ADC and which reference time you need to record.
- Check the sampling time, the signal source and the ADC limits in the chip's documentation.
- Use a timer and DMA where appropriate, to reduce waiting and CPU load.
- Check the waveform with a measuring instrument and compare it with the values the firmware recorded, instead of trusting the code alone.
Exercise and practical example
Exercise: simulate reading a low-voltage waveform that stays within the input range, then compare a blocking read in a loop with timer-triggered sampling.
Limits and what else to check
This exercise is not a guide to building an inverter or controlling a high-power motor. Power devices, protection circuits and safety need their own design.
Manufacturer documents worth reading
- STM32G4
- STM32CubeMX
References
- STM32G4 (accessed 2026-11-21)
- STM32CubeMX (accessed 2026-11-21)




