5 Replies Latest reply on Sep 25, 2019 3:09 AM by RakshithM_16

    Having a hard time Starting I2C Communication with BNO080

    AmCi_3754291

      I'm having a hard time beginning a communication sequence between the PSOC and a BNO080 IMU.

      I've created a send_packet function based on what the BNO datasheet says is supposed to happen, however all I've been able to observe on the scope is both the SCL line and SDL line going low.

       

      This is my send packet function:

       

      //BNO080 FUNCTIONS

      void BNO080_sendPacket(uint8_t channelNumber, uint8_t dataLength) {

          UART_PutString("Beginning of send Packet sequence\n");

          uint8_t packetLength = dataLength+4; // adding the 4 header bytes

          //debugging tool

          char Buff[20];

          sprintf(Buff,"d=%d\n", packetLength);

         

          I2C_MasterSendStart(IMU_Address, I2C_WRITE_XFER_MODE);

          I2C_MasterWriteByte(packetLength);

          UART_PutString("First write command sent\n");

          I2C_MasterWriteByte(packetLength >> 8);

          UART_PutString("Second write command sent\n");

          I2C_MasterWriteByte(channelNumber);

          UART_PutString("Third write command sent\n");

          I2C_MasterWriteByte(sequenceNumber[channelNumber]++);

         

          //Sending the User's data packet

          for (uint8_t i=0; i < dataLength; i++){

              I2C_MasterWriteByte(shtpData[i]);

          }

          I2C_MasterSendStop();

          UART_PutString("Packet sent\n");

       

      I've attached my current code the relevant components are the BNO080.c and main.c!

       

      Let me know if anything is unclear.

       

      Thanks for your help

       

      Amilcar