Recent Changes - Search:



edit SideBar


Note to self: Update the Google Doc "Battle Timeline 10-27-08" with more fleshed out goals, and add Eric's schedule.

Latest Code

I revised the code a little bit -- got rid of the pull-down resistors used with the push-button switch. The code is "Arm_Legs_switch_20081106".

Talked to Eric Beug

I spoke to Eric Beug for the first time today. He was super helpful. Here's a quick summary of what he told me:

1. Using the Atmega168 MCU independent of the Arduino Diecimila is simple if you are just pulling the chip off the Arduino. The only external part you really need is the crystal oscillator and associated 22pF capacitors. But, if you want to program a new Atmega168 (one that didn't come with an Arduino board), you can't just stick it into an old Arduino board. Before you can communicate with the Atmega168 via the Arduino's USB port, you need to have already burned the Arduino "bootloader" into the chip's flash memory (download the Arduino bootloader here: The bootloader is a program that, like any other program you might upload to the Arduino, runs everytime the Atmega168 is powered up or reset. What's special about this little 2K program is that it tells the Atmega168 how to behave with the rest of the electronics on the Arduino board. An off-the-shelf Atmega168 has no idea what it's supposed to do if you just plug it direct into the Arduino board without the bootloader. So how do you upload the burn the bootloader on the Atmega168 without the Arduino interface? You need a chip-burner, a.k.a. AVR Writer. Atmel (the Atmega168 manufacturer) makes the STK500 chip-burner ($79 from Digi-key) for the product family that includes the Atmega168. (Note from Nov 13, 2008: our STK500 arrived today. See wiki entry "November 12 - Using the Chip Burner")

2. Hans at Eyebeam has an AVR Writer, but we should probably just get our own. Click here for purchasing, and to download the user guide and specs:

A cheaper alternative is the AVRISP mkII ($36 from Mouser We ordered the STK500 before we found the AVRISP mkII.

3. Don't solder the Atmega168 directly to the PCB, in case you need to reprogram it. Use a 28-pin IC socket instead.

4. We do not need the FTDI surface mount IC that is on the Arduino board. That's just there to aid in serial communication via the USB port. It is not necessary for serial communication via the RX/TX pins, which are used for communicating with XBee.

5. There's nothing on the XBee shield that we need either, so we can just place the XBee on our board. Again, use female sockets rather than soldering the XBee directly to the PCB. Besides possibly needing to reprogram the XBee, there's also the chance that the XBee will fail and need to be replaced.

6. There's different XBee series: Eric's familiar with Series 1 and Series 2. Series 1 uses a communication protocol that is more proprietary and less universal, so the Series 2 communication protocol is a better choice for future development. There's no price difference between Series 1 and 2, so we may as well go with Series 2 since we only have a handful of Series 1 XBees at Eyebeam. Click here for Series 2 purchasing and user manual:

7. XBee networks cannot assign network addresses dynamically (unless we develop this functionality ourselves, but that sounds beyond the scope of what we're doing). This limitation makes the XBee network very secure (yay). In terms of development, this means we cannot just burn the same code onto every XBee because we need to burn a different network address onto each one. Alternatively, we can tell the Atmega168 to assign the address, but again that means adjusting the code for each Atmega168 to use a different address. Not the end of the world, just slows us down a bit when we get to that point of mini-mass production.

Finishing the Elmo Hack

The microcontroller on the Arduino is the Atmega168. As used on the Arduino, it has 20 I/O pins. Do we have enough pins to take advantage of all of Elmo's parts? Remember that two of the I/O pins, 0 and 1, are used by the XBee for wireless serial communication with other XBees, so that leaves only 18 I/O pins.


Arm Sensor: 4
Leg Sensor: 5
Gyroscope: 4


Arm Motor: 3 (2 for bipolar motor operation; 1 for PWM control) Leg Motor: 3 (2 for bipolar motor operation; 1 for PWM control) TOTAL OUTPUTS: 6


Aargh--We are one I/O pin short.

Quick (temporary) fix: sacrifice one of the sensor outputs (do we really need to know when the arm has rotated to 0 degrees, versus when it is rotated to -20 degrees?).

Longterm fix: when we pull the Atmega168 off the Arduino, we'll able to free-up some I/O pins. Atmega168 pins 1, 9, and 10 may be used for I/O, but the Arduino board uses pin 1 for the reset button, and pins 9 and 10 for connecting a 16MHz crystal oscillator as an external clock source. We can either scrap the button or the crystal oscillator when we make our own circuit board.

Alternative (Preferred) Longterm fix: As suggested by Eric, we can use a shift-register to free up some pins:

For example, to free up three of the six output pins: Connect the three arm and three leg motor control signals to the parallel output of an 8-bit shift register. The Arduino serially loads the 8 bits (really just 6 bits for the six signals, and two place-holding dummy bits) into the shift register with just three output pins: a data out, latch, and clock. Every time the state of the motors needs to be updated, the Arduino loads a new 8-bit word into the shift register. (Of course, this is a bad example because two of the six motor control signals are PWM, but you get the idea.... here's a link describing how to add more input pins:

We have a Window's Machine (yay?)

I tried my best, but I can't get Kicad to run on the mac. I'll give Eagle a shot on the mac, but at least now we've got a windows machine set up (Windows XP SP2, Intel Pentium 4, 2.6 GHz, 512MB), so we can use ExpressPCB, or the windows version of Kicad (both are installed).

Edit - History - Print - Recent Changes - Search
Page last modified on November 13, 2008, at 12:20 PM