Hi all,

i have an old APM IMU shield. I was thinking if it's possible to reuse it in some other project, especially for the nice gyro/accel and pressure sensors.

My idea was to interface the shield with a new Arduino Mega 2560 Board, so i can easily interface it with other sensors/actuators.

Do you think it's possible to do that? Any idea where i can start?

I've searched through the web and i didn't find anything like this.

Views: 550

Reply to This

Replies to This Discussion

Yes, just buy a Ardupilot Mega 2560 board from sparkfun and it plugs into your shield. Do you mean you want to add more sensors than the shield has?

I've got it, and it is working fine, but i would like to connect the shield to a standard mega board, like this one.

I've been able to use the pressure/temperature sensor (the BMP085), but i'm having some difficult to read the ADC ADS7844 (where the accelerometer and gyros are connected).

According to this page the MISO/MOSI/SCK/SS pins are, respectively: 50, 51, 52, 53. I've tryedo to connect theme to the pins in the shield: take a look at the top comments in the source code. But i'm not able to read anything. Of course, the developers said they are using Serial port 2 to communicate with the board, so i've tryed to connect the MISO/MOSI pins to RX2/TX2. But it seems to me they are reading noise...

Basically i need help to find the correct pins in the standard arduino board to connect the shield.

It sounds like you are close to getting it to work. You are right about RXD2/TXD2 being MISO/MOSI. And the clock should connect to XCK2 (PH0,PH1,PH2). You can download the datasheets for the ADS7844 adc ic and the schematics for the oilpan and mega 2560 boards. Make sure you write a low command to what is digital pin 33 (portc, 4) on the ardupilot 2560 board for chip select of the ADS7844 before reading it. Here is some code I use:


uint8_t ch=0;
int16_t v;
while(ch  < 8) {
v = ADC_SPI_transfer(0) 8;            
v |= ADC_SPI_transfer(adc_cmd[ch + 1]);
if (ch == 0) z_gyro = v;
if (ch == 1) x_gyro = v;
if (ch == 2) y_gyro = v;
if (ch == 3) temp = v;
if (ch == 4) y_accel = v;
if (ch == 5) x_accel = v;
if (ch == 6) z_accel = v;
if (ch == 7) sonar = v;

void adc_init()
UBRR2 = 0;
DDRH |= (1 PH2);
UCSR2C = (1 UMSEL21) | (1 UMSEL20);
UCSR2B = (1 RXEN2) | (1 TXEN2);
UBRR2 = 2;}

static inline unsigned char ADC_SPI_transfer(unsigned char data)
{UDR2 = data;
while (!(UCSR2A & (1 RXC2)));
return UDR2;}

Reply to Discussion


© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service