Git Product home page Git Product logo

stm32f411-black-pill-usb-wav-mp3-player's Introduction

STM32F411 "Black Pill" USB WAV/MP3 Player

Project description

This is just a training project that reads, parses and plays WAV/MP3 files using PCM5102A I2S DAC.
Uses a STM32F411CE "Black Pill" board running at 96MHz.
MP3 decoding is done with the library "Spirit MP3 decoder", freely available from ST.

For simplicity, only 44.1KHz, 16-bit stereo files are supported.
MP3 format is not checked! It assumes your MP3 is on the correct format.
Any bitrate should work, either VBR or CBR.
WAV files are checked and skipped if not valid.

PCM5102A connections are as follows:

  • SCK: Unconnected, uses self-generated PLL clock. Pull this pin to gnd in the DAC.
  • BCK: PB13
  • DIN: PB15
  • LRCK: PB12

Few waveforms:





The SWO output is enabled on PB3, you can see the debug messages using SWO console.
You can see them without debugging, just connect the ST-Link utility, open "Prinf via SWO viewer", setting clock to 96000000Hz.

For more details, check:

  /Inc/files.h
  /Inc/i2sAudio.h
  /Src/files.c
  /Src/i2sAudio.c

How to use

Connect a FAT32-formatted USB drive with wav/mp3 files in the root folder (/), it will automatically start playing all files found in a loop .
Press "Key" button (PA0) to skip current song.

Firmware

You can download already compiled binaries in the Release folder (mp3 player.bin file)
If you want to compile your own:

  • Download STM32 Cube IDE
  • Clone or download the code
  • Open STM32 Cube IDE, import existing project and select the folder where the code is.
  • It should recognize it and be ready for compiling or modifying for your own needs.

The code is stripped from most ST libraries, so you need to regenerate them.
Inside the IDE, open cubeMX (Double click the .ioc file) file and click on the code generation button.

CubeMx will make new code, and now it will compile correctly.

stm32f411-black-pill-usb-wav-mp3-player's People

Contributors

deividalfa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.