Fifo set up?

By msachajski , 4 October 2013

I am setting up the fifo for all 10 datum. The system is a custom build with the MPU9150 being controlled via I2C from an PIC24FJ64GB004 from Microchip.
The data is placed onto a MicroSD card and read over the usb like a thumbdrive.
There is clearly all ten data types within the file, as the mostly act appropriately, x acceleration +-1g when oriented that way, as well as the other axes. Compass data seems viable as a magnet was placed along each axis.
PROBLEM: Most noise floors look digital, bang bang and a certain datum can be loosely visualized on all other data except maybe the temperature. A byte or two or three are slipping from the fifo, or somewhere in the chain? I have run some test like sequential numbers from the printing of the data on the SD and seems fine. I think the MPU9150 fifo is the culprit and maybe it is how I have initialized it, can anyone comment on the code below:

Thank you for your consideration of my problem!

Cy Drollinger

void powerUpMPU9150(void)
{
i2cComSend[0] = reset; //0x80
i2cWrite(MPU9150_w,oneWrite,POWER_MGMT_1); //0x6B
DelayMs(30);
i2cComSend[0] = clkGyroX; //0x01
i2cWrite(MPU9150_w,oneWrite,POWER_MGMT_1); //0x06b
DelayMs(30);

i2cComSend[0] = oneHundredHz; //0x4F
i2cWrite(MPU9150_w,oneWrite,SMPLRT_DIV); //0x19

i2cComSend[0] = no_accel_st; //0x17
i2cWrite(MPU9150_w,oneWrite,ACCEL_CONFIG); //0x1C

i2cComSend[0] = no_gyro_st; //0x00
i2cWrite(MPU9150_w,oneWrite,GYRO_CONFIG); //0x1B

i2cComSend[0] = allSensors; //0xF9
i2cWrite(MPU9150_w,oneWrite,FIFO_EN); //0x23

// Initialize AK8975A

i2cComSend[0] = call_AK8975A_W; //(0x0C)
i2cWrite(MPU9150_w,oneWrite,i2cSLV1_ADDR); //(0x28)

i2cComSend[0] = MAG_CNTL; //(0x0A)
i2cWrite(MPU9150_w,oneWrite,i2cSLV1_REG); //(0x29)

i2cComSend[0] = singleRead; //(0x01)
i2cWrite(MPU9150_w,oneWrite,i2c_SLV1_DO); //(0x64)

i2cComSend[0] = enableOneWrite; //(0x81)
i2cWrite(MPU9150_w,oneWrite,i2cSLV1_CTRL); //(0x2A)

i2cComSend[0] = call_AK8975A_R; //(0x8C)
i2cWrite(MPU9150_w,oneWrite,i2cSLV0_ADDR); //(0x25)


i2cComSend[0] = magData //(0x03) i2cWrite(MPU9150_w,oneWrite,i2cSLV0_REG); //(0x26)

i2cComSend[0] = sw6Reads; //(0xC6)
i2cWrite(MPU9150_w,oneWrite,i2cSLV0_CTRL); //(0x27)

//Apply interrupts
i2cComSend[0] = delay_es_shadow; //0x80
i2cWrite(MPU9150_w,oneWrite,I2C_MST_DELAY_CTRL);//0x67

i2cComSend[0] = data_rdy; //0x01
i2cWrite(MPU9150_w,oneWrite,INT_ENABLE); //0x38

i2cComSend[0] = all_rst; //0x05
i2cWrite(MPU9150_w,oneWrite,USER_CTRL); //0x6A

i2cComSend[0] = fifo_i2c_enb; //0x60
i2cWrite(MPU9150_w,oneWrite,USER_CTRL); //0x6A
}

phpbb Topic ID
15669