Wednesday, October 22, 2008

Engineers vs. Computer Scientists

I've been thinking lately about how people in other fields, such as engineering, view programming and computing in general. This morning I think I figured it out:
Engineers write programs to solve problems. Computer scientists write programs to create problems.
Neatly summarizes the situation, don't you think?

Friday, October 17, 2008

Picture of the day

This is a screenshot of a "Robot Lawnmower Simulation" that I assigned as a project in a CS2 course I'm teaching.

Here's the link:

Sunday, October 5, 2008

max7219 is working

This past week I was able to get the AVR to talk to a max7219 multiplexed LED driver. One thing that took a while to figure out is that to bring the max7219 out of shutdown mode, you write a 1 to the shutdown register, not a 0. Fortunately, putting the chip in test mode (all LEDs lit) works even in shutdown mode, so I was at least able to verify that the chip worked and it was receiving data. After getting it out of shutdown mode, progress was rapid. (In the process of debugging, I also discovered that the max7219 works best when its ground pins are connected to ground :-)

One nice feature of the max7219 is that it supports undecoded output, meaning that you're not limited to decimal, hex, or code-B when using 7-segment displays. Some weird people out there have come up with 7 segment text fonts, which (surprisingly) aren't totally unreadable.

Aside from adding some buttons for user input, pretty much all of the technical details of my top-secret AVR project have been ironed out. (I still have to finish writing the code, but that should be the easy part.)

One interesting wrinkle is that the max7219 doesn't precisely support SPI, but a protocol very much like it. So, I actually have two SPI busses, one for the ds1305, and one for the max7219. (I should have ordered the max7221, which is fully SPI-compatible.) No big deal, since the atmega48/88/168 chips have a lot of I/O pins. (I'm currently using the '48, since it's cheapest.)