Calibrating The MSP430 Digitally Controlled Oscillator

The MSP430 is a popular microcontroller, and on board is a neat little clock source, a digitally controlled oscillator, or DCO. This oscillator can be used for everything from setting baud rates for a UART or for setting the clock for a VGA output.

While the DCO is precise – once you set it, it’ll keep ticking off at the correct rate – it’s not accurate. Without a bit of code, it’s difficult to set the DCO to the rate you want, and the code to set that rate will be different between different chips.

When [Mike] tried to set up a UART between an MSP430 and a Bluetooth module, he ran into a problem. Setting the MSP to the correct baud rate was difficult. Luckily, there’s a way around that.

There’s an easy way to set the DCO on the MSP programatically; just set two timers – one that interrupts every 512 cycles, with its clock source set to the DCO, and another that interrupts every 32768 cycles that gets its clock from a 32.768kHz crystal. The first timer clicks off every second, and by multiplying the first timer by 512, the real speed of the DCO can be deduced.

After playing around with this technique and testing the same code on two different chips, [Mike] found there can be a difference of almost 1MHz between the DCOs from chip to chip. That’s something that would have been helpful to know when he was playing around with VGA on the ‘430. Back then he just used a crystal.

An MSP430-based Automatic Fish Feeder

[Dmitri] wanted to buy an automatic feeding setup for his aquarium, but he found that most off-the-shelf feeders are really inaccurate with portion control. [Dmitri]’s fish is sensitive to overfeeding, so an off-the-shelf feeder wouldn’t get the job done. Since [Dmitri] knows a thing or two about electronics, he set out to build his own microcontroller-based automatic feeding machine.

[Dmitri]’s machine is based around a MSP430 that starts feeding at scheduled times and controls how much food is dispensed. The MSP lives on a custom PCB that [Dmitri] designed, which includes a stepper motor driver and input for an endstop sensor. The board is wired to a stepper motor that advances a small wooden board with a series of holes in it. Each hole is filled with a single serving of food. The board slides along a piece of U-channel, and food drops out of each hole into the aquarium when the hole reaches the end of the channel.

The whole build is very well documented, and [Dmitri] explains each block of his schematic in detail. His firmware is also open-source, so you can build your own fish feeder based off of his design. Check out the video after the break to see the feeder in action.

Continue reading “An MSP430-based Automatic Fish Feeder”

Calculator Remote with Launchpad

Calculator + MSP430 + IR LED = TV Remote?

Eschewing the store-bought solution, [Stefan] managed to build a TV remote out of an old calculator. The brains of the calculator were discarded and replaced with an MSP430, leaving only the button matrix and enclosure. Rather than look it up, he successfully mapped the matrix manually before getting stumped with the infrared code timings. Some research pointed him to a peculiarity with Samsung IR codes and with help from an open source remote control library he got it working.

When the range was too limited to satisfy him he added a booster circuit and an LED driver which he snapped off the top of an old remote; now it works from 30 feet away. Some electrical tape and hot glue later and it all fit back into the original case.

It cannot take photos or play Super Smash Brothers, but it does what a remote needs to do: browses channels in the guide, control volume, and turn the TV on or off. Considering that all this calculator was built to do was boring basic arithmetic, it is a procrastination-enabling upgrade.

See the video after the break for some smiles.

Continue reading “Calculator + MSP430 + IR LED = TV Remote?”

An MSP430 Flash Emulation Tool From An MSP430

It isn’t much trouble programming one of TI’s MSP430 chips, but outside of the official Flash Emulation Tool, TI doesn’t make programming one of these microcontrollers cheap. The most common way of programming an MSP430 is using a Launchpad Dev board, and [Vicente] has the best looking one yet.

The MSP430 series of chips can be programmed through JTAG or Spy-By-Wire, and the official, professional engineering tool from TI for these chips costs about $100. Those of us with more sense than money have another option – use one of the TI Launchpad dev boards as an MSP430 programmer.

[Vicente]’s project uses the MSP430G2 Launchpad, with just a few wires going to the proper connector found in the official programmer from TI. There are a few limitations; the programmer only works at 3.6V, so programming 1.8V devices might not be a good idea. Also, it only works with Spy-By-Wire and no JTAG support is available. Still, it’s a great looking project, and does exactly what it’s designed to.

 

43oh.com Wasn’t Next To The Texas Instruments Booth

In addition to all the cool boards and booster packs found at Texas Instruments’ booth at Maker Faire, the folks from 43oh.com made a showing, but not next to the TI booth. In fairness, the TI booth was right across from NASA. 43oh is cool, but not NASA cool.

[Eric], known on the 43oh forums as [spirilis] showed off a few of the neat bits and bobs developed on the forums including a lightning detector, a VFD clock, a robot, and a whole lot of blinky things. There was an astonishing array of projects and boards at the booth, covering everything from OLEDs to motor drivers.

43oh is an interesting community centered around TI’s microcontrollers, like the AVRfreaks forum built around Atmel’s offerings. 43oh has a very active forum, IRC, and a store featuring projects made by members. It was great to see these guys at the faire, and we wish more of the homespun unofficial communities would make more of a showing at cons in the future.

Sorry about the mic cutting out in the video above. There was a sea of spewing RF near the booth. If anyone has advice for a *digital* wireless mic setup, we’re all ears. This is the current rig.

Proper Debugging For Energia Sketches

Moving a sketch from Energia to Code Composer Studio

Energia is a tool that brings the Arduino and Wiring framework to Texas Instruments’ MSP430 microcontrollers and the MSP430 Launchpad development board. This allows for easy development in an Arduino-like environment while targeting a different microcontroller family.

One problem with Energia and Arduino is the difficulty of debugging. Usually, we’re stuck putting a Serial.println(); and watching the serial port to trace what our program is doing. Other options include blinking LEDs, or using external displays.

Code Composer Studio, TI’s official development tool, allows for line-by-line debugging of applications. You can set breakpoints, watch the value of variables, and step through an application one instruction at a time.

The good news is that the latest version of Code Composer Studio supports importing Energia sketches. Once imported, you can step through the code and easily debug your application. This is a huge help to people developing more complex software using Energia, such as libraries.

TI gives us an overview of the new feature in a video after the break.

[Thanks to Adrian for the tip!]

Continue reading “Proper Debugging For Energia Sketches”

A Tiny Bubble Display Alarm Clock

For one reason or another, we’re starting to see a lot of projects featuring some old seven-segment HP bubble displays. Yes, those displays once relegated to ancient electronic calculators are making a comeback for reasons we can’t understand why, other than speculation that someone found a bunch of NOS displays. [Markus] picked up a few of these olde tymie displays and built a very nice bubble display alarm clock.

To keep things simple, [Markus] didn’t go the usual ATMega with RTC route. Instead, he’s using an MSP430, a 32kHz crystal, and a few buttons to construct this tiny alarm clock. It’s powered by a single AAA battery, and in a nice change of pace from fancy, professionally made boards, [Markus] built this on some perfboard with a little bit of enameled wire.

It’s a neat little clock, and with the speaker and most likely extreme battery life thanks to the MSP430, a wonderful portable, classic-looking alarm clock. Video of [Markus] manipulating the time below.

Continue reading “A Tiny Bubble Display Alarm Clock”