Author Archives: mcturra2000

About mcturra2000

Computer programmer living in Scotland.

My #rp2040 dev board wish-list

Here’s what I want to see in a dev board: Put the pins closer together (longitudinally, of course) so that the board can be inserted into a standard 40-pin IC socket. Forget castellations. Number the pins on the topside of … Continue reading

Posted in Uncategorized | Leave a comment

A nightmare function to kill you in your sleep in #golang

Clickbait title much? I am not a golang programmer. I’m mostly C/C++. I had played with golang many many years ago. I didn’t like it much at the time. I recently thought about parsing a binary file using golang, but … Continue reading

Posted in Uncategorized | Leave a comment

ANN: ssd1306 clean-up for rp2040

One of these days I’ll actually figure out suitable abstractions for libraries. The big problem is that it different SDKs use different APIs, so how can we rationalise them all into one big blob that works? Everything starts out as … Continue reading

Posted in Uncategorized | Leave a comment

Some thoughts on libopencm3

My random thoughts on libopencm3, in no particular order Where’s my Raspberry Pi Pico RP2040 port? I haven’t used it for awhile, but I’m thinking of getting back into it. I veer towards either the HAL or roll-my-own on CMSIS. … Continue reading

Posted in Uncategorized | Leave a comment

A barely working I2C DS3231 for the Pico RP2040

One “trick” I learned back in the late 90’s is that compiling code is easy if you just delete the stuff that doesn’t compile. With this in mind … I wanted to get a DS3231 accurate clock working for my … Continue reading

Posted in Uncategorized | Leave a comment

Drum sequencer using stm32l432kc, cmsis, #raspberrypi, #dlang

I’m on TikTok now. Go grampa! None of my videos will show loot unboxings like the young and beautiful people do, though. I wanted to share a little drum sequencer I made. There’s not much to look at, because hey, … Continue reading

Posted in Uncategorized | Leave a comment

A buffering DAC for #raspberrypi using #stm32

Rationale Linux is not an RTOS (real-time OS), so you can’t reliably use timers to produce music without creating distortions. It is possible to use libraries, such as portaudio, to produce music with proper music output. The problem is that … Continue reading

Posted in Uncategorized | Leave a comment

Sending data over I2C using bit-banging

This post shows how to send data from an STM32 using the HAL. Hints on adapting it to other mcus is also given. So it is useful for actually understanding the mechanics of sending data. CubeMX In CubeMX, set PA9 … Continue reading

Posted in Uncategorized | Leave a comment

A simple ring buffer for microcontrollers

The simplest thing that could possibly work: It assumes that data is of type uint32_t. Adjust it to suit your taste. Call cb_init() in your startup code. A discussion of circular (aka ring) buffers can be found here. I am … Continue reading

Posted in Uncategorized | 1 Comment

STM32L432KC SPI LL IRQ slave using

Assumptions: STM32L432KC SPI receive-only slave SPI1 Use of the CubeIDE Low-Level library Interrupt-handling of received data 16-bit data (easily changed) “The simplest thing that could possibly work” Let me first define an auxiliary function: Then call the following functions in … Continue reading

Posted in Uncategorized | Leave a comment