I’ve been working for a while on a wearable accelerometer/datalogger project, and I came up with a nice breadboard prototype using a spare Seeduino Stalker plus a bunch of other parts. But that’s kinda big to actually wear. Next up: a handy Micropython board: it’s small, it has a real-time clock, it’s way easy to code, but wait: the accelerometer returns all of five bits of resolution. It can tell upsidedown from right side up from sideways, but not much more.
So when I saw Adafruit’s lovely little Feather logging board it seemed perfect. Small, plenty of pins, LiPo battery socket and USB charging. (And unlike my Stalker, the micro-SD holder doesn’t fall open at inconvenient moments.)
What a terrible mistake learning experience.
When I wrote my code for the Stalker, I was using Arduino 1.06, because I hadn’t needed to upgrade (and the newer versions don’t work on my old mac anyway). But the Feather board uses the fancy new Board Manager magic in Arduino 1.6.x to install its pin descriptions and so forth. So off I went to install the newest version.
Now the lovely SDfat library I was using (fast, long file names) wouldn’t install, and even after I tried to install it by hand kept showing up as “invalid library”, because the Arduino folks have decided that there must be Order and Rules for how the files in libraries are arranged. And a properties file. (Which I understand in principle, but in practice “All that stuff you relied on that formerly worked is now broken” does not win friends.)
So I mucked around with that for a while, and complained in forum where a nice person said “Oh, yeah, the latest versions of the IDE aren’t so hot, downgrade to 1.6.5 and your library should work.” And (after a little more mucking) so it did.
New IDE capable of recognizing board, check. New configuration of SdFat library, check. But wait. All the real-time clock breakouts I have are 5-volt only, except for one that’s huge. Time to order a 3.3v RTC. Wait for it to arrive.
Put all the hardware parts together. Test compilation of old stalker program to see if the software parts will fit. Boom. Nothing works. Error messages claim files I know are there are missing. Messing with the include statements just produces more error messages. A search to figure out how I am messing up reveals that oops! the latest version of the core board descriptions file installed by the magical Board Manager is not compatible with previous versions of the IDE. Tell the Board Manager to install the previous version instead. Hurrah! Everything compiles.
Doesn’t work, though. Feather just sits there when I try to get information from the serial port. All the power lights are on, but nobody is home. Maybe the new RTC really isn’t 3.3volt capable? Wouldn’t be the first time a seller stretched the truth on amazon. I get a regular arduino and try the clock there. Also nothing. Load up the I2c scanning sketch. Nerp.
Hmm, maybe I need pullup resistors? The nonexistent documentation was fuzzy on that point — some I2C devices have them built-in, some don’t. I break out the multimeter, and measure 4680 ohms between the clock line and Vcc, 4720 ohms between the data line and Vcc. Pullups are supposed to be 4.7K ohms. Just for the heck of it I measure between Vcc and ground: 400 ohms. Erm. That probably ain’t right, considering that realtime clocks are supposed to draw a few microamps.
Luckily, the boards were cheap so I’d ordered two of them. I popped the second one into the original circuit and golly if it didn’t come right up where it was supposed to.
Total time spent mucking around on something that should have been a simple swap of one microcontroller board for another: almost two weeks.