Close

Schematics: PMIC

A project log for FunKey project - All your games on your keychain !

Fun-on-a-Keychain is back, packing all your games and multiple emulators in a cute and extremely tiny handheld console.

Squonk42Squonk42 04/24/2019 at 21:520 Comments

From the previous logs, we can summarize the V3s power supply requirements to:

On the LicheePi Zero board used in our FunKey Zero prototype, a triple SMPS EA3036 is used for generating these +3.3V, +1.8V  and +1.2V voltages, with an additional XC6206 LDO for the +3.0V (the +3.3V Always On is connected directly to +3.3V). Although compact (the EA3036 is a tiny 3 mm x 3 mm QFN20 package), this solution is not ideal as it does not provide a battery charger and monitoring capability, which is a requirement for the FunKey device.

PMICs

Sophisticated SoC requiring multiple voltages, high current and proper sequencing are common today and hopefully, all major manufacturers generally provide dedicated companion chips called PMICs (Power Management Integrated Circuits), in charge of these tasks. Allwinner is not an exception through its sister company X-Powers.

Their AXP20x products are highly-integrated PMICs that are optimized for applications requiring single-cell Li-battery (Li- Ion/Polymer) and multiple output DC-DC converters.and LDOs. Here is a block diagram:

The AXP20x features:

Looking at their datasheets, it is difficult to tell the difference between the AXP202AXP203 and AXP209 (any hint welcome!). In the FunKey design, we use an AXP209 because it is the one that comes along with the V3s when you buy it on AliExpress ;-)

AXP20x Application Diagram

For complex dedicated chips like this, the best option is to follow as much as possible the application diagram and reference design given by the manufacturer, as the internals of the chips are seldom fully disclosed, so you need to take their word on some of the external component values to use.

The Allwinner V3s Reference Design contains on page 6 the schematics for using an AXP203 to supply the power to a V3s-based dashboard camera design. It follows closely the reference designs provided in the AXP20x datasheets:

More hints are provided in my self-translated V3s Hardware Design Guide (page 7) too.

FunKey PMIC Design Adaptation

The FunKey device uses all AXP209 integrated SMPS:

But compared to the sophisticated reference designs, the FunKey device only uses 2 out of the 5 integrated LDOs:

Here is the Funkey schematic block for the PMIC:

This schematic may look intimidating and complex, but it is in fact just a collection of simple basic elements, and it is actually very close to the manufacturer-recommended design.

The most noticeable difference is that the FunKey schematics use symbols and placement that are as close as possible to their corresponding physical package and layout, instead of defining symbols that are conveniently arranged by logical properties. Even if this makes schematics more complex at first sight, the benefit of this approach is that the step to go from the schematics to the physical layout become much easier, and so is the debugging of the physical board, which is then very close to the schematics too.

Another habit that is used everywhere in the FunKey schematics is that all signals (except power supplies and GND) are routed using explicit wires, rather than counting on invisible connection by net names and relying of the reader to search these names all over the place. This forces related components to be clustered in compact groups to shorten the wires, and put more focus on inter-cluster signals, with a natural inclination to unravel wire nests in the schematics before laying out the actual board.

And there are some  "PWR_FLAG" symbols added here and there, which is the proper way in KiCAD to declare that a given net has a proper supply and thus prevent the ERC (Electrical Rule Check) to throw an error.

The end of this log details each PMIC function one by one:

Power Inputs (East side)

A wall-plug AC adapter input is not used in the FunKey device, so +VIN is just filtered using C75 on pins 32 and 33.

The USB power input +VUSB on pin 31 is filtered using C70, and the best (between +VUSB and +VBAT) available voltage is output to +VOUT on pins 34 and 35 and filtered using C78.

The BACKUP supply on pin 30 is not used and is left unconnected.

Internal Connections (All sides)

Some AXP20x signals are externally available and should be connected to external components:

Additionally, the AXP20x is actually made up of separate flexible blocks that require external interconnections to set their desired operation:

DC-DC1 PWM Battery Charger (North East side)

The battery is connected to J5 (a 2-pin JST 1.0 mm pitch receptacle) and uses R21 as a precision current sense resistor, with C53/C56/C60 filter capacitors and L5 (a low-profile ferrite-core power inductor rated with a saturation current of 1.2A and low < 0.1 ohm resistance).

Please note that the battery is not protected on the board against reversing polarity, as the model used already contains a built-in protection.

R24 is mounted to simulate a battery NTC for measuring temperature, as the chosen LiPo battery does not feature this temperature sensor.

A user-programmable (through the I2C interface) charge LED D30 is provided, with its current-limiting resistor R26 (for which we need to raise the value as the LED is too bright!), as well as an TVS diode to prevent ESD, as the LED body will be accessible to to user.

DC-DC2 +1.25V / 1.6A (West side)

This SMPS is built around the ferrite core power inductor L3 and filter capacitors C26 and C29.

DC-DC3 +3.3V / 1.2A (South side)

This SMPS is built around the ferrite core power inductor L4 and filter capacitors C39 and C43.

LDO1 +3.3V Always On 30mA (South East side)

The LDO output on pin 28 is filtered with capacitor C72.

LDO2 +3.0V / 200mA (South West side)

The LDO output on pin 12 is filtered with capacitor C38.

LDO3 (North side)

This LDO is not used and its output on pin 41 is nevertheless filtered with a capacitor C63.

LDO4 (South West side)

This LDO is not used and its output on pin 11 is nevertheless filtered with a capacitor C38.

Power Key (North West side)

The AXP20x features a soft power key with internal short and long-press detection with user-programmable time settings, which enables turning power ON or OFF much like the way it is done in cellular phones.

Only a few external components are required: the tactile switch S13, its ESD protection TVS D29, and a low-pass filter R18 and C42 for debouncing the switch.

I2C Bus (North West side)

The AXP20x can be externally controlled by the main CPU using the I2C bus on pins 1 and 2. This bus has pull-up resistors to +3.3V R14 and R16, and the IRQ/WAKEUP signal on pin 48 enables warning or waking up the CPU on a selection of AXP20x-generated events, with a pull-up resistor R13 to +3.3V..

GPIOs (South and West sides)

GPIO0-3 on pins 19, 18, 5 and 3 are not used and are left unconnected.

PWROK (South West side)

The PWROK signal on pin 25 is used to generate the global RESET signal for the whole board, with a pull-up resistor R15 to the +3.3V Always On power supply.

Enable Signals (West side)

The global chip enable signal N_OE on pin 4 is always activated through a 2k resistor R17 to to GND.

The USB enable signal N_VBUSEN on pin 6 is directly tied to GND to always enable power from the USB bus.

Monitoring

Through the I2C bus and the numerous internal available registers, the AXP20x provides a very good control of its operation, including many threshold and timing settings, but also many voltage and curent monitoring values.

Coulomb Counters / Fuel Gauge

 It is well known that battery discharge voltage curve over time is very flat, making it very difficult to estimate the real charge/discharge state of the battery. Moreover, these states will vary with temperature, load, and aging.

The only accurate way to monitor the battery status is to actually count the energy that is stored when charging, and the one that is consumed. This particularly important feature is achieved in the AXP20x using a dual Coulomb counter which continuously sums the current intensity over time for monitoring the battery accurate charge and discharge status, with user-defined alert thresholds.

This fuel gauge is providing the ability to precisely report the remaining battery capacity, just like people are used to with cellular phones.

Discussions