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

GPIO to 1.7V after enabling TWI

Hi :) ,

I'm using TWI to connect a sensor that i supply with an LDO regulator. 

This LDO has an enable pin controlled by P0_23. Driving current is max 1uA so i configured my GPIO in S0S1 mode.

When i start my application i can control properly the LDO with this EN pin.

P0_23 = 0 -> LDO output =0V

P0_23 = 1 -> LDO output =2.6V (fixed output voltage of my reference).

But a strange behavior happen when i init TWI module with: twi_init() .

Once the line err_code = nrf_drv_twi_init(&m_twi, &twi_sensors_config, twi_handler, NULL); i executed, my LDO regulator voltage output goes to 1.7V.

Note that mu uC supply is 3.3V.

So i test to use twi_uninit() when i measure 1.7V, and magic, the LDO output goes low as if my TWI was controlling P0_23...

SCL and SDAZ are connected to the two NFC gpio that i disabled in the pre processor definition of the project. P0_10 and P_26.

The PIN_CNF of P0_23 doesn't change when i twi_init.

Is ther eany link that i missed somewhere between P0_23 and TWI module please ?

Thanks a lot

Parents
  • I'm also using externals pull up cause the 13kohm internal resistors are a bit weak. I disabled the internal resistor. I wonder if it is not the fact that when i init twi module the two lines are set to vbat and if the supply is not on, some electronic of the LDO pull the line to 1.7V. Solution will be may be to pull up to vcc of the nrf and not to the vdd of the ldo.

  • "my LDO regulator voltage output goes to 1.7V". Does this happen only when P0.23 = 0, ie the LDO is off? If so it is possible any output pins connected from the nRF52 to the sensor will power up the sensor through the sensor's internal schottky protection diodes and back-drive the LDO thus raising the LDO voltage from 0 to (say) 1.7 volts. If the only 2 pins connected to the sensor are SCL and SDAZ check the configuration after the init; if that is set to S0D1 or H0D1 with both pull-ups disabled then that would be unexpected behavior. Either pull-up enabled (or an external pull-up to nRF52 VDD) will phantom power the sensor and hence there will be a voltage on the LDO even when off.

  • Hi :)

    I removed my external pull up resitor and now i can see twi lines going to vcc of the nrf52. But i'm surprised of several things:

    My sensors i working well, i'm just not satisfied with the freqency and signal shape, and the pull up configuration

    1) here the content of the files nrf_drv_twi.c where Pull up are enable, but when i disable it, i see no difference on my physical lines, as if this config stuff were not used.

    2) i asked for 400khz but i only get 200khz on my scope, but it is ok in register.

    3) the shape of the rising edge is really slow.  on top it is with internal pull up resistor, i guess. Because as said earlier, when i disable it i get the same signal !

    Here is the signal with my external 4k7pull up resistors, and pull up resistors diable in the software...

Reply
  • Hi :)

    I removed my external pull up resitor and now i can see twi lines going to vcc of the nrf52. But i'm surprised of several things:

    My sensors i working well, i'm just not satisfied with the freqency and signal shape, and the pull up configuration

    1) here the content of the files nrf_drv_twi.c where Pull up are enable, but when i disable it, i see no difference on my physical lines, as if this config stuff were not used.

    2) i asked for 400khz but i only get 200khz on my scope, but it is ok in register.

    3) the shape of the rising edge is really slow.  on top it is with internal pull up resistor, i guess. Because as said earlier, when i disable it i get the same signal !

    Here is the signal with my external 4k7pull up resistors, and pull up resistors diable in the software...

Children
No Data
Related