... and shaking the cobwebs off this blog, apparently. It's been a LONG while.
So I used to be an electrical engineer, until I joined the social media dev world in 2005, and I've been meaning to get back into electronics ever since. I finally half did it in 2012, making my matrix display, which was super fun, and keeps giving back -- I've brought it to Burning Man twice, the Lunacy festival, the Lucidity festival, and SF's Sea of Dreams NYE party twice. I've been meaning to do more microcontroller work since then, however, and I only really got into that in late 2014.
Since then I've been pretty busy... I counted up something like 17 circuit boards that I've designed between Nov 2014 and now. A bunch of random trivial boards to make connectors easier to work with (AVR ISP breakout, ARM SWD breakout, ARM SWD+UART multiplexer, FPC breakout for mini TFTs, etc), a couple of breakout boards for microcontrollers (Freescale MKE04Z8VTG4 and MKE02Z64VLD2), and a few actually interesting ones (an LED heart pendant, an 8x8 sparse - modifiable at solder time - matrix of LEDs to make a light-up birthday present for my girlfriend, a 20-LED ring, an ATMEGA328P based PWM controller for LED strips, and finally an LPC11U14 USB board, designed with Philip Lindsay).
Some of the boards I've designed since late 2014.
This all started when Philip mentioned to me that he'd been playing with NXP's LPCXPresso LPC11U14 eval board, and I took a look at the specs and pricing on the microcontroller in question. How had I not managed to find out that ARM now made microcontrollers?! In 2012, the hobbyist world was going nuts over Arduino, which is a kinda ugly looking board combining an Atmel AVR (ATMEGA328P) MCU, a USB-to-serial adapter, and basic power stuff. Snotty EE that I am, I dismissed it out of hand due to how little it appeared to offer (why use one when I could just solder up the same thing on veroboard and use a real AVR programmer?!), failing to realize that the software support and amazing community behind the platform actually made it into the nicest hardware platform I'd ever worked with. I think I realized this after basing every custom hardware project for the next year on ATMEGA328P and ATTINY85 chips and building against the Arduino libraries... but anyway. So last year I found out that ARM made micros, and they were cheap and super high spec. Unfortunately, the "scene" seems super fragmented, unlike the AVR world, where there are basically only three chips worth considering, due to how well supported they are: ATMEGA328P (Arduino), ATTINY85 (Adafruit Trinket), and ATMEGA32U4 (Teensy).
So... for the last few months, I've been reading and reading and reading, and designing boards, buying chips, hacking around, and learning about the ARM Cortex-M system and its licensees by trial and error. Here's a quick braindump:
- For actual chips you can buy, there's the ARMV6-M based Cortex-M0 (NXP LPC 11Uxx, Cypress PSoC 4), the slightly quicker/lower power Cortex-M0+ (Freescale Kinetis E), ARMv7 Cortex-M3 (I don't care), and ARMv7+DSP Cortex-M4 (Freescale Kinetis K, STMicro STM32F3/4, Atmel ATSAM4, and a bunch of others). CM0/CM0+ typically run at 20-50 MHz (although the flash maxes out at 24 MHz so you end up with a lot of wait states when running the core fast), whereas CM3/CM4 parts can get up to 72-180 MHz.
- If you want to get up and running with a Cortex-M chip *fast*, don't need single-step debugger access, and don't want to have to care about the internals, go buy a Teensy 3.1 from PJRC. With 256k program space, 64k ram, USB, and a super user-friendly dev environment and bootloader, it's a dream to work on. Creator Paul Stoffregen puts a ton of time into the community and making sure that Arduino libraries work on Teensy as well, so it's highly likely to be the most compatible chip if you're coming from that platform. I used a Teensy 3.1 for the aforementioned birthday present, and I wish all development was that easy.
- If you're controlling LEDs, consider FadeCandy, which is based around a similar MCU to Teensy 3.1, but is a bit more open and slightly less convenient, and has convenient 5V output for driving LED strips.
Those are my pre-built recommendations. Now onto actual chips that I've been working with.
- If you like tiny (fan of the ATTINY85?), try the Freescale Kinetis MKE04Z8. It's under a dollar, and has 8k of flash and 1k of ram. This seems to fill up quick, but it runs my LED pendants just fine. I cannot for the life of me get the UART to work (more on that later). And it can run on 5V, unlike many Cortex-M parts. I think it's designed for the automotive industry. The official debug/program adapter is expensive, but you can hack their $13 "Freedom" board to work as a programmer, and that's been working fine for me.
- Slightly bigger (physically and flash/ram-wise) is the Freescale MKE02Z64. Still around a dollar, but with 64k of flash and 4k of ram. This is the ATMEGA328P-killer. 44 pins, 20-40 MHz, 3 UARTs (which actually work for me). I bought 20 of these right off the bat, and expect them to become a standard workhorse for when I have enough board space for a 44-pin 0.8mm LQFP and don't want to spend much.
- Cypress has combined CPLD and MCU functionality into its PSoC series. I'm still learning about it, but PSoC 4 chips like the CY8C4245 appear to have magical powers like being able to run PWM on every pin -- when configured properly. Also 5V-tolerant (albeit with a slightly odd regulator setup requiring quite a few capacitors). 32k flash. Seems to require an expensive debugger... but the CY8CKIT-049 eval boards are $4. The high end CY8C4247 chips (not available yet) will do Bluetooth LE. I can't wait.
- NXP's LPC series has built-in USB, and 16 kB of ROM that apparently implements useful routines. LPC11U12 (16k flash) is about a dollar, LPC11U14/24 (32k flash) are more like $3-4, and the LPCXPresso IDE is nice. Plus there's an excellent programmer/debugger, the LPC-Link2, which only costs $20. These require 3v3.
- I haven't tried this out yet, but Atmel has the ATSAM4 series, which seems to be one of the more affordable high-spec CM4 lines. newark.com has some ATSAM4 chips with 1M flash for ~$5. They have a debugger (Atmel ICE) for $30-50, which also gives you single-step debug on AVRs (for all your old Arduino/AVR projects). Also 3v3.
- Also in my newark.com shopping cart right now are some STMicro STM32F372 chips. No idea about them just yet, but not only are they the most affordable CM4 chips that don't have 100 pins, they're actually CM4F, which means they have a proper FPU. Suspect tool support will be awful, but I'm starting to roll my own SWD hardware now, so these can sit around until that's ready. Also 3v3.
Blog comments still aren't up and running, but if you're reading this and have something to add, drop me a line! I'll probably set up Disqus or something soon.
... more like this: [