Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
AmCi_3754291
Level 2
Level 2

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);

    }

    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

0 Likes
1 Solution
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi AmCi_3754291

Please change the drive modes of the I2C pins in your project to 'Open Drain Drives Low' and also ensure that you have connected an external pull up resistor (2k - 10k) for both SDA and SCL lines. This might fix your issue.

To answer your question regarding separating KitProg and PSoC, yes, you can use a MiniProg to program your device instead of the KitProg.

Update: Drive mode of I2C pin should be 'Open Drain Drives Low'

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B

View solution in original post

0 Likes
5 Replies