STM-32 Minimum Audio Board

Waiting for hours, he designed the device on the STM32. In terms of functionality, it was thought to implement a simple voice recorder or player and see how much sound processing is possible on the STM32F103 family, at least using Fixed-Point.



To implement the minimum audio card, I took a controller that has a DAC, an ADC and can work with an SD card not only by SPI but also preferably via SDIO. STM32F103RCT6 is suitable. I ordered 5 pieces on Ali for $ 7 with a penny, in case something goes wrong. The display and a handful of electret microphones are in stock. I think I’ll take quartz resonators to ChipDip.

Developing in the development environment STM32CubeIDE32 is very convenient. You can configure HAL in CubeIDE, and then do the circuitry of the connections.



Controller Specifications


STM32F103RCT6 3xADC 1xDAC, SDIO, USB. It also has I2S. In the future, you can connect an audio chip.

For debug and fill, use the SWDIO SDCLK ​​pins. You can flash via UART or USB, but I have not tried the STM32F103 Bootloader (bootloader) . STM32 - enter the bootloader by button .

STM32F103RCT6




Controller wiring diagram. The display is connected via I2C1. Jumper SJ3 can set the address at which you can access the display 0x7A or 0x78.

128x64 OLED




The card is connected via SDIO. You can also connect via SPI, but the exchange rate will be slower. SDIO in my case works on 4 lines and, in addition, the SPI interface for the memory card is not “native”. I pulled up some of the outputs, the rest will be pulled up programmatically. Without a software brace, one line will be activated.

SD CARD




The microphone and headphone amplifier is the TS922 dual operational amplifier. As I already wrote in the article, it draws up to 80 mA, which is quite enough for headphones. The second part of the chip is a microphone amplifier. Capacitors in the feedback circuit are a high-pass filter. The gain is K = 1 + Roc / R or 1 + 5100/510 = 11 using the example of a headphone amplifier. How to calculate other elements is in the same article. I made a common voltage divider to set the bias at the input of the opamp. thereby saving a couple of components. Is this approach good? It was corrected on the advice of Khabrovchan

Amplifiers




Power is made via USB LM1117-3.3V.



6 buttons are added and some conclusions are brought out.



PS While designing the board on stm32f103, I came across the STM32F411 series. For the price of 2-3 dollars, a full core CortexM4!
Arm Cortex-M4 32b MCU + FPU, 125 DMIPS, 512KB Flash, 128KB RAM, USB OTG FS, 11 TIMs, 1 ADC, 13 comm. interfaces

It is already possible to play with DSP. Implement IIR filter and reverb and much more.

Realtime Audio DSP on STM32F4



But that will be another story.

Autodesk Eagle:



STM32AudioLCDMinimal

Comments and suggestions are welcome.

All Articles