Robotstix setup
Contents |
Power On
By default the gumstix's uboot holds the robostix in reset. Follow this instructions on this page to fix this. The prefered option is to use the S10robostix script.
Setup Programming
- Follow these instructions. You will need to create the jumpers, download the precompiled files, load the robostix_drv, and use the uisp program to set the fuses. The fuses only need to be set once. Load the Flash-LED.hex file to Robotstix, and you should see the leds on the Robostix flash. The LEDs are located next to the power input.
- Now we need a toolchain to compile new programs. Get avr-gcc using these instructions.
Setup I2C
By this point you should have gumstix that is able to download programs to the Robostix via the uisp command. Now we are going to setup the i2c communications between the gumstix and the robostix. The i2c bus will allow us to download programs to the robostix without using uisp, and control the robostix.
The first step is to setup the i2c-bootloader. This consists of two parts: setting up i2c on the gumstix and putting an i2c-bootloader on the robostix. Let's first setup the i2c bus on the gumstix by following these instructions.
Next downlaod the i2c-bootloader to the robostix using these instructions. Note: the uisp command to set the fuse bits is required (it's different from the previous instance we set the fuse bits). At this point the red led on the robostix should be flashing.
Now we need the i2c-load program for the gumstix. If you have been following all the instructions, then there should exist a robostix/gumstix/i2c-load directory within your gumstix-buildroot. Enter that directory, make the i2c-load program, and download it to the gumstix.
At this point the robotstix's red led is flashing, and the i2c-load program is on the gumstix. Put the Flash-LED.hex file on the gumstix if it's not already there. We will now program the robostix using i2c-load:
# Reset the i2c-bootloader and print out some info. This step is only necessary after a program has been downloaded to the robotix. $./i2c-load --reset 0x0b info # Write the Flash-LED.hex to the robostix $./i2c-load 0x0b Write Flash-LED.hex
The red led will flash for a couple seconds, and then the Flash-LED.hex program will run.
Read Data from the Robostix via i2c
Now we will put the i2c-io.hex program onto the robostix. This will enable reading and writing to the robostix IO via the i2c bus. First compile the i2c-io.hex program which resides in gumstix-buildroot/robostix/i2c-io, and program it onto the robotstix. The red led should now flash twice quickly followed by a brief pause, and then repeat.
Now compile the gumstix's i2c-io program, which resides in gumstix-buildroot/robostix/gumstix/i2c-io, and download it to the gumstix. You can now query and set the pins on the robostix.
# Set the pin value of Port C Pin 0 to 1 $./i2c-io 0x0b Set C.0 1 # Get the pin value of Port C Pin 0 $./i2c-io 0x0b Get C.0 # Print a help message $./i2c-io
![[LOGO]](/workbook/skins/workbook/create_small2.png)



