From: Dave H. <dhy...@gm...> - 2006-02-22 19:01:29
|
Hi Peter, > I pulled an old post from the list, wherin brian davidson posted some > short code for controlling servos with the robostix (see below). > I've been toying with Dave's i2c-io program to control pins on the > atmega128 from the gumstix.. could I write values to appropriate pins > using the i2c-io program, to accomplish what brian shows? I only see > examples of setting on/off values using i2c-io, so I'm not sure how to > write a hex or decimal value.. conceptually I suppose some loop could > write binary values by turning it on/off, but I don't know how that > works on a microcontroller. am I dreaming in technicolor? Well you're not too far off. The bootloader already supports reading and writing to any RAM, flash, or EEPROM location on the ATMega128. All of the I/O registers are memory mapped into the first 256 bytes of RAM. You can determine the exact address by looking in the datasheet. There's a section called "Register Summary". It's on page 364 of mine. The numbers in parenthesis going down the left hand side are the memory addresses. So, all that really needs to be done is to add a readreg/writereg command to i2c-io on the gumstix side of things. Nothing has to change on the robostix side. It's on my todo list already :) I'll take a stab at it tonight. -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |