Sunday, February 8, 2015

Kinetis L Series


Looking for the cheapest ARM microcontroller I could find with built-in USB, I eventually settled on the Kinetis L series. The MKL26Z32 has 32k flash, 4k RAM, built-in USB and is available for less than $3 in singles from big distributors like Digikey. Besides the low cost, the other major appeal of the Kinetis L series is the extremely low power operation. According to the datasheet, it can achieve "static" power consumption down to 2uA and offers 9 different low power modes. Considering that this includes a built-in linear voltage regulator, it is really impressive.

I designed the little dev board shown above, which breaks out nearly every pin of the chip and has an RGB LED as well. I wanted to use the GCC ARM toolchain which proved to be somewhat challenging. I managed to find this Github repository belonging to Martin Kojtal which includes the very trickiest bits (the startup and linker scripts) for the KL26 and a few others in L family. This allowed me to build simple applications, but without a USB stack, it is nearly pointless.

Now I am starting to think I may have been approaching the software from the wrong direction. Freescale now offers an IDE for Windows called Kinetis Design Studio. Apparently this IDE is built on top of GCC, so it is possible that a GPL'd USB stack (and other goodies) is available.

At any rate, the KL26 is now old news. A new series of devices - the KL17, KL27, KL33 and KL43 - have just been released. The main attraction of the newer devices is that they include a ROM USB bootloader. This feature is incredibly handy, making the device appear as a USB storage device when plugged in to a computer, allowing for firmware updates just by dragging and dropping the firmware binary. While the KL27 is slightly more expensive ($4.40 in singles from Digikey), it includes much more flash and RAM (256k and 32k respectively) while maintaining the vanishingly low power consumption.