From: Steve Bullock <steve.bullock@gm...> - 2005-12-02 10:05:57
Has anyone had any success with programming and interfacing with the
robostix with SPI and/or I2C using C/C++? I'd like to free up my
serial ports, and it'd be great to be able to program the atmega
without having to use jumpers and stuff.
Dave, you mentioned you had a play with bootloaders a while back -
i've had a look at atmel's app notes and it kinda makes sense but it's
still a little beyond me at the mo.
* 07977 216406
From: Dave Hylands <dhylands@gm...> - 2005-12-02 15:04:40
> Has anyone had any success with programming and interfacing with the
> robostix with SPI and/or I2C using C/C++? I'd like to free up my
> serial ports, and it'd be great to be able to program the atmega
> without having to use jumpers and stuff.
> Dave, you mentioned you had a play with bootloaders a while back -
> i've had a look at atmel's app notes and it kinda makes sense but it's
> still a little beyond me at the mo.
Well, the robostix has 128k of flash, divided into two regions, one
that's 124K and one that's 4K. Code running out of tje 4K section is
capable of reprogramming the 124K section.
The i2c protocol can logically be divided into two pieces, the master
portion and the slave portion. On a typical i2c network, you have one
master and many slaves. There is also a protocol called SMBus, which
can be implemented on i2c, and provides some additional data
integrity, like CRC's for each packet. Linux implements the SMBus over
The bootloader is comprised of the slave portion of the i2c protocol,
with SMBus support, and enough code to be read/write flash/eeprom. One
further goal was to provide the i2c support in such a way that the
protocol stuff in the bootloader can be used by the running program
wihout having to duplicate it in it's own code (this is especially
useful for the smaller ATMega devices).
The bootloader needs to be programmed into each robostix device using
either the gumstix or some external programmer. Once the bootloader
has been programmed (into the upper 4K region) the remaining 124K can
be written by sending commands over the i2c bus.
My goal was to be able to have a bunch of robostix chained together
over the i2c bus, and have one of the robstix with a gumstix, also on
the i2c bus. With the i2c bootloader, any of the robostix on the i2c
bus can get their programs updated over the i2c connection.
Of course, I'll create a Wiki page which documents the bootloader, and
how to integrate the i2c stuff into your own program so that packets
can be sent back and forth between the gusmtix and the robostix using
Another way of thinking about the bootloader is that it's the
equivalent of a very stripped down version of uboot.
Vancouver, BC, Canada