Close
0%
0%

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.

Public Chat
Similar projects worth following
FunKey is a tiny yet comfortably playable multi-emulator handheld gaming console that anyone can carry on their keychain. Bored in transports, sleeping in class or simply having a few minutes to kill? Pop up your FunKey from your ever-carried keychain and start back your favorite game right where you left it.

Its foldable design allows for large comfortable buttons, optimized screen space, and a strong protected shell when closed, while its Allwinner 1Ghz A7 processor coupled with a full Linux distribution built from scratch are powerful enough to allow you to play your favorite retro consoles at full speed (NES, SNES, Gameboy, GBA, PS1, Sega Genesis, Sega Master System) while being optimized for battery life.

As always with our previous experiences (Keymu, Funkey Zero) the goal of FunKey is also to share the knowledge, that is why our ideas, designs, programs and experiences will all be layed out on this very page.

We hope you’ll come to love FunKey as much as we do.



Project Logs

General

Alive and Kicking
Photo shoot side by side with PocketSprite

Mechanical design

STL files and Exploded view
3D Printed prototypes before injection molding


Electronic Design

Electronic Parts
Electronic Design
Schematics: CPU
Regulated DC Power Supply Topologies
Why so many different Power Supply Voltages?
Schematics: PMIC
Schematics: DRAM Power
Schematics: SPI LCD
Schematics: Console
Schematics: Buttons
Schematics: Audio
Schematics: USB

 


A bit of History

It’s now been a bit more than two years since we entered the HaD contest with Keymu: an open-source keychain-sized multi-emulator handheld console which received quite an unexpected success.

Keymu did not pretend to be more than a prototype destined to be built by anyone willing to get their hands dirty. And even though it was often asked to be produced and sold, the world of difference between prototyping and producing kind of humbled us into taking it slowly.

We first needed to focus on correcting electrical and software issues Keymu had, that is why we started working on a new prototype without a foldable design but with almost everything new under the hood. The prototype turned out pretty great, so much so that we decided to give it a name and enter once again the HaD prize: this was last year’s FunKey Zero.

A lot has happened in a year, among which the expansion of our team of enthusiasts to the grand number of three, now bringing together the much-needed professional mechanical hindsight to our electrical+software knowledge.

Keymu and its optimized design can now be born again, merging with all FunKey Zero’s improvements, thought for production and readier than ever to bring fun on your Keychain, meet the FunKey Project.

Characteristics

Dimensions

42.5x44.5x13.8 mm

Processor & RAM

ARM Cortex-A7 @ 1.2GHz. Extensions: NEON, VFPv4.

64MB of RAM DDR2 up to 400MHz

Storage

SD card 16GB

Display

LCD IPS screen, 1.52”, 240x240 px

Audio

10 mm mono speaker, 500mW

Battery

420mAh Li-ion battery for hours of gameplay

Recharging and loading games

via Micro USB port

What’s new?

Mechanical design

FunKey’s most discernable new features is the return of the foldable design but it's only the tip of the iceberg. Everything is new here, and of course the details will be presented more thoroughly in future logs but, to get a sense, here are the main new features:

  • The casing 

Completly rethought, it is now a slimmer package than Keymu and way smaller one than Funkey Zero: only 42.5x44.5x13.8 mm when closed. 

It is also now sturdier thanks to a combination of snap/fit parts and two small screws on the back.


  •  The active hinge 

The flexible cable between the screen and the mother board now passes through the hinge without enduring any stress. The cable is actually already enrolled inside the hinge so that closing and opening the console will not fold the cable in two (like it was the case with Keymu) but keep enrolling and unrolling it instead. 

Also now, like with foldable phones, there is a satisfying snap when closing the console, and the spring in the hinge ensures that it stays firmly closed.

  •  The buttons 

The biggest improvement was done to the L/R buttons which were very tiny and unclickable on Keymu. They now are basically the whole bottom left and right side of the console: ...

Read more »

SW3dPS-JST_SM02B-SRSS-TB.STEP

Battery connector 1.0 mm pitch 3D STEP model

step - 237.13 kB - 05/15/2019 at 21:00

Download

eSH.pdf

Battery connector 1.0 mm pitch datasheet

