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

How to resolve NRF_ERROR_INTERNAL error in TWI communication?

Hi,

I'm using PCA10040 board, There i connected the fuel gauge IC via TWI communication. There pca10040 will acts as master and fuel gauge IC will acts as slave.

While Read and write we are getting "NRF_ERROR_INTERNAL" error and hangs there itself. If i give some delay (like 100ms) for each read and write its working fine.

That same fuel gauge setup i connected to some other controller (Master), There also i'm accessing via TWI communication. There without delay i can able to read and write the values.

After that i probed both the setups (PFA),

setup 1 : PCA10040 (Master) - Fuel Gauge IC (slave)

NORDIC.tar.bz2

setup 2 : Other Controller (Master) - Fuel Gauge IC (slave)

OTHER_CONTROLLER.tar.bz2

While comparing that, In Nordic setup, End of the each byte (after 9 clock cycles) SDA pulse goes high for some time. But in other controller not like that wherever data presents that time only it goes high.

Is that extra SDA pulse cause any issue ?

May i know why that SDA pulse goes high for some time in Nordic controller?

Thanks in advance,

  • Hi Hung Bui,

    We didn't remove internel pull up. If we use only internel pull up, the maximum SCL & SDA value is 1.7V & 1.9V respectively.Are we supposed to receive the above mentioned voltage values for the SCL and SDA pins or it should be different ? Moreover we didnt see any output with only internal pull up in DSO so we decided to add an external pull up(10K).

    For each write i'm sending 5 bytes, i didn't use SUSPEND task. Even i'm not sure why there is gap between each bytes transfer. when transaction is finished, SCL & SDA pins are not going high (In twi_master_with_twis_slave example after transaction SCL & SDA pins goes high).

    Note : SCL connected to P0.03 SDA connected to P0.04

    Thanks Regards, -Naveen

  • It's strange, Naveen. What is the supply voltage ?

    The SCL, SDA when not in transaction should retain the voltage level of at least 0.7VDD. A photo of your setup could help a little bit.

    I suspect there could be something wrong with the sensor. If you don't connect the pin to the sensor, could you try to monitor the pin ? (of course it can only transmit the address because of no ACK, but we can still can see if it can transmit properly).

    In your "OTHER_MASTER" trace, I can also see that the pins are pulled low, this is not normal. When the pins are connected to pullup resistors, they should be high between transaction.

  • Hi Hung Bui,

    Thanks for your valuable responses,

    Now read and write is working fine without any error.

    In previous setup slave is connected to one more master, now we connected that slave to nordic master alone.

    Thanks regards, -Naveen

  • Hi Naveen,

    Glad that you found the issue. Yeah, I2C on the nRF51 doesn't really support multiple master mode which require arbitration logic and busy detection.

Related