EasyPIC V7 board/ICD3/MCC
Using PIC18F45K22/8MHz
XC8/C90
Bosch BNO055 Sensor.
Hi Chaps & Chapesses,
Trying to Access the above named sensor, just a simple proof of communication by reading gyro X to terminal.
Here's a couple of links to the data sheets...
Files bno055.c, bno055.h & support files
https://github.com/BoschSensortec/BNO055_driver
Quick Start Guide
https://ae-bst.resource.bosch.com/media/_tech/media/application_notes/BST-BNO055-AN007.pdf
BNO055 Data Sheet
https://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BNO055-DS000.pdf
PIC18F45K22 Data Sheet
http://ww1.microchip.com/downloads/en/DeviceDoc/40001412G.pdf
I'm using the MCC to configure the I2C, and the USART. I've used the MCC quite a bit now, I know how to use the button just not how to use all the information it generates.
So following the guides as best I can I've come up with this....
- Code: Select all
/*
main.c
*/
#include "mcc_generated_files/mcc.h"
#include "bno055.h"
int8_t RAW_Tempdata;
void main(void)
{
// Initialize the device
SYSTEM_Initialize();
EUSART1_Initialize();
// Enable the Global Interrupts
INTERRUPT_GlobalInterruptEnable();
// Enable the Peripheral Interrupts
INTERRUPT_PeripheralInterruptEnable();
printf("EasyPIC-V7, 8MHz, ICD3, BNO055 (9DOF)Sensor \n\r");
printf("EUSART1 to Terminal readout Test, 05-Oct-19 \n\r");
printf("BNO055 communication \n\n\r");
__delay_ms(700); // Wait for BNO055 POST to complete
BNO055_OPERATION_MODE_NDOF(); // Change from config mode to use sensors
BNO055_CONFIG_MODE_SWITCHING_DELAY(20); // config mode delay
while (1)
{
RAW_Tempdata = BNO055_GYRO_DATA_X_LSB_VALUEX_POS();
printf("Gyro X : %4d ",RAW_Tempdata);
}
}
/**
End of File
*/
I've added the files the MCC generates, as I couldn't load the project (it exceeds the 256Kib forum limit)
If I can get one little bit of data out, I'll get the rest, even if it kills me
Any suggestions would be appreciated.
Regards
Les