Author Archives: mcturra2000

About mcturra2000

Computer programmer living in Scotland.

More thoughts on #RP2040 vs #STM32

In a previous post, I shared my thoughts on what I thought are my two favourite mcus: the Raspberry Pi Pico, and the STM32. The STM32F411 seems a particularly popular choice. I have a blackpill, and I got a Nucleo … Continue reading

Posted in Uncategorized | Leave a comment

Some sawtooth pwm wave mathematics (#stm32f411, dma)

Sawtooth waves are a useful way of experimenting with pwm signals. I prefer them over sine waves for testing purposes, as the sharpness of their maximum and minimums make it easier to spot signal distortions when viewing them on an … Continue reading

Posted in Uncategorized | Leave a comment

K.I.S.S. #stm32f4 HAL PWM fixed frequency and duty cycle

Today I’m going to look at producing a PWM pulse of fixed frequency and duty cycle. You will need to choose a PWM-compatable pin. I chose PA11. The pins will have a timer and channel associated with them, according to … Continue reading

Posted in Uncategorized | Leave a comment

K.I.S.S. #stm32 HAL blinky LED.

The HAL seems to be the most popular library when developing for the STM32. I hate the CubeIDE with a vengeance, though. It’s slow and bloated. It’s based on Java, so no wonder. I have set up VSCode on Linux, … Continue reading

Posted in Uncategorized | Leave a comment

Kicking the tyres of ZephyrOS

Brief note: I decided to give ZephyrOS a try on my STM32 blackpill. I’m pleased to report that it works. ZephyrOS was most definitely not a breeze to install. Pun intended. I think installation is something they’re working on. Yes, … Continue reading

Posted in Uncategorized | Leave a comment

“CrunkyOS”: sound from SD card now works on #RaspberryPi0

I’m putting together a very crude unikernel-type system for the Raspberry Pi 0. I’m really pleased with my progress: I can read a song stored on an SD card into memory and play it via PWM. Here’s the code for … Continue reading

Posted in Uncategorized | Leave a comment

#rp2040: Using DMA to set SPI DAC (MCP4921)

Good news: I managed to get DMA working on an MCP4921 DAC, which uses SPI. It’s my first time trying to get DMA working on the Raspberry Pi Pico, so I was a little bit daunted. Here the code which … Continue reading

Posted in Uncategorized | Leave a comment

#RP2040 SD card with limited FAT32 support

I’ve updated my sdcard project to include some FAT32 reading. Make sure a FAT32 partition is on the first partition of the card. So far, the driver is read-only. Drop a file called song.raw into the partition and it will … Continue reading

Posted in Uncategorized | Leave a comment

Upgraded to Debian Bullseye

I decided to jump the gun and update my Debian Stable from Buster to Bullseye. The upgrade was smooth enough, and I’m pleased to report no problems. The download was large, though, over 4G. I shouldn’t have been surprised, I … Continue reading

Posted in Uncategorized | Leave a comment

OLED #rp2040 C++ library gets a blocking boost

I’m continuing to refine my OLED I2C library. I sped up the library 10X by the simple expedient of increasing the baudrate of the I2C transfer. Transferring a whole 128×64 bitmap to OLED still took about 12ms. I wanted more … Continue reading

Posted in Uncategorized | Leave a comment