While shopping for parts for my next project, I came across these $2 MP3 players from China. They are about 2AA batteries in size. It has all the I/O I'll ever need in a project. It even comes in an inconspicuous injection molded case making easy to hide your gadget/key/bitcoin keeper in plain sight.
There is already a project: China cheap MP3 player hack which uses my favorite STM32F030. It is missing some of the features that I am looking for. I initially started off with the board outline and I/O placements from that project, but quickly realized that they are not aligned correctly with my high resolution scan of the MP3 player PCB. This is why I have decided to start my project from scratch and try to document my design process so that others may improve upon.
I am using a far more capable STM32F103 with native USB interface, dual ADC, dual SPI and a lot more memory. It is used in Blue Pill breakout board and can be found for around $2 from China with some minor differences. It is a popular platform and there are a lot of open source projects for the F103.
- STM32F103 64kB FLASH, 20kB RAM, up to 72MHz.
- Mini-USB: USB 1.1 Full Speed (12Mbps) device, charging, SWD debug using special cable.
- 128x64 LCD
- Micro SD slot for SD/SDHC.
- 3.5mm Stereo - multiple I/O functions are available
e.g. 3.3V TTL serial, ADC, PWM, I2C and serial bootstrap.
- 5 push buttons, On/Off switch
- ~100mA Hr LiPO battery, LTC4054 charger.
Low power design
The device is powered from internal Li-ion battery. LTC4054 is used for charging the battery from USB. LDO is used to power the main circuits.
The RTC and backup RAM location are backup from the battery. A pair of silicon diodes is used to drop the battery voltage down as a single diode drops might not be enough at uA range. Diodes consume no quiescent current (vs a LDO).
From Elm-Chan: How to Use MMC/SDC
MicroSD can draw a lot of current and introduce a droop during hot-insertion. This can reset the microcontroller or affect results of ADC. Previously I have used a switch mode supply with a fast transient response and have seen much less droop.
The XC6206P332MR and other ultra low quiescent current LDO make compromises for low bandwidth/transient response. It has a slow recovery time for a sudden load. While you can pile lot of passives to undo the manufacturer's design decision on $0.04 parts, it is cheaper and takes much less space to simply use 2 separate supplies for the microcontroller and the MicroSD.
I wired 2 GPIO in parallel (saving one MOSFET) to control the power to the LCD backlight (probably around 20mA).
A few of the I/O peripherals are wired together in parallel to provide different functions.
Here are the mappings to the peripherals.
The I/O can be programmed in the following modes.
When they are programmed as Analog, the input buffers are turned off and output disconnected. This allows the other 2 digital GPIOs...Read more »