a simple toy audio player

Preface

The goal was to make a simple low cost audio player like can be found in Chinese toys. The second goal was to learn about ARM microcontrollers, the system is built around a ST STM32F030F4.

The system contains the following parts:

  • A simple File System
  • SPI Flash storage
  • A terminal program to write WAV files to the File System
  • A 8KHz mono WAV player with up sampler to 32KHz
  • 32KHz 8-bit PWM to drive the speaker
  • A state machine to control which file to play
  • A trick to save the previous state during Standby mode

High Level schematic

The hardware/software design can be found at github: https://github.com/MvdLande/Toy-Audio

Currently I have build Hardware V1 Rev A. The player uses a 32KHz PWM signal to directly drive the speaker using a N-MOSFET. I’m using a 32KHz signal to play a 8KHz WAV file, the speaker and the human ear will filter out the undesired frequencies. a DC signal of Vcc/2 is always applied to this speaker. It works, but I’m going for V2 which has a low pass filter to filter the PWM signal and an audio amplifier. Using Hardware V1 I have replaced the 8 Ohm speakers with 16Ohm because the can become hot while playing a long song. Version V1 started as a proof of concept. The code is a little messy. I might clean it up later on. The current software support 2 WAV files, which can be loaded using a Terminal program with Y-modem (like Tera Term)

Hardware:

20160207_233113 20160207_233131

 

Schematic: Hardware V1 Rev : A

 

 

 

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s