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

Problems with TWI when using Bluetooth LE simultaneously (taking wrong data from TWI when enable BLE)

Hi. I'm developing IMU system for multiple purpose using ICM20948 & nRF52832.

But there are problems on TWI communications when using BLE simultaneously.

If not use BLE, all the data comes from IMU sensor is pretty well as shown below:

Small deviation is deliberate data for test purpose.

But after enable BLE, wrong data comes out from ICM20948 sensor as below. It is connected with TWI lines.

 Only X-Axis are normal data. I attached source codes which get or send data to ICM20948 sensor.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
* Roverdyn I2C(TWI) Library
* Created at Jan. 14, 2020
* Author : Seonguk Jeong
* Copyright to 2019 Seonguk Jeong. All rights reserved.
* Contact : jswcomkr@roverdyn.com
*/
#include "Wire.h"
void _Wire::begin(){
// I2C
// 400kHz
// : SCL(12), SDA(11)
// Wire.h
// I2C
NRF_TWI0->ENABLE = 0;
// SCL/SDA
NRF_TWI0->PSELSCL = pinSCL;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
* Roverdyn UART Library
* Created at Mar. 6, 2020
* Author : Seonguk Jeong
* Copyright to 2020 Seonguk Jeong. All rights reserved.
* Contact : jswcomkr@roverdyn.com
*/
#include "ICM20948.h"
#include <SEGGER_RTT.h>
_Wire Wire;
extern _Serial Serial;
uint8_t _ICM20948::Init(){
uint8_t err_code = 0;
// TWI
Wire.begin();
// ICM20948
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Please check it.

Thank you.