Alright, after weeks of being too busy to do anything, it's finally time again for some #LuBuildsAMonosynth today!

My goal for today is to test the DACs built into the STM32F446 if they're suitable for producing at least passable audio and to maybe experiment a bit with generating different waveforms, depending on how much time is left.

And since #VimClassic was released a couple of days ago, I'll use this as an opportunity to install and test-drive that as well.

#LuBuildsAMonosynth

Built and installed Vim Classic now. Got Editorconfig and Wayland clipboard integration to work again after a bit of head-scratching and installing two plugins from source.

I usually don't install software from outside the Debian repos, so not too sure how I feel about this yet.

#LuBuildsAMonosynth

Before writing any code, I wanted to see if a 12bit DAC would even theoretically be enough to produce decent-sounding audio. So I went ahead and made a little experiment by exporting raw audio data as signed 16bit samples from Audacity and filtering that with a quick-and-dirty C program that ANDs all samples with 0xFFFC. The result sounds indistinguishable to the original, at least to my ears, so I'll go right ahead with testing the built-in DAC next.

#LuBuildsAMonosynth

Got sidetracked a bit, but sat down again in the evening to read the docs on the DAC and timer. Spent waaay too much time figuring out what clock the Nucleo board actually uses too ๐Ÿ™ƒ. But I think I now have a clear-enough picture of how things work to be able to proceed. So the next steps are modifying my blinky LED program to use a proper timer and then setting up the DAC with the timer at ~44100Hz to output a simple sawtooth wave.

#LuBuildsAMonosynth

welp, managed to lock myself out of the STM32 ๐Ÿซ ...

Probably has something to do with my program entering sleep mode inhibiting the programmer/debugger to connect.

I'll try and find a fix today, but probably it will have to wait until tomorrow.

#LuBuildsAMonosynth

oh, it was easier than I thought. just had to hold down the reset button while connecting the debugger. :-)

#LuBuildsAMonosynth

That timer interrupt just won't fire. I tried pretty much everything: The timer itself is running and seems to auto-reset at roughly the correct interval (verified the counter register in GDB), the interrupt is enabled in the timer control register and in the NVIC and the handler is placed in the interrupt table at the correct location (otherwise my fallback handler would have fired). But still, no luck.

I'll get some sleep now and try again tomorrow.

#LuBuildsAMonosynth

@lu_leipzig ๐Ÿ‘๐Ÿผ Genau. Morgen kommt die Lรถsung von allein ... ๐Ÿ™‹๐Ÿผโ€โ™‚๏ธ