i2c current draw with external pull-ups

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
6 posts / 0 new
Last post
vmore
Offline
Last seen:7 months 3 weeks ago
加入:2018-03-01十八22
i2c current draw with external pull-ups

Hi,

我有两个设备在我I2C bus (eeprom and another device) and I have external pull ups attached on the bus - scl, sda (4.7k). Post addition of the external pull-ups I observe a bump in current consumption - about 500uA continuous consumption(also when chip sleeps). This goes away once the external pull-ups are removed. A potential reason might be that the i2c lines are not being deactivated.

My code for initializing i2c is like this:

GPIO_ConfigurePin(GPIO_PORT_0, GPIO_PIN_6, INPUT, PID_I2C_SCL, false); GPIO_ConfigurePin(GPIO_PORT_0, GPIO_PIN_7, INPUT, PID_I2C_SDA, false); i2c_eeprom_init(); i2c_eeprom_read_data(); i2c_eeprom_release();

I tried to reconfigure the scl, sda lines back to gpio state, but that didn't help with the current consumption.

Is there a way to deactivate the internal pull-ups for i2c transfer that can help with the current consumption? Can you provide any additional inputs on debugging this?

Keywords:
i2c
Device:
PM_Dialog
Offline
Last seen:2 days 1 hour ago
Staff
加入:2018-02-08 11:03
Hi vmore,

Hi vmore,

You could configure the I2C lines in GPIO_ConfigurePin () as INPUT or INPUT_PULLUP or INPUT_PULLDOWN. Be aware that when the device goes to sleep, all the peripherals including the iC2 block are powered off. Could you please let me know which other peripherals are you using in your custom board? For example, if you are using an external SPI flash and you don’t power it down, the correct consumption in sleep mode will be increased. Be aware that in our example, we have the same I2C line configuration.

Thanks, PM_Dialog

vmore
Offline
Last seen:7 months 3 weeks ago
加入:2018-03-01十八22
There is an eeprom on i2c bus

There is an eeprom on i2c bus, no spi line. The i2c is mainly used for eeprom communication, the other i2c device being used rarely, if at all required. The pin configuration for i2c is :

GPIO_ConfigurePin(GPIO_PORT_0, GPIO_PIN_6, INPUT, PID_I2C_SCL, false); GPIO_ConfigurePin(GPIO_PORT_0, GPIO_PIN_7, INPUT, PID_I2C_SDA, false);

which is in line with what I have seen in other examples, so I don't think I am doing something extremely different. If the i2c block is being powered down in sleep mode, it is not clear to me why the pullups cause so much current drain. Removing the pull-ups reduces the current consumption drastically, so the issue likely is on the i2c lines.

PM_Dialog
Offline
Last seen:2 days 1 hour ago
Staff
加入:2018-02-08 11:03
Hi vmore,

Hi vmore,

The state of the GPIO before going to sleep is retained, not the configuration or the functionality of the GPIO, so that's why when the device wake's up, the periph_init() function is called in order to re-configure the pins in each wakeup and the pins return their default application state. For example, if before going to sleep a GPIO is high, it will stay high during sleep, and will be reconfigured in wake up by the periph_init() function. Could you please check if the I2C line are high before going to sleep?

Thanks, PM_Dialog

vmore
Offline
Last seen:7 months 3 weeks ago
加入:2018-03-01十八22
Hi, Thanks for your reply.

Hi, Thanks for your reply. The i2c lines are not being deactivated before going to sleep, ie they are always held high. However, this is not the case with the external pullups removed. If it was a firmware problem, it should have existed both before and after addition of the pull-ups? How can these be explicitly deactivated before going to sleep or while not being used?

PM_Dialog
Offline
Last seen:2 days 1 hour ago
Staff
加入:2018-02-08 11:03
Hi vmore,

Hi vmore,

Apologies for the delay. Let me ask you something. You mentioned that you have external pull-ups, don’t you? Is it possible to remove them and use the internal pull-ups? DO you have the same issue? Also, which is the state before going to sleep? Both lines are in Hight state?

Thanks, PM_Dialog