STM32Cube - joric/ts80player GitHub Wiki

I am not using STM32Cube IDE, only automake. You could use STM32CubeMX to regenerate new port mapping (all those autogenerated lines in the code are done by STM32CubeMX).

Player

The player code is based on the stm32 wav player by Ole Bauck. TIM1 works as DMA at 32000Hz (mono) 16-bit samples a second. TIM2 when buffer is empty. LD2 pin is 1-bit beeper, PA8 is analog audio output (TIM1_CH1 specific).

TS80 needs TIM3_CH1 and DMA_Channel6 to play audio on PA6. The player is capable of playing high quality audio (not just beeping), I am still figuring out the details. It only plays mono sound, because TS80 tip only uses two outermost pins (with the K-type thermocouple in series).

Issues

  • no double buffering, HAL_TIM_PWM_PulseHalfFinishedCallback is never called for some reason
  • speed is off comparing with Bluepill (underclocked MCU on TS80?)
  • doesn't sound too well on the iron, looks like the heater adds distortion to the signal

Display

The ssd1306 display code is based on the stm32-ssd1306 library by Aleksander Alekseev. The TS80 OLED display (96x16) appears to work in 128x32 mode just fine, so you can just crop the output.

Building

To build that you need STM32CubeF1. Add path to the unpacked archive to the Makefile, run make. In my case:

FIRMWARE = /mnt/c/SDK/STM32CubeF1

References