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

TWI problem, possibly voltage related

Hello,

I have been working with a nrf52DK PCA10040 V1.2.1 on SDK 14 without a softdevice and I have encountered a problem with a TWI sensor.

I have a TE MEAS MS5611 barometric sensor on a breakout board designed for 5v. This sensor works on an arduino at both 3.3V and 5v.

I am using the TWI_scanner example, and this code and circuit works for other I2C devices on 5v break out boards that I have (using 3.3v or 5v on the nrf52 dk), however I have four MS5611 sensors and none of them work with the nrf52 dk.

If I use 3.3v with a 10k pull up resistor, the device is unresponsive. If I use 5v with any pull up or 3.3v with 4.7k or smaller pull up, the device will hang in the while loop of the nrf_drv_twi.c code (line 916):

    while (!nrf_twim_event_check(p_twim, evt_to_wait))
    {
        if (nrf_twim_event_check(p_twim, NRF_TWIM_EVENT_ERROR))
        {
            NRF_LOG_DEBUG("TWIM: Event: %s.",
                          (uint32_t)EVT_TO_STR_TWIM(NRF_TWIM_EVENT_ERROR));
            nrf_twim_event_clear(p_twim, NRF_TWIM_EVENT_ERROR);
            nrf_twim_task_trigger(p_twim, NRF_TWIM_TASK_RESUME);
            nrf_twim_task_trigger(p_twim, NRF_TWIM_TASK_STOP);
            evt_to_wait = NRF_TWIM_EVENT_STOPPED;
        }
    }

I do not have an oscilloscope, so I cannot see what the signal is doing.

I plan to move away from the current breakout board to my own 3.3v circuit, but it would speed up progress if I could get this breakout board working with the nrf52 dk.

Any help would be greatly appreciated. Thank you.

Edit: I have not put a circuit diagram, but circuit is very simple. It uses pins 26 and 27 for SDA and SCL. With a 10k pullup resistor from VDD to both SDA and SCL. This exact circuit works fine with the MS5611 and an Arduino, and a Bosch BMP280 works with either Arduino or NRF5, I just cannot get the NRF5 to work with MS5611.

Parents
  • MS5611 [...] 5V

    The MS5611 chip is designed to work with 3.3 Volts. Its absolute maximum is 4.0V. If you connect those to a 5V source the expected result are broken sensors, period. Similar story with the NRF5x, by the way.

    Note that modules made for 5V sytems should have the required 5V=>3.3V circuitry, and may not work quite properly on 3.3V only systems. But since OP did not provide a schematic this is only guesswork at this time.

  • Maybe it is an issue with the voltage levels of the SDA and SCL lines. I guess there will be a voltage drop across the Logic Level Converter that might drop the voltage down below the nRF52's required Vih.

    Bypassing the LLC seemed to be the solution for this guy.

    An screenshot of the signals would definitely be useful, but maybe you can try to measure the signals with a simple multimeter when the TWI bus is idle.

Reply Children
No Data
Related