I wanted an intervalometer for my Canon DSLR, which at the time, rather miserly did not contain. An intervalometer is a device to take exposures at regular periods. It’s great for time-lapse work. Their own add-on was quite pricey. Even knock-offs were more than I thought was worth it. And besides, I wanted a project where I could make my own printed circuit board, or PCB.
I have an ST Nucleo-F411RE development board that I’d like to use for a project. It’s using a microcontroller from the same STM32 family as I’ve tried out before, but packaged onto a board with Arduino (Uno)-pattern headers, as well as the full pin breakout. I’m not sure how useful that is for my project yet, but I wanted to give it a test drive.
Most platforms have multiple development options.
The Arduino biosphere has various hardware targets, but with a common IDE. But the Arduino boards are all based on microcontrollers from Atmel (now part of Microchip, the company that also makes PIC microcontrollers). So you aren’t limited to the Arduino IDE, and if you’d like to, you can use all sorts of development toolchains and IDEs.
I have a few bad habits. One is using digital tech where analogue would do.
This might be a classic example.
The Arduino Family
The Arduino project has been a huge success. I partly attribute this to Right Place, Right Time, though to say they have benefited from the new Maker’s movement is true but ignores how influential it has been on that movement. It is also a tribute to their holistic approach, spending as much if not more time developing the IDE and documentation to go with it- you can be uploading a new program (or “sketch” as they call them) within 5 minutes of getting it out of the box.
I have two Duemilanoves,
one Uno R3, and one Diecimila with a busted FTDI chip (meaning not only can it not communicate over USB, but it can’t be powered that way either).
The Arduino hardware platform exists in many different forms, targeting various form factors, differing connectivity requirements, and in the case of the Arduino Mega, increased memory and I/O. It is also an Open Hardware platform, meaning anyone can produce works based upon it. Some have made improvements, such as the more robust version with more protected ports, or this dual-voltage capable version from ElecFreaks. Some are just
Having been introduced to the Atmel 8-bit AVR chips, I also own a few handfuls of ATtiny45 chips. I made my own programming shield with a ZIF socket to load them up. I tend to write their software in “bare” C, using Atmel Studio 6. It isn’t open source or cross platform, but it is free-in-cost, and not artificially limited.
ST Microelectronics STM32F-series ARM Cortex chips
Do you need more power? Perhaps faster clock speeds, or will be handling 32-bit floating point numbers, or you need more and more complex timers? The STM32 uber-family of chips can be handy. Would you like a built-in real time clock? Large quantities of I/O, or multiple USARTS (serial)? They have that too. Incredibly, the boards are, despite housing more powerful chips, cheaper than any
Arduino Uno, let alone the Arduino Mega.
They are a bit more fiddly to get started with on Linux, but by no means impossible.Texane’s stlink program can communicate over the USB debugging interface to upload your firmware, and all the chips have a built-in TTL serial based bootloader, very much like the Arduino- so a cheap USB-to-serial adaptor (I hacked apart an old Nokia phone cable) can get you in the back door, so to speak.
I have the STM32L-DISCOVERY board, which has the low-power STM32L152xx chip, with built-in LCD driver, and touch sensitive buttons. To show off that LCD driver, it has a 4 digit (starburst) display. These displays are still popular wherever saving energy is a must. You do lose access to most of the peripherals though, because it requires so many pins.
I also have the more powerful (168MHz, 1MB flash, 192KB RAM) STM32F4DISCOVERY
board. The board is equipped with a DAC that is also a headphone amplifier, a MEMS accelerometer, and a MEMS microphone. Also provided is a second USB interface, that can be used by the chip to act like a USB peripheral. The demo code it comes with enables it to behave like a mouse, and it moves your pointer based off the accelerometer output. It also has DSP functionality, so you could perform hardware FFT analysis of the microphone input.
Most recently, I have gotten a board with an F0 series chips, their new low-end ARM Cortex M0 cored microcontroller on it. The STM32F0DISCOVERY will set you back about £5, and for that, you get a 32-bit chip, with 64KB of flash (double the Arduino Uno), and 8KB RAM (four times the Uno’s) running at 48MHz (three times the Uno’s speed). It even comes with a generously proportioned slab of prototyping board!
Texas Instruments MSP430 family
The TI MSP430 chips seem to get everywhere, and they’re really cheap. They’re also 16-bit, which can be a boon if you need to manipulate numbers that size. The low end ones supplied with the Launchpad eval board have very small memories, and not a lot of peripherals, but you can get started with a USB-based breakout board for about £3.60…
Currently I own just the one original Launchpad kit, which comes with two DIP packaged chips. So-say there is a new revision which comes with more capable chips and an improved board, but Farnell don’t seem to be stocking that yet- I guess they have too many older ones still. Or they are shipping it and haven’t updated the information. Then again, the wiki doesn’t mention the new revision either.
People have moaned about TI making a great, low-cost, low-power board, and then saddling it with non-free compilers. Now you can get hold of them for no money, but
they are limited to the code size they will produce. You can’t hit the limits with the chips that come with the Launchpad, but I would prefer something open source.
But this, Energia, looks mighty interesting…an Arduino IDE fork that targets the Launchpad, and runs on Windows, OSX and Linux. Early days on this one, don’t expect to take any old Arduino sketch and have it work (and you never will, the microcontrollers have very different peripheral sets), but keep an eye on it.
And how about doing it all online with Lars Roland’s Inventor Town? That sounds suspiciously modern. Of course, you still need to be able to upload your hex file to the chip, but for that he’s provided a simple Windows program that launches when you receive the compile code. For everyone else, there’s mspdebug.
Which one should I get?
So why would I still have to recommend the Arduino out of all of these? You get an all-in-one solution, with the board, the IDE that is also the programmer, which runs on Windows, OSX and Linux, lots of libraries to get you going with many common hardware devices, and access to all the shields, for those of you not yet solder-happy. Someone with no electronics experience can be taking tentative first steps within minutes of the board arriving, and that is important for first-timers to get that confidence boost.
Yes, it’s not as powerful as the ST ARM Cortex based boards, nor as cheap. Those might well be
what you graduate to after this. But be warned that you won’t find any of them in easy-to-solder DIP packaging. NXP make a modest ARM-cored µC though- LPC1114.
Whilst I hesitate to say “follow the herd”, the sheer number of beginners who have trodden this path means there is a raft of documentation out there, and a great many tutorials, invaluable to a newcomer. And remember, if you hit the wall of resources with your chip, there’s usually a beefier one waiting for you in a parts list somewhere out there!
When playing with software, unless you’re kernel hacking, if you make a mistake, there’s only so much that can go wrong. Generally you might cause a crash of some kind- an unhandled exception in Java, or a segfault in C. When you get into hardware, writing code for microcontrollers, you can properly break things.
Today, I broke a clock.
Continue reading “Brick quickly”
I have too many little dev boards and breakout boards and other components laying around here, picked up from cheap Hong Kong-based suppliers. I buy them thinking “oh yes, that would be handy” and then never do anything with them.
Today I have used two in one go. Blam! I made this, the Beverage-o-Meter:
One Arduino, called the server (although the wireless boards are just peers with respect to each other), sends changes in the potentiometer’s position to the client (shown above), which rotates a stepper motor in sympathy, as it were, pointing at the beverage
desired. It is probably not that diplomatic a thing to plonk down in front of someone, so before deploying, work out a rota of who gets to hold the control.
Continue reading “Beverage-o-Meter”