A Real DIY Electron Microscope

This story has been all over the web lately, and deservedly so. Ben Krasnow has built a scanning electron microscope, from scratch, in his garage!

This type of project is the essence of hacking and is the type of thinking and project building that I want to be doing and showcasing here on the hacker workshop.

Go view Ben's video. He does a great job explaining his invention. And did I mention he built an electron microscope from scratch, in his garage!

Amazing. Ben, my hat's off to you. I can't wait to see further refinements of his project.

Program Your MSP430 Graphically?

Texas Instruments has released a beta of GRACE, the Graphical Peripheral Configuration Tool, for the MSP430 line of processors. Apparently this is a tool that'll help you program (or at least configure) your MSP430 graphically.

I haven't downloaded the tool yet so I can't comment on it. It certainly is intriguing. configuring peripherals is one of the hardest parts of embedded programming; there are a lot (sometimes a whole lot) of configuration bits you have to set just right to get things to work. On more complex processors, this can be tedious and time consuming and frustrating. I like the idea in concept; it'll be interesting to see how well TI executes on the idea.

GRACE is a free download that plugs into Code Composer Studio. There's an introductory video on the landing page.

I'd love to hear your thoughts on this tool and your experiences if you decide to use it.

(via Hackaday)

Site Rebuild

I had to rebuild the website this weekend. I had installed WordPress and, without really knowing what I was doing, hacked a theme I'd downloaded (one that was not designed for WordPress) into it. I somehow managed to break my RSS feeds in the process.

So I gave myself a crash course in WordPress, CSS, and themes this weekend. I'm still working on polishing it (comments aren't working yet, for instance) but at least now it's a maintainable structure.

In the process, I exported and imported all the existing content. It seems that Categories and Tags didn't survive the export/import. Not a big loss. I recreated them by hand. (Easy to do when there's only ~16 posts in the history of the site.)

I'll try to get comments working as soon as possible. You know, for the two readers I currently have.

Frustration

How do you deal with the frustration of prototyping a circuit, only to find that it doesn't work as you expected it to?

I'm prototyping a circuit for the Renesas RX Design Contest that uses the Texas Instruments PCM3060 audio CODEC. I'm basically copying someone else's schematic. And I can't get it to work as expected. I'm feeding the CODEC a clock signal but it's not giving me any data from the ADC. I etched two circuit boards and both have the same behavior. I don't know what the problem is. Did I wire it wrong? Did I damage the chips? I don't know.

Very frustrating. Very demoralizing. In times like this I think of all the time and effort I put into a design and prototype, and the frustration that it gets me, and wonder why I do it.

Hopefully I'll get an answer to the question I posted on TI's forums about this problem. I don't know how to make any progress from where I am now.

Arduino, Launchpad, and Cortex M0

I was reviewing my posts over the past few days and noticed something that I found quite striking. In this post, I compared the ATMega328 chip, found in the Arduino, against the MSP430 chips found in the TI Launchpad. Note that the MSP430G2211, which is a stripped-down microcontroller with little memory and few peripherals, and is the least expensive of the three chips in the table, is priced the same as the NXP Cortex M0 LPC1111 that I mentioned in this post.

Think about that. For the same price as a 16 bit processor with 2K Flash, 128 bytes of RAM, and a single timer running at 16MHz, you could have a 32 bit processor with 8K flash, 2K RAM, I2C, SPI, a UART, an ADC and four timers running at 50MHz.

Wow.

Why use such a small 16 bit processor when a much more powerful 32 bit processor can be had for the same price? Honestly, unless you're building a device that needs to run for years on batteries, I don't know why you would. (I haven't reviewed the M0's low power modes to know how they compare against the MSP430.)

Now admittedly, I'm just a hobbyist and don't know much about selection of parts in industry. There may be compelling reasons to choose the MSP430 over the M0. I'm just really struck by the vast difference in two chips that have the same price. (Okay, to be fair, if you get the MSP430G2211 in the QFN package to match the LPC1111, the price does go down to $1.93. But still... that 10 cent difference gets you a huge difference in performance and capabilities.)

The Arduino vs. The Launchpad

