This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

I2C slave device address diff bw data sheet and nRF52

I am using Martin's code to test my I2C connection.

I use PC10040 evaluation board, SCL and SDA are 3 and 4.

My sensor is a Max 30102 pulse and HR sensor. I used Martin's code to detect my device at address 0x57; however, address in its datasheet is 0xAE/write 0xAF/read.

What I am missing?

Parents
  • Martin, thx for ur help.

    I modified your code and used 0x57 as device address; however, I cannot get expected values.

    uint8_t dummy_data = 0x55;
    // Iterate through all possible 7-bit TWI addresses
    for(;;)
    {
        device_address = 0x57;
    		
    uint8_t part_id[2], reg_addr = 0xFF;
    nrf_drv_twi_tx(&twi_instance, device_address, &reg_addr, 1, true);
    
    nrf_drv_twi_rx(&twi_instance, device_address, part_id, 1);
    printf("\t\t ** %2X %2X\r\n", part_id[0], part_id[1]);
        nrf_delay_ms(2000);
    }
    

    According to data sheet, register address 0xFF holds the device part ID, 0x15. What I get is 1.

    The more puzzling thing for me is the captured the SCL and SDA signals are strangely wrong: I2C signal_1.JPG I2C signal_2.JPG

    In the above pictures, D0 is SCK and D1 SDA. The first picture shows every 2s there are activities on the two lines, which is correct.

    In the second picture, as the code does 1 I2C read, there should be at least 16 clock cycles: 8 for put register address, 8 for 1 byte data reply. But I cannot see that happening.

    I used PicoScope to capture the line activity. MCU is PC10040 evaluation board with SDK11.

Reply Children
No Data
Related