TWI Scanner Example is not Working in Custom Board (NRF52840)

Hi,

1. Here I am using the nrf52840 in my customized board, in parallel I have nrf52840 dev board. In My custom Onboard debugger is not available so I am using SWD to load the program from NRF52840 DK board to Custom Board (NRF52840).

2. I am loading TWI Scanner Example program to my custom board, from that nothing is displayed on terminal, But If I am flashing same TWI scanner example to Dev boards its working and its displaying like TWI Scanner Started But in my custom board nothing is displayed. 

3. I have mention I2C pin as P0.06 & P0.07, and also I have mention UART in my custom board as P1.11(TX), P1.12(RX), P1.10(CTS), P0.30(RTS).

My doubt why log is not displaying anything in my custom board. and one more doubt also whether I have to mention custom board UART pins in TWI Scanner Example??

I have raised this questions in my previous thread, there is no reply that's why I posed this thread. Please anyone help me on this. I am waiting for your quick response...

Thanks in advance.

  • I am not familiar with this external sensor Jansi. I can't help you with that as it is not possible for us to debug external sensor related issues. 

  • Hi,

    I have one doubt.

    1. In my custom board schematic having temperature sensor that part no is TMP100 using I2C.. But I am using External Temperature sensor that is SHT25, this SHT25 is not present in my board. so my question is it possible to implement external temperature to my board???

    Thanks in advance.

  • Hello,

    I have implemented the SHT25 temperature sensor with ardiuno, now i want to implement this code and register configuration in nrf52840. can you please tell me how to implement this register in NRF.

    Thanks in advance.

    I will share the ardiuno code in below, Please help me on this, In which statement or function I have to read & write this register.

    #include<Wire.h>
    // SHT25 I2C address is 0x40(64)
    #define Addr 0x40
    void setup()
    {
    // Initialise I2C communication as MASTER
    Wire.begin();
    // Initialise serial communication, set baud rate = 9600
    Serial.begin(9600);
    delay(300);
    }
    void loop()
    {
    unsigned int data[2];
    // Start I2C transmission
    Wire.beginTransmission(Addr);
    // Send humidity measurement command, NO HOLD master
    Wire.write(0xF5);
    // Stop I2C transmission
    Wire.endTransmission();
    delay(500);
    // Request 2 bytes of data
    Wire.requestFrom(Addr, 2);
    // Read 2 bytes of data
    // humidity msb, humidity lsb
    if(Wire.available() == 2)
    {
    data[0] = Wire.read();
    data[1] = Wire.read();
    // Convert the data
    float humidity = (((data[0] * 256.0 + data[1]) * 125.0) / 65536.0) - 6;
    // Output data to Serial Monitor
    Serial.print("Relative Humidity :");
    Serial.print(humidity);
    Serial.println(" %RH");
    }
    // Start I2C transmission
    Wire.beginTransmission(Addr);
    // Send temperature measurement command, NO HOLD master
    Wire.write(0xF3);
    // Stop I2C transmission
    Wire.endTransmission();
    delay(500);
    // Request 2 bytes of data
    Wire.requestFrom(Addr, 2);
    // Read 2 bytes of data
    // temp msb, temp lsb
    if(Wire.available() == 2)
    {
    data[0] = Wire.read();
    data[1] = Wire.read();
    // Convert the data
    float cTemp = (((data[0] * 256.0 + data[1]) * 175.72) / 65536.0) - 46.85;
    float fTemp = (cTemp * 1.8) + 32;
    // Output data to Serial Monitor
    Serial.print("Temperature in Celsius :");
    Serial.print(cTemp);
    Serial.println(" C");
    Serial.print("Temperature in Fahrenheit :");
    Serial.print(fTemp);
    Serial.println(" F");
    }
    delay(300);
    }
Related