I have it working in the I2C mode, but I was hoping to use the easier and faster SPI interface.
Why, if your carrier board does not work in SPI, do you describe SPI usage in your writeup (shown below)?
SPI Communication
To communicate with the L3G4200D in SPI mode, the CS pin (which the board pulls to VDD through a 10 kΩ resistor) must be driven low before the start of an SPI command and allowed to return high after the end of the command. Level shifters on the SPI clock (SPC) and data in (SDI) lines enable SPI communication with microcontrollers operating at the same voltage as VIN (2.5-5.5 V).
In the default 4-wire mode, the gyro transmits data to the SPI master on a dedicated data out (SDO) line. If the SPI interface is configured to use 3-wire mode instead, the SDI line doubles as SDO and is driven by the L3G4200D when it transmits data to the master. A detailed explanation of the SPI interface on the L3G4200D can be found in its datasheet (1MB pdf).
Oops, you are right. The L3G4200D can use SPI. I don’t have any experience with the xmegas, but we do have an OrangutanSPIMaster library that works for several ATmega processors and might help you. You can see the source code if you download the Pololu USB AVR Library.
Do you have an oscilloscope available so you can make sure the AVR is outputting the right signals on MOSI and SCK?
I used my oscilloscope to verify the signals. I used SPI with the xmega and with other AVRs before this; the software is much simpler.
Is it posiible that the 10k pullup resistors are creating a problem? I bought three of them, and if you want me to, I can try to disconnect the pullups according to your instructions.
From the code that I included in the first posting you can see that CS is programmed properly, and O’Scope pictures confirmed all the signals except that SDO did nor budge.
If the problem is mine I will find it!!
I spent quite a bit of time trouble shooting, and this is NOT the first time I used SPI. So, i thought that code and schematics from a successful project with this board would point me in the right direction.
Do you have the code (and maybe schematics) that you used to test the SPI mode of this carrier board?
Here is some of the code we use to test the SPI interface on the L3G4200D carriers. It runs on a Baby Orangutan B-328 and uses SPI functions from the Pololu AVR Library, so I am not sure how useful it will be to you (though you can look at the source for the library to see some lower-level code).