Adobe Portable Document Format - 142.36 kB - 05/15/2019 at 21:00

Preview
Download

vls252012cx-1.step

Power inductor 3D STEP model

step - 36.80 kB - 05/15/2019 at 20:41

Download

Adobe Portable Document Format - 166.51 kB - 05/15/2019 at 20:41

Preview
Download

PRTR5V0U2X.pdf

USB ESD protection datasheet

Adobe Portable Document Format - 192.24 kB - 05/15/2019 at 20:37

Preview
Download

View all 37 files

  • 1 × AllWinner V3s Cortex-A7 1.2GHz (ARM v7-A) Processor with integrated 64MB DRAM
  • 1 × X-Powers AXP209 Power Management Unit
  • 1 × LED0402 Red LED 0402
  • 3 × Würth Electronics 74404032047 WE-LQS SMT Power Inductor
  • 1 × TDK VLS252012CX-M VLS-CX-1 SMT Power Inductor

View all 44 components

  • Schematics: SD Card

    Squonk4217 hours ago 0 comments

    The FunKey game console uses the SD Card both as its boot device and its only storage device, so a good operation of this interface is absolutely mandatory.

    The Allwinner V3s provides 2x 4-bit MMC / SD Card / SDIO interfaces. In the FunKey, only interface #0 is used.

    If you look on the Web, you will find many contradictory SD Card interface designs, with a combination of pull-up / pull-down resistors, ESD devices and power supply filtering, with all pins wired or not, such that it is very difficult to know what is really required. To better understand the situation, we need to go back to the specifications.

    Specifications

    The SD Card physical interface is provided in the "SD specifications, part 1, Physical Layer Specification version 2.00, May 9, 2006", for which a simplified version is available here.

    The MMC phyiscal interface can be found in the "Multi Media Card System Specification version 4.3, JESD84-A43, November 2007", available here (registration required).

    But a good summary of the requirements is given in the "AN10911 SD(HC)-memory card and MMC  Interface conditioning" application note from NXP, from which this schematic is taken:

    Note: This schematic does not include details concerning card-supply and typical power-supply decoupling capacitors.

    Write Protect (WP)

    A write protect mechanical switch is provided in the full-size SD Card, but not in the mini or micro SD Card form factor. As we plan to use a micro SD Card only, it is not used for the FunKey, along with its pull-up resistor and ESD protection.

    Card Detection (CD)

    As the SD Card is required to boot the FunKey, is always inserted and opening the device is requried for its removal, we don't need the optional card detect mechanical switch feature (even if the chosen connector provides it) and its related pull-up resistor and ESD protection.

    The SD Card specification provides another mean to detect the card using a card built-in pull-up resistor on its DAT3 signal, that can be later disconnected during normal operation using he SET_CLR_CARD_DETECT (ACMD42) command. In order to correctly detect if the card is inserted, a high value external pull-down resistor (> 270 kohms) is required to drive the detect signal low when no card is inserted, while the card built-in 10-50 kohms resistor will drive this signal high when inserted.

    However, this feature is not compatible with MMC cards, so its usage should be avoided and the mechanical detection is preferred.

    Pull-Up Resistors

    Both the SD Card and MMC specifications require not to leave the interface signals floating, except for the CLK signal, where a pull resistor would cause significant signal distortion because of the required high speed and short rise/fall times. OTOH, it is recommended to add a series resistor on this CLK signal as close as possible to the clock source (the CPU) to avoid ringing, as we already discussed it in the log about the CPU.

    Hopefully, the Allwinner V3s CPU provides internal pull-up resistors for all these signals, so we don't have to add external pull-up resistors. These resistors are given with a typical value of 100 kohms (50 min, 150 max). Unfortunately, the CMD signal for MMC card features an open-drain output mode, and its value should be undercut (down to 4.7 kohms) to guarantee a sufficiently short rise time in this mode.

    Schematics

    The FunKey SD Card interface schematic is the following:

    Even if in the FunKey device the SD Card and its connector are not accessible without opening the enclosure, there may be some situations where the user may decide to do so. We thus attach an ESD protection TVS diode (D16, D17, D18, D25, D26, D27, D28) on each signal to avoid any ESD hazard.

    As discussed above, a single pull-up resistor R10 is used on the CMD signal for MMC compatibility.

    The micro SD Card connector built-in card detection switch is not used, since the card must always be inserted for the FunKey to boot,...

    Read more »

  • Schematics: USB

    Squonk423 days ago 0 comments

    In the FunKey device, the USB interface has 2 purposes:

    • provide an external power supply source for both powering the device and charging the built-in LiPo battery
    • provide a data interface to transfer firmware upgrades, configuration files, game emulators and game ROMs

    The first purpose only requires the +5V USB power and GND pins. The second purpose requires to wire the additional differential data lines D+ and D-. As we only need to operate as an USB device and although the V3s is able to work as either an USB host or USB device using the USB OTG protocol, we don't need the ID pin to determine by the cable wiring which role we must take.

    The USB schematic is the following:

    Before connecting 2 devices using an USB cable, they may be at completely different absolute voltages, and during cable insertion, the shield will be in contact before the other pins, including GND. The C6 capacitor between the Protective Earth (Shield) and GND is here to provide an AC path for sinking this difference in voltage and align the GND levels when plugin the cable. 

    The resistor R4 on the USB ID connector pin should probably not be mounted: as we act only as an USB device, this pin should be left floating.

    The capacitors C7, C8, C10 and ferrite bead L2 form a constant-k 3 pole CLC low pass filter to remove any spurious in/out on the USB power supply wire. The USB 2.0 specification limits the maximum bulk capacitance value to 10 µF in order to avoid power supply excessive droops when plugin in a device with a discharged large bulk capacitor.

    D15 is a combined TVS protection diode for the VBUS pin and a set of clamping diodes that will limit the voltage on D+ and D- pins to stay between GND and VBUS levels to  in order to protect the V3s USB driver from under / over-voltages.

  • Schematics: Audio

    Squonk4205/12/2019 at 19:24 0 comments

    Playing audio is absolutely part of the gaming experience!

    So for a retro gaming console like the FunKey, we need to have a decent audio playback, despite its lilliputian size.

    By decency, we discarded the solution using a piezo-electric buzzer: these can get a loud sound in a small volume, but only at their resonance frequency, so the sound quality is extremely poor.

    Turning back to the solutions used in modern smartphones as an example, there are 2 paths to consider:

    • playing audio internally by the mean of speaker(s)
    • playing audio externally by using headphones, with or without a cord

    The speakers used in today's smartphones are rather sophisticated and achieve very good performance. However, these are using made-to-measure speakers and cavities, such that they cannot be found and reused as standard parts in a design like ours.

    As for the external audio solution, we have a problem: the FunKey is so small that it is not possible to integrate an audio jack to connect headphones! And despite our search, there is no simple and small enough way to use Bluetooth to output audio to cordless headphones either.

    The best solution we have found consists in using a single tiny speaker from CUI CDM-10008, that is able to output 72 dB spl @ 1m from a 0.3W input power, with relatively modest dimensions: 10 mm diameter and only a 2.9 mm thickness.

    Connections are not easy though, since this speaker is meant to have wires soldered to its pads, but we are trying to convert it into an SMT device in order to gain space in our small enclosure! We don't have a satisfying solution yet that is possible to use for mass production, we are still working on it!

    Schematic

    The resulting schematic is simple, as the Allwinner V3s already contains an analog stereo audio codec (coder/decoder): we only have to take one of its headphone output channel (left or right) and feed it to a mono audio amplifier.

    We chose the PAM8301 chip because of its cheap price, good availability, its more than sufficient output power of 1.5W and its filterless operation, meaning that no bulky series capacitor is required to drive the speaker.

    Here is the corresponding schematic:

    We chose the right headphone channel HPOUTR that is fed to the audio amplifier U2 through a DC-bias filter capacitor C3.

    The audio amplifier /SD shutdown input is driven by one V3s GPIO, with a pull-down resistor R2 to disable the amplifier by default.

    The audio amplifier power supply is filtered using a ferrite bead L1 in order to eliminate high-frequency digital noise, and decoupled by 2 capacitors C4 and C5, as recommended in the device datasheet.

    The speaker SP1 is driven in differential mode in order to get the maximum voltage swing and thus the maximum power available for a given output current.

    Two ESD protection TVS diodes D13 and D14 are added, since the speaker may be accessible to the user through the enclosure grid in front of the speaker.

  • Schematics: Buttons

    Squonk4205/07/2019 at 20:39 0 comments

    As a generic game console emulating many classic ones, the FunKey requires numerous buttons:

    • A soft "ON/OFF" button
    • A "+" control pad with "Up", "Down", "Left" and "Right" buttons
    • A "x" control pad with "A", "B", "X" and "Y" buttons
    •  "Start" and a "Select" buttons
    • L and R shoulder buttons

    As we have sen in the log on the PMIC, the soft "ON/OFF" button is directly connected to the power management chip, so we are left with 4 + 4 + 2 = 12 buttons for game control.

    GPIO Requirements

    The Allwinner v3s CPU comes in a large 128-pin TQFP package, with a lot of exposed (51!) GPIO pins:

    • PB0 to PB9 (10)
    • PC0 to PC3 (4)
    • PE0 to PE24 (25)
    • PF0 to PF5 (6)
    • PG0 to PG5 (6)

    The FunKey specializes some of them for specific interfaces like SDCard, PWM, SPI and I2C buses, console UART, but most of them are left available for I/Os.

    Button Interrupts

    However, in order to detect when the buttons are pressed / released efficiently, the best solution is for them to generate an IRQ (Interrupt ReQuest) to warn the CPU that the corresponding button state has changed, instead of using an inefficient regular polling method.

    Unfortunately in the V3s, only PB0 to PB9 and PG0 to PG5 support this GPIO IRQ capability. Worse, most of the pins PB0 to PB9 are already used for UART, I2C or PWM functions.

    It is possible to route these functions to different pins and recover enough IRQ-capable GPIO pins: this is what we did for our #Funkey Zero project.

    GPIO Expander

    But for the FunKey device and given the small PCB size, this solution puts a lot of constraints on the PCB routing, at such a point that we decided to use a dedicated I2C GPIO expander chip to relieve the burden from the main V3s CPU.

    A common chip for this purpose, that is well supported in the Linux kernel is NXP's PCAL6416AHF.128. It is marketed as a "low-voltage translating 16-bit I2C-bus/SMBus I/O expander with interrupt output, reset, and configuration registers": it just matches exactly what we need!

    The connection with the V3s CPU is achieved using standard I2C clock (SCL) and data (SDA) signals, plus an additional IRQ signal driven by the I/O expander when pre-programmed conditions are met, such as a key press / release event. A RESET signal driven by the PMIC PWR_GOOD output is used to initialize the chip when required.

    Schematics

    Here is the corresponding main schematic for the buttons:

    The main component is of course the I/O expander U1, with the control signals to the CPU/PMIC on the east side.

    The chip's /INT signal is pulled up to the +3V3 power supply by the resistor R1, such that the active-low interrupt signal is disabled by default.

    The I/O expander chip features 2 separate power supplies VDD and VDDP for the core and peripheral respectively, each decoupled by a bulk capacitor C1 and C2.

    Except for the GPIO I/Os, the only remaining pin is the ADDR pin 18 which provides the I2C address LSB bit, so that you can address 2 PCAL6416AHF.128 chips on the same I2C bus by wiring this pin differently.

    One oddity is that the pin 6 (P0_5) is connected to the /RESET signal: it is a routing trick to get this signal to go through this pin pad, as it was very difficult to access it otherwise...

    The "Start" and "Select" buttons S1 and S2 are 2 low-profile SMT tactile switches, each featuring an ESD protection TVS diode D8 and D5, as these buttons are of course accessible by the user!

    The other buttons are wired in the same fashion:

    The "U", "L", "D", "R", "A", "B", "X" and "Y" buttons S3, S4, S5, S6, S8, S9, S10 and S11 are of the same kind and also have a respective TVS diodes D2, D3, D4, D5, D6, D7, D8, D9, D10 and D11.

    The left (S12) and right (S7) shoulder buttons are right angle SMT tactile buttons, with their TVS diode D1 and D12.

    Benefit

    The main advantage of this solutions is that the 12 signals to wire the buttons to the CPU are replaced by only 4 signals, from which 3 are shared...

    Read more »

  • Schematics: Console

    Squonk4205/04/2019 at 20:34 0 comments

    The Allwinner V3s provides 3x UARTs (UnAsynchronous Receivers / Transmitters): UART0 with only RX and TX signals, and UART1 and UART2with additional RTS and CTS flow control signals.

    As almost all SoCs, tha Allwinner V3s provides a serial console as a control terminal for debug or normal operation. By default, it is mapped to UART0, and it is used by the BROM (Boot Rom), the U-Boot bootloader and by the Linux kernel to output messages during the boot process, and later by the Linux kernel to log messages during normal operation. Depending on the configuration, it can be used too for loging into the system over an UART.

    The Console schematic only requires a minimum of external components:

    Besides the 3-pin 1.27 mm  (0.05") pitch header J1 that will not be mounted on standard products, there is only a single series resistor R3.

    What is the purpose of this resistor?

    • As explained previously for the SD Card clock signal, this may be to prevent ringing. But given the relatively slow signal speed (115200 bps), it is not the case here
    • If it were placed on the RX input signal, this could prevent frying the input pin if a large voltage (+5V, for example) is applied to it by dissipating the excessive voltage as heat in the resistor. It is not the case here, since the resistor is on the TX output signal, but we could have one added, if only we had some space left on the board...
    • In fact, the resistor is on the output TX signal to prevent short-circuits if the serial cable is reversed and the 2 TX outputs are connected together, one driving the signal low, while the other is driving it high: again in this case, the voltage difference between the 2 outputs will be burned as heat in the resistor, saving the output buffers!

    Note that there is no ESD protection TVS diodes: this interface is not supposed to be mounted in the final user device, and PCB space is really constrained in this area, so they are omitted.

  • 3D Printed prototypes before injection molding

    David.Larbi05/01/2019 at 20:17 2 comments

    Introduction

    FunKey's design has been completely rethought. It is now sturdier, slimmer, with an active hinge that puts no stress on the cables and most importantly thought for production. We have designed every component while thinking about the injection molding process, this means clearance angles, drawers for the mold and other things that will be explained in a dedicated log about the design.

    Here instead we would like to take an unconventional path and start talking about the in-between process that is after the design and before the injection. Let's say your design for injection molding parts is done, how do you test it to assert its validity before investing thousands of dollars in a mold and go into production?

    Nowadays, we are lucky to live in a world where 3D printing not only exists but has been vastly democratized to the masses. Just between our three group members we own about five different 3D printers (not all in the best of shapes but they still help making the point). In order to validate our design, then 3D printing is the right solution, but FunKey being what it is - that is to say very tiny - not all 3D printing technologies are adapted to our needs.

    The question is, then, which type of 3D printing technology is the most adapted to our needs? We have tested the three principal ones: FDM, SLA and SLS and wanted to report our results in this log so that other makers can use this knowledge.

    Brief description of the different 3D printing technologies we used

    • FDM (Fused deposition modeling) which consists in building parts layer-by-layer from the bottom up by heating and extruding plastic filaments. It is by far the most common technology among hobbyists since great quality printers are now available for a few hundred dollards and the filament is relatively cheap (). 
    • SLS (Selective laser sintering) which sinters a powder by using a laser. Thiese printers are still way too expensive to be accessible to the mass market but it is possible to contract 3D printing companies to get prints for an affordable price.
    • SLA (Stereolithography) and/or DLP (Direct Light Processing) which solidifies a liquid resin layer-by-layer by photopolymerisation. Formlabs has democratized this technology which was previously reserved to professionals (even if the printers are still relatively expensive compared to FDM ones as well as the material). 

    Comparison of the print results

    The mechanical properties to consider for our prototype are the following:

    • resistance
    • precision
    • surface finish

    For the FunKey, we need a great precision for all the small details, a good surface finish and a sturdy case to resist the efforts on the hinge.

    FDM

    For this technology we have tried two prototypes, one printed with a common simple extrusion printer and the other with a double extrusion printer with a water-soluble material. The water-soluble material is used as support material and life-changing during the post processing of prints. You can see below the prints realised with an Ultimaker 2+, nozzle 0.6mm, layer height 0.15mm and PLA filament.

    Below are the prints from an Ultimaker 3, nozzle 0.4mm, layer height 0.10 and double extrusion with standard PLA and water-soluble material.

    Here are the results after a one hour bath in cold water and some toothbrushing to remove the residues:

    This technology (and the PLA used) is sturdy enough for our needs but, even if the printing params might not have been optimal, the surface...

    Read more »

  • Photo shoot side by side with PocketSprite

    c.Invent05/01/2019 at 10:27 0 comments

    If you are on this page you might already know about the PocketSprite. For those who don't it is the tiniest keychain-sized console, born from a crazy tiny gameboy project introduced in 2016 by SpriteTM. It was this project that inspired our first Keymu gaming console. We encourage you to go on Keymu's page if you want to know more about how FunKey started.

    A few years later SpriteTM eventually launched a successful crowdfunding campaign and from there went to production to build and sell the PocketSprite. As for the PocketSprite's initial prototype that inspired our first Keymu prototype, it is now PocketSprite's production success that inspires us to do the same with FunKey.

    Keymu's idea - then forwarded to FunKey - was to build our own version of SpriteTM's first prototype from scratch while improving where we thought it could be done. As for mechanical design this translates mainly in FunKey's clamshell design which allows to fit a wider screen, larger buttons to play comfortably, a bigger battery and all this while keeping a very tiny form factor. 

    But photos are worth a thousand words so here they are:


  • Schematics: SPI LCD

    Squonk4204/30/2019 at 22:06 0 comments

    SPI LCD Screen

    One of FunKey's strong point is certainly its screen: in a chosen form factor of roughly 45x45x15mm (1.75x1.75x0.6"), it has to be comfortable enough to provide a good gaming experience.

    If in theory this allows to shoehorn a 2.4" (diagonal) square screen, in practice, these screens are seldom square and more rectangular in shape.

    Unless you are a large manufacturer and selling millions of devices, you are limited to using the screens that are available on the market, which most of the time were designed for a long-forgotten specific devices (think of PDAs, MP3 players, clam-shell phones, pods, etc.) and standard aspect ratio are either 5:3 or 16:10. Thus, for a given pixel technology, this results in rather standard screen sizes.

    So the next size down is 1.8", but these screens tend to be quite thick and based on an old technology, so their typical resolution is rather limited @ 128x160 pixels: too small for gamers.

    Still going down in size, you can find 1.5~1.55" screens with an interesting resolution of 240x240 or even 320 x 320 ("Retina") pixels, but most of them use a fast and complex MIPI DSi interface requiring a dedicated controller on the host side. These screens were popular as the screen used in 6th-generation iPods, but unfortunately, getting a retail CPU with a MIPI DSi interface is almost impossible.

    Fortunately, we found this 1.54" LCD screen on AliBaba:

    What makes this screen remarkable is its standard SPI interface, which like the MIPI DSi one, only requires a few wires and thus a narrow flex cable, easy to roll into a hinge.

    This 1.54" display has 240x240 16/18-bit full color pixels and is an IPS display, so the color looks great up to 80 degrees off-axis in any direction.

    Be careful though, as in order to achieve a 30 fps @ 240 x 240 pixel resolution in RGB666 (3 bytes / pixel), this requires a ~40 MHz SPI clock rate. Once again, we were fortunate as both the V3s CPU and the screen built-in controller (a Sitronix ST7789V) support this high clock speed (after checking with the manufacturer and despite the controller datasheet specifies only a serial clock cycle (Write) of 66 ns or 15 MHz!).

    We were even luckier as its backlight consists in 3 white LEDs in parallel and not in series, such that no additional step-up DC-DC converter is required, as a standard 3.3V / 60 mA (typical) power supply is sufficient. Of course, we won't be able to drive this current directly from a CPU GPIO and the backlight will require an additional transistor to interface to the LCD backlight.

    Its flex cable requires a mating Hirose 0.4 mm pitch DF37NB-24DS-0.4V dual row SMT connector, out of which only one single row is actually used.

    Schematic

    The schematic is thus quite simple:

    The main component is of course the Hirose screen connector J3, with the following signals:

    • LEDA: the backlight LED Anode connection (+)
    • GND
    • +3V3 power supply
    • /SPI_CS: SPI Chip Select
    • SPI_MOSI: SPI Master Out / Slave In
    • SPI_CLK: SPI Clock
    • RS: LCD-specific Register/Memory Select (or Data/Control Select)
    • /RESET: LCD Reset

    All data signals feature an ESD TVS protection diode D19-D20, and except for the power supplies and LEDA + /RESET signals, all signals are directly connected to the V3s CPU's SPI interface, so there is not much to say about these.

    The /RESET signal is currently tied to the PMIC PWR_OK output, but in a future revision, we plan to change this so it is instead controlled from a CPU GPIO pin.

    Backlight PWM

    The backlight control requires a few more components: a MOSFET-P transistor Q1 and 2 resistors R5 and R7 to provide its polarization, more on this below.

    As the backlight LEDs cathode (-) pin are directly tied to GND within the screen, we need to drive these LEDs "from the high-side", i.e. between the +3V3 power supply and the LEDA pin, so a MOSFET-P transistor is necessary:

    As we want the backlight to be on by default, we need to drive it to...

    Read more »

  • Schematics: DRAM Power

    Squonk4204/26/2019 at 21:10 0 comments

    The attentive reader may have noticed that the PMIC covered in the previous log only provides 2 out of the 3 required DC-DC...

    This is because the AXP20x is originally the PMU (Power Management Unit) used by most Allwinner SoCs (A10, A13 and A20), which do not integrate SDRAM, so the board designer has a wide choice of memory option: DDR2, DDR3, DDR3L, LPDDR3, LPDDR4 with various voltage requirements.

    But no specific PMIC was created for the Allwinner V3s used in the FunKey device which however integrates a fixed SIP (System In Package) 512Mbit (64MB) DDR2 SDRAM.

    We thus have to design a separate SMPS (DC-DC) power supply for providing the +1.8V 1A required for the DDR2 DRAM power supply.

    For this purpose, we followed closely the Allwinner Reference Design which provides the same circuit, based on common pin-compatible SY8088 or LP3220 Chinese Buck DC-DC converter chips. But since these chips are not easy to provision in our place, we replaced it by a performance and pin-compatible AP3418KTR-G1 chip.

    Here is the corresponding DRAM Power schematics:

    Nothing very fancy here: the SMPS chip U4 has its required input filter capacitor C37 and output capacitors C65 and C73.

    The low-profile ferrite-core power inductor L6  (rated with a saturation current of 1.76A and low < 0.1 ohm resistance) provides the DC-DC energy storage element.

    The R20 / R23 precision voltage divider provides the required +0.6V feedback voltage from the +1.8V output voltage by having a 1/3 resistor ratio.

    The last component is a pull-up resistor R19 which ties the SMPS chip enable input to its active level permanently. The pull-up voltage is +3.0V (just as in the original reference design), probably as it is the next higher voltage available, in order to limit the current in it to its lowest possible value.

    OK, all power supplies are now covered!

  • Schematics: PMIC

    Squonk4204/24/2019 at 21:52 0 comments

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

    • SMPS for +3.3V / 1.2A for the I/O power supply
    • LDO for +3.3V_AO / 30 mA for the Always-On power supply (RTC timer)
    • LDO for +3.0V / 200 mA for the analog power supply
    • SMPS for +1.8V / 1A for the DDR2 DRAM power supply
    • SMPS for +1.25V / 1.6 A for the core power supply

    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:

    • A wide choice of input power source, the best source is chosen as IPSOUT inside the IPS (Intelligent Power Select) block :
      • USB VBUS
      • Battery BAT
      • ACIN wall plug (not used in FunKey)
      • BACKUP battery (not used in FunKey)
    • A 1.8A fast PWM battery charger (also called DC/DC1) with battery voltage / current sense and programmable charge indication LED
    • A soft key power-on/off logic with timer (just as in smartphones!)
    • An I2C interface with interrupt signal to communicate with the CPU
    • An optional battery temperature monitoring if the battery is equipped with an NTC resistor (not used in FunKey)
    • A reference voltage
    • A built-in 12-channel 12 bit ADC that measures various voltage and current data, as well as feeding an internal Coulomb counter and fuel gauge system (more on this later)
    • A power OK output used to generate the global RESET signal in FunKey
    • 5x GPIOs (not used in FunKey), GPIO0 can be programmed as LDO5 output
    • 2x DC/DC SMPS DC-DC2 and DC-DC3
    • 5x LDOs (only 2 are used in FunKey, LDO5 is optionnaly output to GPIO0)

    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:

    •  the PWM charger DC-DC1
    • the DC-DC2 for providing the +1.25 V / 1.6A for the core
    • the DC-DC3 for providing the +3.3V / 1.2A for I/Os

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

    • LDO1 supplies the +3.3V / 30 mA Always On for the RTC
    • LDO2 provides the +3.0V / 200 mA for the analog power supply
    • LDO3...
    Read more »

View all 17 project logs

Enjoy this project?

Share

Discussions

Asher Gomez wrote 05/04/2019 at 02:58 point

What is the top center button for?

  Are you sure? yes | no

David.Larbi wrote 05/04/2019 at 05:55 point

It's power on/off button. why here ; to protect it when the console is closed on the keychain.

  Are you sure? yes | no

Asher Gomez wrote 05/04/2019 at 15:08 point

Is that also what it was for on the GBA SP?

  Are you sure? yes | no

Squonk42 wrote 05/04/2019 at 18:31 point

This button was a "Screen Light On/Off" switch on the GBA SP:

https://www.nintendo.com/consumer/downloads/agsmanual_english.pdf

  Are you sure? yes | no

Asher Gomez wrote 05/04/2019 at 18:53 point

@Squonk42 Thanks.

  Are you sure? yes | no

J. Ian Lindsay wrote 05/04/2019 at 00:37 point

Ha! This is awesome! And timely, because I need such a screen.

  Are you sure? yes | no

DeanChu wrote 04/25/2019 at 04:13 point

Amazing design!!! Start to follow you guys from the funkey zero project and this one is THE game console in my dream. Can't wait to buy one.

  Are you sure? yes | no

Squonk42 wrote 04/25/2019 at 08:53 point

We made a lot of improvements since then!

Patience is still required, in the meantime you can read our logs and check our files to see our progress!

  Are you sure? yes | no

Paul Berkley wrote 04/24/2019 at 15:55 point

As dumb as it sounds: Take my money! I need this in my life!!!!

  Are you sure? yes | no

c.Invent wrote 04/24/2019 at 15:58 point

Sounds  perfectly fine to me ;)

