Making it Easier to Build Firmware

OSHW Logo

Most microcontroller manufacturers give you some kind of free development toolchain or IDE with their silicon products. Often it’s crippled, closed source, and a large download. This is pretty inconvenient when you want to have firmware that’s easy to build and distribute. I’ve found many of these toolchains to be annoying to use, and requiring closed source software to build open source firmware seems less than desirable.

It’s possible to build code for most microcontrollers using command line tools. You’ll need a compiler, the device manufacturer’s libraries and header files, and some method of flashing the device. A lot of these tools are open source, which lets you have an open source toolchain that builds your project.

Setting up these tools can be a bit tricky, so I’m building a set of templates to make it easier. Each template has instructions on setting up the toolchain, a Makefile to build the firmware, and sample code to get up and running quickly. It’s all public domain, so you can use it for whatever you’d like.

Currently there’s support for AVR, MSP430, Stellaris ARM, and STM32L1. More devices are in the works, and suggestions are welcome. Hopefully this helps people get started building firmware that’s easy to build and distribute with projects.

Lord Vetinari’s clock strikes again

vetinari

Inspired by the maddening timepiece from Discworld, this clock keeps time, but anyone watching the seconds tick by may be mentally unstable for it. [Renaud Schleck] built the stuttering clock using very few components. He undertook the build after being inspired by the version which [Simon Inns] built.

The clock itself is a run-of-the-mill item which uses one battery to keep time. We’re always impressed by how these dirt-cheap things remain so accurate over the long haul — but we digress. The method of attack uses coil injection to drive the hands. [Renaud] used one of the microcontrollers from the MSP430 Launchpad, along with the clock crystal which also shipped with the kit, to gain control of the mechanism. The crystal triggers an interrupt which does the actual time-keeping. The seconds hand is driven rather sporadically based on an algorithm explained in his write-up.

You can watch the uneven ticking in the video after the break. Despite that visually disturbing functionality, the short and long ticks balance each other and the correct time continues to be displayed.

Continue reading “Lord Vetinari’s clock strikes again”

GLCD clock project packed with great UI and features

glcd-clock-packed-with-features

This Graphic LCD clock doesn’t have a fancy case, but [Gregory Wright] built in so many great features we think it will serve as inspiration for many projects to come. If he does decide to add a case it will be quite easy as there are no buttons to work around.

Without buttons how can the thing be adjusted? He decided to go with an IR remote control for all settings. This gives him a lot more options than a handful of buttons would have. Plus, heavy sleepers will need to find the remote control in order to shut off the alarm. We also think it’s interesting that the 595 shift registers he used have a low enough data high threshold (3.15V when VCC is 4.5V) that he didn’t need level converters to drive the 5V display with his 3.3V MSP430 Launchpad.

Check out his video after the break to learn about all the features he included in the UI. Our favorite is shown on the bottom right where it says “Hello World”. This is an area dedicated to a custom message for each day. He uses it to remind him about trash day (now there’s a feature!).

Continue reading “GLCD clock project packed with great UI and features”

Morse code flower is trying to tell you something

morse-code-flower

To the casual observer this flower looks nice as its illuminated center fades in and out. But there’s hidden meaning to that light. Some of the blinks are longer than others; this flower is using Morse Code.

[Renaud Schleck] wanted to try a few different things with his MSP430 microcontroller. He decided on an LED that looks like a flower as it will be a nice piece of decor to set around the home. To add the Morse Code message he wanted something a bit more eloquent (and less distracting) than purely digital flashing. So he took the dots and dashes of the hard-coded message and turned them into fading signals by using Pulse-Width Modulation.

He free-formed the circuit so that it, and the coin cell that powers it, would fit in the flower pot. A reed switch is responsible for turning the juice on and off. When placed near a magnet the flower begins its gentle playback.

Continue reading “Morse code flower is trying to tell you something”

That’s not beer! A biofuel fermentation controller project

biofuel-fermentation-controller

Any home brewer will recognize the setup pictured above as a temperature controlled fermentation chamber. They wouldn’t be wrong either. But you’re not going to drink what results. This project is aimed at providing a temperature controlled environment for fermenting biofuel.

[Benjamin Havey] and [Michael Abed] built the controller as their final project in his microprocessor class. The idea is to monitor and control the mini-refrigerator so that the strain of Saccharomyces Cerevisiae yeast produce as much ethanol as possible. An MSP430 microcontroller was used. It monitors a thermister with its analog to digital converter and drives a solid state relay to switch mains power to the fridge. At 41 degrees Fahrenheit this is down below what most lager yeasts want (which is usually in the low fifties). But the nice thing about using a microcontroller is you can set a schedule with different stages if you find a program that gives the yeast the best environment but requires more than one temperature level.

Who knew all that beer making was getting you ready to produce alternative fuels?

Sunrise alarm clock uses DCF77 for perfect time

sunrise-alarm-clock-dcf77

Here’s a sunrise alarm clock that keeps perfect time. It was designed and built by [Renaud Schleck] who also published a post detailing the process.

As you can see, a series of white LEDs inside of the transparent case which provide the simulated sunrise. As the days get short and the nights longer we do see the benefit of having your clock brighten the room before it jolts you out of your slumber. Speaking of, that alarm sound seems to be the weak link in his design. He’s using a square wave smoothed with capacitors to drive a speaker at either end of the case. We didn’t hear an example but we imagine this not the most gentle of sounds.

The rest of the design is quite well done. He’s using a 4×20 Character LCD display and adjusts the backlight using PWM. A DCF77 radio feeds data from an atomic clock signal to the MSP430 chip which runs the clock. There’s even a battery backup in case the power goes out.

We just saw a project yesterday that aims to improve signal quality with a DCF77 radio.

[via Reddit]

MSP430 bit banged USB 1.1

msp430-usb-hardware

Here’s a rather exciting development for those who work with MSP430 microcontrollers. [M-atthias] worked out a way to implement USB 1.1 on a MSP430G2452. He’s bit banging the communications as this hardware normally doesn’t support the Universal Serial Bus. This is much like using the V-USB stack for AVR micros.

The test hardware seen above uses an 18Mhz crystal to get the timings just right. As this squeezes the most out of the chip it should come as no surprise that the firmware is written in assembly. This is still quite early on in development but the core features are mostly there, having been implemented and debugged over several versions already. Currently the base functionality can be loaded using under 2k of flash memory. You can download the Mecrisp package from [M-atthias’] sourceforge page. If you want to lend a hand testing or developing it would be greatly appreciated.

[via 43oh blog]