BLE nano 2 and i2c


#1

Hi,
I am trying to merge the BLE_HRM example with a twi example to be able to read data from sensors and send them over BLE, but BLE and TWI don’t seem to work together. The code gets stuck at the firs wire.begintransmission.
Has anyone had the same problem? Do you have any suggestion?

I am using the BLE Nano 2 (nrf52832) and programming it in Arduino.

It is very urgent

Thanks,
Greta


#2

Hello
I have bought a BLE Nano 2 kit with DAPLink board and I test it since some days with the Arduino IDE.
I have the same problem with I2C. I use the BLE_Examples/SimpleChat example which works very well with the “nRF Connect” application. Now I try to use I2C to drive a BME280 sensor. I have not able to have correct SDA and SCL signals on the DAPLink.

I also try the TWI/AT24C512_Demo example without success. The SCL signal is always high, SDA is always low.
I have tried also the BLE Nano 2 without DAPLink, on a breakboard supplied directly with 3.3V, I have the same problem: I2C do not runs.

My project is to make a BLE object with I2C sensors always in sleeping mode, with periodic wake up (how to make this ?), take measures and it by bluetooth and returns in sleeping mode.

Is somebody know how to use BLE Nano 2 I2C with Arduino IDE ?

Best regards.
Christian


#3

What did you physically wire the sensor SCL and SDA pins to on the BLE?


#4

I had a similar problem with I2c and Ticker.
What I wanted to do is to fetch data from humidity/temperature sensor (AM2320) though I2C periodically.To do it periodically, I wrote I2C code inside the ticker interrupt handler.

The problem was that the handler hangs when it calls

  • Wire.endTransmission()
  • Wire.requestFrom()

It seems to be related to this issue.

So I changed the I2C interrupt priority from APP_IRQ_PRIORITY_LOW to APP_IRQ_PRIORITY_HIGH (which is in TARGET_NORDIC/TARGET_NRF5/i2c_api.c), and the I2C worked correctly.

This change might cause some bugs somewhere, but so far I don’t have any problem.


#5

Hi,
You should confirm the device has pull-up register in SCL and SDA and the slave device address for I2C has left shifted one bit in the driver. And this is the example works with BLE and I2C