This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Problem with MPU6050 and nRF51822 to send Data over BLE..

I am trying to send the MPU6050 data using BLE nRF51822. I have used ble_app_uart example modified it to read the data over I2C and send the data over BLE. I can successfuly read device ID but when i read accelerometer or gyroscope data I am unable to read any register. Please help me 

Parents
  • So your question is actually just about how to read the sensor - not (yet) about how to send data over BLE.

    It is important to take these things one step at a time!

    I can successfuly read device ID

    So you must have your basic I2C comms working, then.

    but when i read accelerometer or gyroscope data I am unable to read any register

    So there must be something wrong with your higher-level code.

    You need to check your code carefully against the MPU6050's datasheet - and confirm that you are doing exactly what it says. 

    You should also look at the I2C line with an analyser or oscilloscope to see what is acually happening - and, again, confirm that it meets the datasheet requirements.

    This is all standard interface debugging stuff - nothing specifically to do with Nordic.

    www.avrfreaks.net/.../2418156

  • BLE is working fine actually i am reading the device ID and send it  over BLE which works. 

    Here is the snippet. 

    	nrf_delay_ms(50);
    	mpu6050_register_read(0x75U, &id, 1); // Read the device ID 
        err_code=ble_nus_string_send(&m_nus, gyrValue.temp2, 6); // Send over BLE
    				
        APP_ERROR_CHECK(err_code);				
        nrf_delay_ms(2);			
    	id=0;

Reply Children
No Data
Related