Currently, there are two processors/platforms that are getting a lot of attention in the hobbyist community. The first, of course, is the Arduino.

The second is the TI MSP430 line of processors, particularly the Launchpad platform. These have become popular because TI has been practically giving them away. At $4.30 including shipping, it's the least costly microcontroller development platform that I'm aware of.

In my video yesterday, I had some criticism for the MSP430. Granted, NXP's giveaway certainly incented me to be derogatory to any 8/16 bit micro that I could find, but in all honesty, the Launchpad doesn't seem to have a lot going for it after you get past the price.

Let's look at some of the key differences between these two platforms. (Note that two processors ship with the Launchpad; you can swap between them because the processor is in a socket):

SD CardSTM32F4
D2 (N/C for SPI)PC10
D3 (or CS#)PC11
CMD (or MOSI)PD2
CDCard detect signal; not used in this demo.
CLK (or SCK)PC12
VCC3.3V
GNDGND
D0 (or MISO)PC8
D1 (or IRQ)PC9
WPWrite protect signal; not used in this demo.

(Note: The table above was lost on 11/18/2011 after my site was hacked and I rebuilt it. I was unable to find the original table data.)

You can see that the ATMega has the bells and whistles that the MSP430 doesn't. Granted, you're going to pay more for one of those chips, and when you're making hundreds of thousands of devices, price is certainly important. But I just don't get the whole MSP430 proposition, especially at the low end. Why put a 16 bit ALU in a device with only 128 bytes of RAM?

The one thing that the MSP430 does really well is save power. With six different low power modes, the MSP430 can draw less than a microamp while idling. That's important for battery powered devices but not really something that is generally important to the hobbyist community.

To be fair to TI, the MSP430 line does include more capable processors than those that ship with the Launchpad. I tried to find one that would be comparable to the Arduino's ATMega328 and it looks like the MSP430F157 is close. But to get the PWM, I2C, SPI, UART, and A/D you're going to have to go to a 64 pin surface mount package and run at a top speed of 8MHz.

I just don't get TI's strategy on this. Packaging the low-end MSP430 devices into the Launchpad, pricing it where they did, and even using an "Arduino-esque" footprint all strongly suggest that TI is going after the hobbyist community with the Launchpad. They had to know the comparisons to the Arduino would come. Why, oh why, did they ship the Launchpad with such an anemic processor? I just don't get it. The only thing here that would attract a hobbyist to the Launchpad over the Arduino is price. TI, that's just not enough. The Arduino has an entire hobbyist ecosystem up and running and providing all kinds of support to the community.

My prediction is that the vast majority of Launchpads that TI has shipped are going to sit on shelves, gathering dust, while the more expensive (much more expensive, on a relative basis) Arduino's are going to continue to be the centerpieces of innovative, exciting projects from the hobbyist community.

I do have the Launchpad in my hands, and because I have it, and others have it, I will use it for future projects and tutorials. But frankly, I can't think of any applications that would have me sitting at my desk, trying to find a suitable processor, for which the MSP430G2231 would be the best choice.

What are your thoughts?

Breaking the 8/16 Bit Habit

I have submitted my video online for a free NXP LPCXpresso board. If NXP awards me one of these dev kits, you can bet that it'll show up in future episodes of The Hacker Workshop. NXP makes a lot of cool 32 bit processors and I'd probably be working on one of them now if Rensas hadn't wooed me away with the RX Design Contest. Submit a video of yourself destroying an 8 or 16 bit processor, and you too could end up with a free LPCXPresso board!

NPC LPCXpresso Giveaway

NXP is giving away LPCXPresso boards to people who submit a video of themselves destroying an 8 or 16 bit micro. I'm not sure which board they're giving away or what the qualifications are for being eligible (the submission ominously requires a "Business" email address) but it's worth a try I suppose.

The Cortex M0 is positioned as an upgrade for existing 8 or 16 bit applications. Color me jaded, but the M0 specs are significantly more impressive than the typical 8/16 bit micro. The low-end LPC111x series tout the following features (datasheet):

  • System:
    • ARM Cortex-M0 processor, running at frequencies of up to 50 MHz.
    • ARM Cortex-M0 built-in Nested Vectored Interrupt Controller (NVIC).
    • Serial Wire Debug.
    • System tick timer.
  • Memory:
    • 32 kB (LPC1114), 24 kB (LPC1113), 16 kB (LPC1112), or 8 kB (LPC1111) on-chip flash programming memory.
    • 8 kB, 4 kB, or 2 kB SRAM
    • In-System Programming (ISP) and In-Application Programming (IAP) via on-chip bootloader software.
  • Digital peripherals:
    • Up to 42 General Purpose I/O (GPIO) pins with configurable pull-up/pull-down resistors.
    • GPIO pins can be used as edge and level sensitive interrupt sources.
    • High-current output driver (20 mA) on one pin.
    • High-current sink drivers (20 mA) on two I2C-bus pins in Fast-mode Plus.
    • Four general purpose counter/timers with a total of four capture inputs and 13 match outputs.
    • Programmable WatchDog Timer (WDT).
  • Analog peripherals:
    • 10-bit ADC with input multiplexing among 8 pins.
  • Serial interfaces:
    • UART with fractional baud rate generation, internal FIFO, and RS-485 support.
    • Two SPI controllers with SSP features and with FIFO and multi-protocol capabilities (second SPI on LQFP48 and PLCC44 packages only).
    • I2C-bus interface supporting full I2C-bus specification and Fast-mode Plus with a data rate of 1 Mbit/s with multiple address recognition and monitor mode.
  • Clock generation:
    • 12 MHz internal RC oscillator trimmed to 1 % accuracy that can optionally be used as a system clock.
    • Crystal oscillator with an operating range of 1 MHz to 25 MHz.
    • Programmable watchdog oscillator with a frequency range of 7.8 kHz to 1.8 MHz.
    • PLL allows CPU operation up to the maximum CPU rate without the need for a high-frequency crystal. May be run from the system oscillator or the internal RC oscillator.
    • Clock output function with divider that can reflect the system oscillator clock, IRC clock, CPU clock, and the Watchdog clock.
  • Power control:
    • Integrated PMU (Power Management Unit) to minimize power consumption during Sleep, Deep-sleep, and Deep power-down modes.
    • Power profiles residing in boot ROM allowing to optimize performance and minimize power consumption for any given application through one simple function call. (LPC1100L series, on LPC111x/102/202/302 only.)
    • Three reduced power modes: Sleep, Deep-sleep, and Deep power-down.
    • Processor wake-up from Deep-sleep mode via a dedicated start logic using up to 13 of the functional pins.
    • Power-On Reset (POR).
    • Brownout detect with four separate thresholds for interrupt and forced reset.
  • Unique device serial number for identification.
  • Single power supply (1.8 V to 3.6 V).
  • Available as 48-pin LQFP package, 33-pin HVQFN package, and 44-pin PLCC package.

That pretty much eclipses any 8/16 bit micro I've ever used. The LPC1111 is priced as low as $2.02 for one piece at Digi-Key. That's easily within the realm of hobbyist dollars! (The QFN packaging, though, could be a roadblock to many. You can get an LPC1100L in 48-LQFP for $2.80)

I think I'll head outside and take a few video clips of semiconductor destruction today.

Arduino Sketches on the Launchpad?

Chris Hulbert has created a header file for the TI MSP430 Launchpad that ports some of the Arduino functions to TI's platform.

Macros for setup(), loop(), delay(), pinMode(), pinBit(), digitalWrite(), and digitalRead() are included. Chris also disables the MSP430's watchdog timer, which will help a lot of newbies (and would have helped me on my first project).

It'll be interesting to see how "Arduino-like" the community can make the TI platform. TI is clearly going after the hobbyist market with this platform, but they certainly aren't providing the support or the ecosystem that's needed to really engage this audience. Tools like this one may make up the difference. (I doubt, however, that the MSP430 will ever approach the popularity of the Arduino. TI just doesn't seem to "get it" about supporting and engaging the hobbyist community.)

I still plan on creating some tutorials for the Launchpad, but it'll have to wait at least until the Renesas RX Design Contest ends on the 27th.