4 days ago •
The Funkey team is proud to announce FunKey's official website.
We have also setup a newsletter to start building a community and keep everyone informed about FunKey's updates and most importantly its release date. You can subscribe to the newsletter directly on the website.
Official web site : http://www.funkey-project.com
Also, we have settled on a date for the crowdfunding campaign: Q4 2019 on KickStarter.
Again: don't hesitate to subscribe our newsletter directly on our website !
You can also follow us on our social media pages:
05/29/2019 at 21:15 •
Can you spot what the 2 boards have in common?
They are both small, but this is not the only common point...
- It is not the HDMI connector (FunKey doesn't have HDMI output),
- not the USB connectors (FunKey has a low-profile PCB edge mid-mount model),
- not the CSi camera interface (FunKey does not have it either, although its CPU has this capability)
- CPU is of course different, since the RPi Zero BCM2835 is not available for retail
- DRAM integration? Yeah, but not quite: the RPi has a PoP( Package on Package) Elpida B4432BBPA-10-F 4GB DDR2 DRAM, the FunKey has an unknown SiP (System in Package) 512MB DDR2 DRAM
... Yes it is: the microSD Card connector! Both boards are equipped with a Molex ref. 104031-0811.
It is a pure coincidence, though. Our primary motivation for choosing this (rather expensive) connector was its low profile: only 1.42 mm height, whereas most common connectors are ~1.9 mm height. And overall size too: only 11.95 mm x 11.40 mm, while common ones are more in the 14.70 mm x 14.50 mm ball park.
It is just a simple manual "PUSH/PULL" type (i.e. no bi-stable "PUSH/PUSH" mechanism that would take more space), but we don't care, as in the FunKey, the micro SD card is not meant to be removed anyway.
05/21/2019 at 17:45 •
So far, we already encountered capacitors for many different usages:
We have seen load capacitors used with the 2 crystals in the discussion about CPU.
A quartz crystal always provides both series and parallel resonance, the series resonance being a few kilohertz lower than the parallel one.
Crystals below 30 MHz like ours are generally operated between series and parallel resonance, which means that the crystal appears as an inductive reactance in operation, this inductance forming a parallel resonant circuit with externally connected parallel "load" capacitance. Any small additional capacitance added in parallel with the crystal pulls the frequency lower in the range between the series and parallel resonance frequencies, insuring crystal startup and stable operation.
For modern circuits, these load capacitors have a typical small value < 20 pF.
Bulk capacitors are used to prevent a power supply from dropping too far during the periods when current is not available. At the same time, they help to reduce the power supply voltage ripples by smoothing their output voltage.
Many such capacitors are used at both the input and output of the numerous linear and switched mode power supplies in the PMIC discussion.
The main bulk capacitor value is generally high (some µF), but there may be smaller parallel capacitors added for stability.
As you probably know, capacitors are made of 2 parallel conductive electrodes separated by a (thin) isolating dielectric material (even if these electrodes are rolled or layered to reduce the component size). Thus by construction, no DC (Direct Current) can flow from one electrode to the other, but by influence using the electric field, AC (Alternative Current) still can go through. This is how coupling capacitors are used to link 2 circuits while removing any DC bias voltage on one side or the other of the capacitor.
We use such a coupling capacitor in the Audio schematic description for feeding the audio power amplifier from the CPU audio output.
We have seen many examples where capacitors are used within passive filter circuits along with resistors or inductors, mainly to remove unwanted frequencies from a power supply or a signal.
Decoupling (Bypass) Capacitors
We have already seen some decoupling capacitors when looking at the buttons circuit.
Active components such as transistors and chips are connected to their power supplies through conductors featuring a (small) common impedance made up of complex (resistive, capacitive and inductive) value. Because of these parasitic components, a device that suddenly draws some current in spikes will generate a drop in its voltage power supply. If many devices are sharing the same power supply and impedance, the state of one device will be coupled to the other ones through the common impedance of the power supply conductors and may affect thir operation.
In order to decouple the devices, capacitors placed as close as possible to the device power supply input pins are used, which act as local energy storage. These capacitors are also named "bypass capacitors" as they shunt transient energy from the power supplies past the device to be decoupled, right to the GND return path.
There may be different capacitors values placed on the same power supply pins in order to filter transients at different frequencies: the bigger the capacitor value, the lower the frequency. A typical value is 100 nF, and values from 1 µF to 10 µF are used for lower frequencies and / or higher current draws, while lower values of a few nF are used for filtering higher frequencies.
In essence, decoupling capacitors are not very different in their function from bulk capacitors: the only difference is one of scale, both of current and of transient duration. Bulk capacitors deal with large currents and periods of 10s of ms, whereas decoupling capacitors are used for much lower currents and much briefer periods (typically 10s of ns for TTL or CMOS devices) .
The last part of the FunKey schematics merely contains only decoupling capacitors:
One exception is the Allwinner V3s CPU HPR/HPL circuit which features an RC-to-ground circuit between the amplifier and the preamplifier input with the resistor R27 and capacitors C79 and C81, as recommended in the V3s hardware design guide.
The only other remarkable point left in this schematic is the resistor divider R25 / R28 which provides a reference voltage at half the DRAM power supply voltage level, which is used for the integrated DDR2 DRAM merged drivers and dynamic on-chip termination already discussed at the end of the previous CPU schematic description.
As we have seen, the design is not overwhelmingly complex, but it contains many details that are all important to make sure the device works as expected.
05/19/2019 at 10:15 •
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.
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.
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.
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, and the corresponding pins are thus connected to GND.
The SD Card power supply is done through an RC low-pass filter to provide a soft-start operation, as the card built-in large bulk capacitor on its power rail may collapse the supply voltage when initially powered up.
05/17/2019 at 06:48 •
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.
05/12/2019 at 19:24 •
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!
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.
05/07/2019 at 20:39 •
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.
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.
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.
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.
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.
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 with the other I2C peripherals (the PMIC) on the bus.
It is then much easier to route this dense PCB by delegating the button GPIO handling to a satellite chip.
05/04/2019 at 20:34 •
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.
05/01/2019 at 20:17 •
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:
- 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.
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 finish and level of details are far from ideal. It is especially noticeable when we start putting together the different parts. The outer parts are ok but, even with soluble material, the inner parts needing supports material lack precision and surface finish.
With this technology we have chosen to go with PP (Polypropylene) among the variety of available materials such as PA12, PA+GF (Glass Filled), PP (Polypropylene), Alumide (Mix between PA powder & aluminum powder), TPU92 (Thermoplastic Polyurethane)...
Here is how the prints turned out with Polypropylene:
This time the inner parts of the casing were the same quality as the outer parts. As you can see this material is too elastic though. But if materials can be swiched for sturdier ones, precision still falls behind our needs. Besides, surface finish is not smooth and the porous material quickly tends to absorb dirt.
Different types of resin were tested with this technology:
- Somos® EvoLVe 128 ( white)
- Accura Xtreme (gray)
- R11 from Envisiontech (red transparent)
- ANYCUBIC resin (green transparent).
The biggest drawback with SLA printing would be that it is still very far from being as user friendly as FDM printers. Not only does the resin needs to be handled carefully in the first place but the post-processing treatments require one to not be afraid of a little chemistry. The prints must be cleaned with isopropanol alcohol, and after removal of the supports, they need to be strengthened with UVs. Also, the smell of all these products is not the greatest.
The results however are definitely worth it!
A great exemple of the kind of precision that can be achieved without a sweat by SLA technology would be the tiny plastic rib depicted in the image below.
It needs to be precisely 0.7mm wide and printed over a part that would need support with FDM technology.
As can be seen in the picture below, only SLA achieves this level of precision (gray casing) with a very neat rib while even SLS (white casing) clearly falls behind.
Here is another example of the kind of precision achieved with SLA: the FunKey logo is only extruded 0.1mm in the casing. As you can see it is not only clearly visible but also very neet on the SLA print. This is not the case with other technologies that printed the same STL file.
We noticed our SLA prints were quite fragile however, this material is a bit more breakable and one needs to be careful when assembling the parts, espacially with the screws. They need to be put gently not to break the shanks.
Precision: theory vs reality
Theoritically here is the precision that each technology can achive in average:
- FDM: ± 0,15 % (lower limit with standard nozzle at ± 0,2 mm), layer height: 0.05 to 0.3mm
- SLS: ± 0,3 % (lower limit ± 0,3 mm) / layer height: 0.12mm
- SLA: ± 0,2 % (lower limit ± 0,2 mm) / layer height: 0,05 to 0,2 mm
Below can be seen different measurements of the casing's width (theoritically 44,3mm)
Globally all three technologies are decent, it is the level of details that lacks for SLS and especially FDM compared to SLA.
This log does not pretend to be an extended research on 3D printing technologies but merely an attempt at finding the one best suited for trying out our prototype before production. Keeping this in mind we might not have set the very best parameters for FDM prints and they might be greatly improved, but our conclusion would be that in order to achieve the level of details FunKey needs, SLA technology is simply one step further regarding accuracy and surface finish.
Thanks to the SLA prints we were able to validate our design choices regarding the integration of the electronic components, the new screen with its flex and the strength required to open/close the hinge. It also allowed us to see where our design could be improved, for example by decreasing the led brightness, reducing the logo's size, adding some matter to block the light from the display backlight, ... and some other things that we will detail in a dedicated log.
We are now working on fixing these small issues and printing new SLA versions to validate them and then be ready for injection molding (probably in ABS). We intend to show in a future log the design rules that were applied to conceive FunKey's plastic parts for injection molding (Draft angle, injector pin, injection gate, cavity, core…).