Thank you for your help and sorry for the late reply! We are using I2C. Our problem has been making the read and write fuctions since they seem to have have very specific protocols that I don't believe we are noticing. Here are the read/write functions from the support file that I am trying get functioning: s8 BNO055_I2C_bus_write(u8 dev_addr, u8 reg_addr, u8 *reg_data, u8 cnt) { cnt = 1; s32 BNO055_iERROR = 0; // this is the "status" we usually use in our R/W functions u8 array[I2C_BUFFER_LEN]; u8 stringpos =0; array[0] = reg_addr; for (stringpos = 0; stringpos<cnt; stringpos++) { array[stringpos+BNO055_I2C_BUS_WRITE_ARRAY_INDEX] = *(reg_data+stringpos); } BNO055_iERROR = I2C_MasterSendStart(dev_addr, I2C_WRITE_XFER_MODE); BNO055_iERROR = I2C_MasterWriteByte(array[1]); BNO055_iERROR = I2C_MasterWriteByte(*reg_data); BNO055_iERROR = I2C_MasterSendStop(); return (s8)BNO055_iERROR; } s8 BNO055_I2C_bus_read(u8 dev_addr, u8 reg_addr, u8 *reg_data, u8 cnt) { dev_addr = dev_addr; s32 BNO055_iERROR = BNO055_INIT_VALUE; // the s32 error var is = 0 (bno055_init_value=0) u8 array[I2C_BUFFER_LEN]; // buffer_len = 8 u8 stringpos = 0; array[0] = reg_addr; //set 0 of array to reg_addr BNO055_iERROR = I2C_MasterSendStart(dev_addr, I2C_WRITE_XFER_MODE); BNO055_iERROR = I2C_MasterWriteByte(array[1]); BNO055_iERROR = I2C_MasterSendStop(); for (stringpos = 0; stringpos < cnt; stringpos++) // counts through the entire reg_addr { BNO055_iERROR = I2C_MasterSendStart(dev_addr, I2C_READ_XFER_MODE); array[stringpos] = I2C_MasterReadByte(I2C_ACK_DATA);// saves each byte to a different array pos *(reg_data + stringpos)=array[stringpos]; } array[stringpos+1] = I2C_MasterReadByte(I2C_NAK_DATA); *(reg_data + stringpos)= array[stringpos]; u8 comp =0; for(comp = 0;comp<cnt; comp++) { BNO055_iERROR = } BNO055_iERROR = I2C_MasterSendStop(); return (s8) BNO055_iERROR; } void BNO055_delay_msek(u32 msek) { CyDelay(msek); }
... View more