Happy New Year

Greetings People of the Internet!  First off, Happy New Year!  The last twelve months have proven quite interesting, yes?  Whether good or bad, I think the term “interesting” is fairly safe here.  I can’t say my 2011 has been all that great, but it’s certainly been interesting.  I do hope, however, that you’ve had a good year.  🙂

One other quick note; in case you’re wondering what happened to Grieg, he died of heart failure in 1907.  And in case you’re wondering what happened to grieg.gotdns.com (my former domain name), I finally bit the bullet and purchased a real address for this trite little blog: nlvocables.com.  If you subscribe, you may want to update your links (although I intend to leave grieg.gotdns.com alive and forwarding for as long as the internet allows).  Please let me know if you have any issues.

As usual, keep the comments and questions coming.  Best wishes for a successful 2012!

New Toys: Bus Pirate and Digipots

That’s right, I’m now the proud new owner of a Dangerous Prototypes’ Bus Pirate.  I’ve been looking at these things for awhile, and finally decided that I should stop being such a cheapskate and just get one.  Yea, I know I can always rig up one of my AVRs to do serial communications, but this is just so much more convenient.  And at $30 (I got mine from SparkFun), it’s a pretty sweet deal.

Bus Pirate Closeup

So what did I get for my three Hamiltons?  Well, check this out (courtesy SFE):

  • Supported protocols:
    • 1-Wire
    • I2C
    • SPI
    • JTAG
    • Asynchronous serial
    • MIDI
    • PC keyboard
    • HD44780 LCD
    • 2- and 3-wire libraries with bitwise pin control
    • Scriptable binary bitbang, 1-Wire, I2C, SPI, and UART modes
  • 0-5.5volt tolerant pins
  • 0-6volt measurement probe
  • 1Hz – 40MHz frequency measurement
  • 1kHz – 4MHz pulse-width modulator, frequency generator
  • On-board multi-voltage pull-up resistors
  • On-board 3.3volt and 5volt power supplies with software reset
  • Macros for common operations
  • Bus traffic sniffers (SPI, I2C)
  • A bootloader for easy firmware updates
  • Transparent USB->serial mode
  • 10Hz – 1MHz low-speed logic analyzer
  • Scriptable from Perl, Python, etc. (aka everything)
  • Translations (currently Spanish and Italian)
  • Enumerates as a virtual COM port over USB
  • Can operate as AVR STK v2 clone programmer
  • Access to PIC24FJ64 ICSP programming port

Needless to say, the Bus Pirate’s capabilities are extensive.  And open source.

Thus far I’ve tested out its UART and SPI modes, and have been sufficiently impressed.  Which leads me to my next new toy, an SPI digital potentiometer, the MCP42010:

MCP42010 Digital Potentiometer

This particular part comes in a 14-DIP package, contains two 10k potentiometers with 8-bit resolution, and can be had for just $2.40 from Digi-Key.  I’m thinking of using it in an audio compressor / volume control prototype, but it may come in handy elsewhere.

Controlling this digipot is just ridiculously easy when using the Bus Pirate.  Once connected and in SPI mode, I simply issue the command “[0b11011111, x]” (without the quotes), where x is a value from 0-255 representing the potentiometers’ wiper positions.  The two least significant bits (11 above) of the first byte tell the chip which of its potentiometers to adjust.  You can set one at a time, or both simultaneously.  Bits 4 and 5 of the first byte (01 above) allow you to either write data to the wiper registers or put the digipot into a high-impedance shutdown mode (which could be great for reducing power consumption).  The same effect can be achieved by pulling pin 12 low.  Want to reset the potentiometer to its 50% position (this also happens automatically on power-up)?  Pin 11 will do just that when pulled low.  For all the gory details, take a look at this datasheet.

Bus Pirate and Digipot Test Setup

This little chip is pretty impressive.  It’s also available in 50k and 100k versions.  The only thing it really can’t do is handle much current (wiper current should be kept under ±1mA).  But just toss in some buffer op-amps and you’ll be all set.  That’s my plan anyways.

LabVIEW: The Simple Talking Voltmeter

A couple of weeks ago I spent some time examining a fairly complex circuit board from my old, but still functional, clock radio/CD player.  I was using the probe of my handheld multimeter to measure voltages at various IC pins and circuit traces.  At one point during the process I thought, “Gee, wouldn’t it be nice if I had someone here to read the voltmeter to me as I test various points?  That way I could focus on my probe and not accidentally short neighboring pins.”  But then I realized that I did have someone to do just that: Microsoft Sam.  I present to you the NI LabVIEW talking voltmeter:

For those of you without LabVIEW, here are a few screenshots of the subVIs shown in the video above.  Don’t forget that you can always download a free, unrestricted 30-day trial of LabVIEW from the NI website (seriously, it’s awesome, you should try it).

First, the initialization VI, which opens the Microsoft ISpeechVoice reference:

Initializing the Speed Interface

Next, the blocks responsible for detecting new steady-state voltages:

Detecting New Steady-State Voltages

Finally, the code which converts numbers into strings and sends them to Sam:

Convert and Speak the Values

Many thanks to Grant Heimbach, whose sample speech VI saved me a lot of development time (his original code is available on the NI Developer Community).

Click here to download a simple example VI which utilizes the code shown above.

The full, unmodified IOBoard Voltmeter program, as well as all of its supporting components, can be located at the bottom of the Mobile Studio Downloads page.

Got questions or comments?  As always, feel free to leave them below!