A bit of patience is still required though, but it's coming!

  Are you sure? yes | no

Paul Berkley wrote 04/24/2019 at 16:04 point

I will be patiently watching and waiting

  Are you sure? yes | no

Papá Tortilla wrote 04/18/2019 at 23:26 point

Any chance of start selling them?

  Are you sure? yes | no

Squonk42 wrote 04/19/2019 at 07:12 point

FunKey is still under heavy development, but we plan to make it available to the public as soon as the team can have it ready!

Our participation to the Hackaday Prize 2019 is a good way to boost this project to turn it from a concept into an industrialized product.

  Are you sure? yes | no

Shranav Palakurthi wrote 04/17/2019 at 15:08 point

Have you thought about using a piezo speaker/buzzer? Should be cheaper and waaaay thinner (sacrificing a little bit of audio quality). For chiptunes, though, it should be fine.

  Are you sure? yes | no

Squonk42 wrote 04/17/2019 at 15:39 point

You are right, piezo speakers/buzzers are much thinner, but they have a larger diameter too, so they can only be placed on the bottom side.

Piezo speakers/buzzers are driven using PWM signals, which we currently don't know how to generate on the V3s using the ALSA API ;-)

And if audio quality is OK for the oldest consoles, it may be too limited for the most advanced ones like the GBA, Genesis or PS1.

  Are you sure? yes | no

Shranav Palakurthi wrote 04/17/2019 at 16:14 point

You bring up some good points. Keep up the great work!

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates