Archive for June, 2008

Useful code excerpts for the MSP430F2012

Sunday, June 29th, 2008

Here are a couple little code excerpts that took me some time to figure out. I’m hoping that Google might help the rest of the world’s MSP430F2012 programmers save 5 minutes. (If they all find it, a total savings of 55 minutes!)

The MSP430F2012 defaults to a clock speed of 1 MHz, sourced from an onboard DCO. In order to get the DCO to be accurate, you have to load calibration constants from flash.

BCSCTL1 = CALBC1_1MHZ; // DCO calibration: set range
DCOCTL = CALDCO_1MHZ; // DCO calibration: set DCO step and modulation

Then you can initialize the timer to count in increments of 100 ms.

TACCTL0 = CCIE; // CCR0 interrupt enabled, compare mode
TACCR0 = 50000;
TACTL = TASSEL_2 + ID_1 + MC_1; // SMCLK as source; divide by 2; up mode

Anyway, I hope this is useful to someone out there.

Top Engineers Shun Massacre Machinery

Thursday, June 26th, 2008

Philip Taubman had an interesting article on the front page of the New York Times yesterday: “Top Engineers Shun Military; Concern Grows.” The article profiles an engineer by the name of Paul Kaminski who worked for the Air Force designing planes for several decades. Kaminski now heads a task force that is attempting to deal with the difficulties the military is having recruiting engineers. According to Taubman, the number of engineers working for the Air Force has decreased 35-40% over the last 14 years. The reasons cited for the decline include:

  • better pay in high tech firms
  • more cachet at Google or the like
  • more engineering students from foreign countries who can’t get security clearances
  • lack of exposure to new technology in the military

Strangely, Taubman omits what I suspect, perhaps foolishly, is the central cause– top engineers are driven to solve problems. As I consider the central problems facing the world today, I do not notice an alarming lack of weapon systems. The US military is already extremely good at killing. If you’re really a top engineer, you can choose where to work. I can’t imagine why someone would be drawn to weaponry when there are so many obvious unsolved problems elsewhere.

As an interesting footnote, the article gave no hints of what Mr. Kaminski’s task force will do about the lack of people willing to carry out the jobs they have in exchange for the salaries they offer. One solution might be to stop trying to build so many damn weapon systems.

I have told my sons that they are not under any circumstances to take part in massacres, and that the news of massacres of enemies is not to fill them with satisfaction or glee. I have also told them not to work for companies which make massacre machinery, and to express contempt for people who think we need machinery like that.

–Kurt Vonnegut, Slaughterhouse Five

A matter of scale

Wednesday, June 25th, 2008

I am periodically accosted at parties when someone mentions to a friend that I work on renewable energy.

“You there, always talking about renewable energy and solar cells and all that! Why haven’t you solved this greenhouse problem yet?”

The problem is one of scale. To explain what I mean, I have to talk about a sculpture.

Arthur Ganson has a sculpture at the MIT museum consisting of a 12-stage geartrain, where each stage reduces the speed of rotation by a factor of 50. The left end is spinning furiously at around 200 rpm; the right end is embedded in a concrete block. The end in the concrete makes one revolution every 2 trillion years or so.

Arthur Ganson, machine with concrete

(You can see a video of the sculpture at the 8:30 mark in this video from the 2004 TED conference, but finish reading this first.)

I can see that the gear at the left end of the sculpture is spinning. After three or four 50:1 reductions, I can only see the gears moving if I watch for a while. When I think about gear reductions in the abstract, I think, “Sure, if you reduced the speed enough, it wouldn’t break the concrete,” but when I look at the real thing, it’s baffling. I stand there looking at the sculpture, knowing that I should expect to see what I’m seeing, but my weak human mind can’t adjust its expectations.

In the same way that when I look at Ganson’s sculpture, I can’t understand what I’m seeing, it’s hard for us to grasp on a visceral level the difference between the 1000 watts Americans use in their homes, the 1,000,000,000 watts we generate in a large power plant, and the 15,000,000,000,000 watts that we use globally.

We hear news of advances in renewable energy. The amount of installed wind power has been growing at around 30% for the last two years. Investment in renewable energy startups is through the roof in the last 2 or 3 years. The news we hear of huge investments, the technological breakthroughs, and Prius drivers loading up with compact fluorescent bulbs at Costco are the first gear spinning wildly (well, maybe not the people loading up the bulbs– they’re just excitable).

Yet on the global scale, the vast majority of our energy comes from fossil fuels. Even after 30 years of work on photovoltaics, the global installed capacity is around 8 GW, or roughly 1/2000th of the energy we use globally. Windpower is about ten times larger, but still only approaching 1% of global energy usage. (I’m ignoring the differences between installed capacity and actual production here, but that correction just makes the fraction of renewables even more slight.)

What’s more, the concrete block end of the spectrum is not reported in the news (rightly so, as it’s not interesting). The massive juggernaut of fossil fuel infrastructure continues to expand. Installation of large natural gas turbines is proceeding in China at more than 1 GW per week, which is enough to match the entire history of photovoltaics installed worldwide in 2 months.

What’s the result? We think we see progress–the gear spinning wildly–but if a global switch to renewables actually happens, it will take a lot longer than our scale-limited minds expect.