Goals
- Low cost - TBD should be affordable enough to use as a component in a project
- Easy to program - TBD's functionality should be controllable through a minimum of coding. TBD's dev tools should require a minimum of effort to install and configure
- I/O support - TBD's I/O pins should encompass as many hardware inferfaces as possible. At a minimum TBD should support 1 channel each of SPI, I2C, and UART though not necessarily at once.
- Upgradable - TBD should be programmable by a USB host using simple tools
- Unbrickable - TBD's micro should contain a bootloader in ROM that can be forced to run by hardware strap
- Small - TBD should be as small as possible so that it can be always available in a portable toolkit
Hardware
The TBD board connects a USB host to 6 I/O pins by way of a Freescale KL27Z ARM microcontroller. TBD's PCB is sized so that it plugs directly into a USB port, and has pads so that no additional USB connector is needed. A plastic shim on the opposite side of the USB-A pads insulates the PCB from the port frame and improves the fit and contact with the port. I/O is exposed on an 8 pin 0.100" pitch dual row pin header. The header is an SMT right angle style that minimizes the overall length of TBD. Overall height of the PCB and header leaves sufficient clearance for other USB plugs above and below the board when plugged into a stacked USB-A port.
A Freescale Kinetis MKL27Z256VFM4 microcontroller is at the heart of TBD. Few other components are required: bypass caps, USB and LED current limiter resistors, connectors, and the LED are the only other parts on the PCB. The KL27Z micro contains a 48MHz ARM Cortex-M0+, 256K flash, 32K RAM, various peripherals, 5V to 3.3V linear regulator, and a 16K Kinetis Bootloader ("Kibble") ROM. An internal trimmed oscillator provides the core and most of the peripheral clocks, while the USB device interface is "clockless" by way of clock recovery from the USB host, so no external crystal is needed. The on-chip 3.3V LDO steps down the USB bus power to the 3.3V chip supply, and is available on the I/O header to power low current devices.
The I/O header exposes ground and 3.3V as well as 6 pins that are multiplexed for GPIO, I2C, SPI, FlexIO (Freescale generic serial interface), UART, timer, and ADC. One pin (I2C1_SDA) is sampled by the micro on power-on and will force the ROM bootloader to run if pulled low. This pin is situated next to GND so that a 2 pin jumper can be fitted over both. All I/Os on the header are directly connected to the micro without any current limiting, filtering, or other protection. This is common and almost expected for other similar micro dev boards.
(todo: insert pin map / mux table)
An LED connected to one of the GPIOs can be used by software for status.
The PCB is made with all SMD components located on one side except for the header. Stencil / paste / reflow is used to solder the component side, while the header is hand soldered. The LED and passives are all 0603 size, while the micro uses the 5x5x1mm QFN-32 package.
Software
Toolchain : mbed
Coding for TBD is done using the mbed library. The plan is that eventually (somehow?) TBD will be supported in the mbed web-based online IDE, making development possible with nothing more than a browser.
For now the mbed library can build TBD-compatible projects offline using the KL43 target, a package variant of the silicon used in TBD. This takes much more effort to use than the online IDE, and detracts from the convenience factor TBD promises.
The Freescale KDS / KSDK IDE can be used as an alternative, but is also not as simple as the mbed online IDE.
Flashing : kut
kut is a Chrome browser app that uploads new firmware to the KL27 micro in TBD over USB. Uploading new firmware to TBD with kbl is as simple as choosing a file from the local disk, putting a jumper over two pins on TBD (clearly marked in the silkscreen), and plugging TBD into the PC. As a local Chrome app, kut can access certain USB devices and local files without needing device drivers or administrator privileges. kut will be installed through the Google Play store, explicitly requesting permissions to communicate with the Freescale bootloader USB ID and to access local files.
Every KL27 ships with Freescale's Kinetis Boot Loader ("Kibble") in ROM. The bootloader is run instead of the application in flash if the /BOOT pin is asserted after reset. The bootloader starts up the KL27 in clockless USB mode, responds to the host as a USB HID device with a Freescale-issued USB VID/PID, and waits for a connection from an application. kut detects a TBD in bootloader mode by this VID/PID, handshakes with the bootloader, erases flash contents, uploads a new firmware, and runs the application.