Saturday, August 6, 2016

DFPlayer MP3 module - high quiescent power consumption and clicks when power applied and removed - FIX!

The DFPlayer is a great little MP3 player module at a fantastic price, but there's a really odd design choice; it has a high quiescent current of about 25ma, requiring you to cut the power to it with a PFET when not in use, and, worse, it suffers from power on/off clicks when you do that.

The schematic of the module is basically the reference design from here (the mp3 player chip vendor's page)
http://www.yxin18.com/kp/2015102450.html
and they're using a bog-standard no-name 8-pin 8002 audio amplifier chip (in this case a class AB one, not a PAM8002 which is class D, but hey, the whole board costs about a buck), anyway it's a BTL amplifier, so + and - are both floating at VCC/2 when no sound is playing.

This requires the amp to put a little care into avoiding pops/clicks when power is applied and removed, and the 8002 designers kinda did this already; here's a generic 8002 amp datasheet;
http://thaieasyelec.com/downloads/EFDV308/HXJ8002_Miniature_Audio_Amplifier_Datasheet.pdf

They have both a SHUTDOWN pin and a bias cap so that the speaker ramps up and down subsonically... 

Anyway looking at the DFPlayer board I see they just have the SHUTDOWN pin (pin 1) wired to GND, i.e. always-on, via a 0-ohm resistor (if you look next to pin 1 on the 8-pin chip on a generic DFPlayer module, there's a "000" resistor next to it).
What's totally bizarre is that the MP3 player chip is set up to output a "BUSY/IDLE" signal (comes out on pin 1 of the DFPlayer module) which is the right polarity and basically ideal to drive the SHUTDOWN on the 8002 amplifer.

..and lo and behold, if you pull off the 0-ohm resistor and wire pin 1 of the 8002 straight to the BUSY output pin of the module - you get a double win - no more power on/off clicks at all (now totally silent) AND halves the quiescent power consumption of the module (takes about 10mA off it).

WTF? No idea why they didn't do this... Anyway, there's your easy fix...  now you can gate the power to the entire module (still necessary, it sucks down >10ma even when not doing anything) but at least it doesn't click when you do it....

EDIT: Aaaaahhh.. they did, it's an option. Looking at the underside of the board there's  unpopulated pads opposite the 0R resistor; remove the 0R and put it on the other pads and it connects SHUTDOWN to BUSY :-)


DFPlayer MP3 module - high quiescent power consumption and clicks when power applied and removed - FIX!

The DFPlayer is a great little MP3 player module at a fantastic price, but there's a really odd design choice; it has a high quiescent current of about 25ma, requiring you to cut the power to it with a PFET when not in use, and, worse, it suffers from power on/off clicks when you do that.

The schematic of the module is basically the reference design from here (the mp3 player chip vendor's page)
http://www.yxin18.com/kp/2015102450.html
and they're using a bog-standard no-name 8-pin 8002 audio amplifier chip (in this case a class AB one, not a PAM8002 which is class D, but hey, the whole board costs about a buck), anyway it's a BTL amplifier, so + and - are both floating at VCC/2 when no sound is playing.

This requires the amp to put a little care into avoiding pops/clicks when power is applied and removed, and the 8002 designers kinda did this already; here's a generic 8002 amp datasheet;
http://thaieasyelec.com/downloads/EFDV308/HXJ8002_Miniature_Audio_Amplifier_Datasheet.pdf

They have both a SHUTDOWN pin and a bias cap so that the speaker ramps up and down subsonically... 

Anyway looking at the DFPlayer board I see they just have the SHUTDOWN pin (pin 1) wired to GND, i.e. always-on, via a 0-ohm resistor (if you look next to pin 1 on the 8-pin chip on a generic DFPlayer module, there's a "000" resistor next to it).
What's totally bizarre is that the MP3 player chip is set up to output a "BUSY/IDLE" signal (comes out on pin 1 of the DFPlayer module) which is the right polarity and basically ideal to drive the SHUTDOWN on the 8002 amplifer.

..and lo and behold, if you pull off the 0-ohm resistor and wire pin 1 of the 8002 straight to the BUSY output pin of the module - you get a double win - no more power on/off clicks at all (now totally silent) AND halves the quiescent power consumption of the module (takes about 10mA off it).

WTF? No idea why they didn't do this... Anyway, there's your easy fix...  now you can gate the power to the entire module (still necessary, it sucks down >10ma even when not doing anything) but at least it doesn't click when you do it....




Thursday, August 4, 2016

Seriously optimizing power consumption on a STM8F103F3P6 "minimum system board"

You know, these things, they're all over EBay

Anyway, when running off 3.3v (not using the USB connector) and putting them into the lowest power mode I could find (ACTIVE-HALT using the AWU to wake it up once a second) I was still seeing several milliamps power consumption; was expecting a hundred microamps or thereabouts;

To achieve this;
a) (Obviously) Remove the "PWR" led (or take off the resistor on the underside) to save a few mA
b) Remove the 3.3v regulator(!!) this was the main problem; was leaking about 2.2mA when back-powered with 3.3v

Down to about 178uA now (with internal main voltage regulator (MVR) on) running off internal LSI clock, which is nicely just under the datasheet's quoted 200uA.

With the MVR off in halt and the flash powered down (and again waiting up with AWU at 1hz to do practically nothing), i.e.
FLASH_SetLowPowerMode(FLASH_LPMODE_POWERDOWN);
CLK_SlowActiveHaltWakeUpCmd(ENABLE);

we're down to 38uA!!! Sweeeet!