Archive for the 'Appnote of the Week' Category

Appnote of the Week: 2-axis compass

This week, from Honeywell, an application note on building a digital solid-state 2-axis compass:

Reference Design: Low Cost Compass

This design uses the HMC1052 sensor. You can get that sensor, the processing circuitry AND the microcontroller all rolled into one I2C-addressable package as the HMC6352 – a bit of a pain to solder but VERY easy to use. Currently about $40 from Digikey Canada.

The main disadvantage of this arrangement is that it requires the unit to be basically perfectly level for the reading to be good. If you want to accomodate some tilt, the Honeywell HMC1055 sensor kit is what you need: an HMC1052, an HMC1051 (for Z-axis) and a MEMSIC accelerometer for tilt. Available cheap from Digikey, just add microcontroller (and code, and opamps, etc.)

3-Axis Compass Sensor Set HMC1055

For all that compassy and tilty goodness in a single I2C-addressable package, you want the HMC6343, which at $166 from Digikey right now, is an obscenely expensive way to do it, but nice and self-contained.

Appnote of the Week: Logic Analyzer

Xilinx has an interesting article on embedding instrumentation in a design for field debugging. Within that appnote is an interesting section that gives you the building blocks you need to start designing your own logic analyzer:

Embedded Instrumentation Using XC9500 CPLDs

Naturally, there’s still some work to be done with it, but it’s a decent enough start.

Appnote of the Week: Battery Charging

Charging batteries properly is more difficult than you might think, and definitely more difficult than cheap power tool companies engineer for. The simple lightweight charger that comes with a cheap cordless drill is almost assuredly a piece of crap that will kill the batteries in short order.

Smart chargers monitor the state of the battery to cut off charging at the proper time. For NiCd and NiMh cells, this reduces cell damage. For LiIon cells, it reduces explosions and generally highly-exothermic scenarios. Atmel’s got a decent appnote on some of these algorithms:

AVR450: Battery Charger for SLA, NiCd, NiMh and Li-ion Batteries

Now you can build your own, and keep from having to buy a new drill just to get a new battery (that the store you bought it at no longer has / wants 80% of the price of the drill for).

Appnote of the Week: DTMF Generation

I once had an idea for a portable speed-dial device that you held up to a payphone to dial any of, say, 100 stored numbers. Software with that capability on PDAs were the first nail in the coffin for me on that idea; that someone had done it before, along with the whole rise of cellphones thing, pretty much sealed the deal. This would still have been interesting to read back then, though:

AVR314: DTMF Generator

The appnote basically gives the derivation of a DDS system for DTMF signals, and the included flowcharts and descriptions would make this a snap to implement on any microcontroller, Atmel or otherwise.

Appnote of the Week: Charlieplexing

Maxim has an interesting appnote on driving a bunch of LED displays using fewer I/O lines than normal

Charlieplexing: Reduced Pin-Count LED Display Multiplexing

An interesting approach to multiplexing the segment drives with the digit drives for multi-digit LED displays. It’s easy enough to implement on your own microcontroller, though unfortunately you don’t get the nifty constant-current driving that Maxim’s chips give you.

Appnote of the Week: Switching Supply for High-Power LEDs

Continuing on my high-brightness LED kick, here’s a few designs for switch-mode constant-current supplies for high-power LEDs, courtesy of ON Semiconductor:

12V AC-DC MC34063 LED Buck Driver

The MC34063 is a nice chip to use purely based on price – it’s dirt cheap. You can also get a fair amount of efficiency from it, though apparently the darlington output stage is somewhat lacking. Still, it’s available in a DIP8 package, and did I mention… dirt cheap? $0.83CAD from Digikey in singles, drops to under $0.30CAD in the thousands.

Considering that any linear system (constant-current regulator, plain ol’ resistor) is going to give you something on the order of 50-60% efficiency, and this’ll give you on the order of 75-85%… not bad at all.

Appnote of the Week: Measuring Power Supply efficiency

An interesting appnote from Maxim, on building a rig to test the efficiency of power supplies:

Practical Data Acquisition using a Windows-based Power Meter

A neat rig all told, and shows of a few of Maxim’s cool parts, but it originally came to my attention when a former boss saw this line and felt the need to share:

"At 9600 baud, it takes more than one millisecond to transmit eight bits of data together with the start and stop bits. This is obvious in hindsight, but it can give the designer hours of undeserved enjoyment not only in wondering why data is not reaching the PC correctly, but also in illustrating the difference in operating speeds of the microprocessor and the RS-232 link."

The voice of experience rings loud and clear with that one.

Appnote of the Week: Controlling high-brightness LEDs

This week, an appnote from Freescale on different ways to control high-brightness LEDs:

Bright Approaches to Microcontroller-Based LED Drivers

Driving these LEDs with constant current is really important for consistent results. Wavelength of the light is dependent on the current, so driving a precise value is crucial. However, forward voltage varies with current, and also experiences process variations, so the standard LED in series approach is pretty well useless if you want to control the colour of RGB LEDs properly. Thus, you need a constant current source that doesn’t depend on the forward voltage of the diode. This appnote presents a few solutions, though they head straight for the switching power supply that doesn’t work with RGB LEDs with a common supply terminal.

Appnote of the Week: MP3 player using LPC2148

This week, from NXP, we have an appnote on building an all-software MP3 player using their LPC2148 ARM7TDMI microcontroller:

Realizing an MP3 player with the LPC2148, using libmad and EFSL

To compare: this solution uses the DAC built into the LPC2148, so it gets 10 bits of resolution for one channel. Adding an external audio DAC for a couple bucks brings that to 16 bits and two channels. The LPC2148 is running about $14 at Digikey in unit quantity right now.

Compare with the popular VLSI chips: the job is done for you, but the chips run $20 from Sparkfun, and 16 Euro from VLSI directly (!). Those prices include license fees, though, but you still need another controller to interface with your storage and get the data and commands to the codec chip. So this does have some cost benefit.

Appnote of the Week: Microcontroller Oscillators

While not a company appnote per se, this document provides a decent overview of the different types of oscillators that can be used with a microcontroller. From AVRFreaks:

Why you need a Clock Source

A bit AVR-centric, but it covers a number of useful topics, including how to properly size the loading caps on a crystal oscillator.