8 years, 10 months ago.

I2C and BLE nano

/media/uploads/nono313/i2c_ble_nano.png Hi,

I have connected a BLE nano to a LPC2368 via I2C (pulled up with 10k resistors).

The BLE nano is the master. It sends the address of the slave (0x44), the slave reply with an ACK. The master then send the data byte, the slave reply with an ACK, but then the SCL and SDA line stays low and are never freed.

It looks like the problem doesn't come from the slave, as I have successfully managed to communicate between that slave and another LPC2368 as master.

"Code running on the BLE nano (master)

I2C i2c_port(P0_10,P0_8);
...
while(1) {
  char switch_word='B';
  i2c_port.write(0x44, &switch_word, 1);
}

"Code running on the slave

while(1) {
  int i = slave.receive();
  if(i == I2CSlave::WriteAddressed) {
        word_back  = slave.read();
  }
}

I am almost sure that the problem is linked to the mbed library, as my BLE nano was communicating perfectly fine with another board by programming it with Arduino (the board works with both Arduino and mbed).

Does anyone have any idea ?

Regards

Be the first to answer this question.