MMC Works
Okay, I’m a dork. I made so many mistakes trying to figure out this serial communications thing, it’s not even funny. But, I’ve got it working now.
Two major things went wrong. First, I failed to realize that the ’32, by default, operates off of its internal 1.0 MHz oscillator. You have to program clock selection bits as a separate step to get it to use an external crystal (which I had connected, but didn’t realize wasn’t being used). Since all of my baud rate calculations were being done assuming a 4.0 MHz clock, they were way off (which explained the bizarre timings I was seeing on the TX pin).
Unfortunately, try as I might, I still can’t seem to get the external crystal to work. I’ve succesfully driven a PIC16F877 at 20 MHz on perf board, so I’m not sure why I can’t get the ATmega32 to run at 8 MHz.
So I punted on trying to get the crystal to work, and configured the MMC to operate at 9600 bps instead of 38.4 kbps (the ATmega32 can’t drive a serial line at 38.4 kbps with less than 8.5% bit-rate error, and that may be too much for the MMC). After much futzing with this speed, I still couldn’t make it work, which brings us to my utter stupidity: the MMC wasn’t fully seated in its socket, and so wasn’t actually getting the signal!
It’s working for now, and so I’m going to spend some time actually writing software. I’ll write code to run the motors at a constant speed, regardless of load (within limits), and then drive the bot around in a small square or triangle. It won’t balance, so I’ll add a stabilizing caster wheel, but it will give me enough of a platform to work on that I can develop a basic PID controller.