This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DK-TM4C123G Trying to Understand how MPU9150 data is collected in QS-logger example

I'm building up a project that's based on the QS-logger example.  I want to reuse the routines that gather the data from the MPU9150 using I2C and the interrupt on Port B.

In acquire.c, it looks like the data is read from the MPU9150 inside the IntGPIO routine with the code below

//*****************************************************************************
//
// Called by the NVIC as a result of GPIO port B interrupt event. For this
// application GPIO port B pin 2 is the interrupt line for the MPU9150
//
//*****************************************************************************
void
IntGPIOb(void)
{
    unsigned long ulStatus;

    ulStatus = GPIOIntStatus(GPIO_PORTB_BASE, true);

    //
    // Clear all the pin interrupts that are set
    //
    GPIOIntClear(GPIO_PORTB_BASE, ulStatus);

    if(ulStatus & GPIO_PIN_2)
    {
        //
        // MPU9150 Data is ready for retrieval and processing.
        //
        MPU9150DataRead(&g_sMPU9150Inst, MPU9150AppCallback, &g_sMPU9150Inst);
    }
}

I have most of the MPU9150-related files in a project that compiles without errors so I think it's getting the MPU9150 data but I don't understand is how to format an expression that gets at the results from my main program.

Any help greatly appreciated.

  • Hi Ted,

    Take a look at mpu9150.c located inside the sensorlib folder of Tivaware, particularly MPU9150DataRead().

    This function is described as follows:

    "//! This function initiates a read of the MPU9150 data registers.  When the
    //! read has completed (as indicated by calling the callback function), the new
    //! readings can be obtained via:
    //!
    //! - MPU9150DataAccelGetRaw()
    //! - MPU9150DataAccelGetFloat()
    //! - MPU9150DataGyroGetRaw()
    //! - MPU9150DataGyroGetFloat()
    //! - MPU9150DataMagnetoGetRaw()
    //! - MPU9150DataMagnetoGetFloat()

    The above functions are described in mpu9150.c as well.

    Tim

  • Hi! TED,

    The same thing I want to be run, but understanding the library and the given QS sample code is difficult to me.

    If you arranged it, could you send back to me on email pramod.patil@fwpl.in

    Thanks in advance.

  • Hi TED!

    Now, Its working fine, found the problem in description given by TI.

    Pls find the below steps for Windows based Data Logger ( Make sure drivers are installed properly for OTG-USB application)

    1. Start " Data Logger.exe

    2. Select option "Host to PC" in QS-Logger application of DK-TM4C123G Dev. board through Configure->Storage->Host to PC

    3. Select application option through Configure->channel-> and then choose the application to be displayed on PC

    4. Finally, select the "START" option on display and then observe the changes on PC screen

    5. Load ".CSV" file from parent directory into the Datalogger application and then select the "Startlogging: option.

    6. Do changes in ADC, Temp or Gyro-Comapass and monitored the changes on PC screen.