https://www.digikey.com/en/maker/tutorials/2026/how-to-embed-assembly-code-into-arduino-sketches
Good Article. I am facing same problem when I was toggling outlines & waveform was much slower the mcu & its given I/O speed. Same is possible with arduino STM32 arm MCU series?