I2C latency

Jstar88
Posts: 4
Joined: Wed Oct 18, 2017 8:17 am

I2C latency

Postby Jstar88 » Fri Feb 16, 2018 6:24 pm

Hi,

i'm using I2C in master mode(ESP32) to communicate with a single slave(LCD).
The SDK is the last one at this date.

I'm having some troubles with performance since commands are delayed each other by over 100us.
You can see the follow screenshots
Image
http://www.image-share.com/ipng-3693-170.html

Code: Select all

#define LCD_SCL_PIN GPIO_NUM_5
#define LCD_SDA_PIN GPIO_NUM_18

Code: Select all

bool Display_writeComIIC(Display* obj, int para)
{
	bool status = false;
	i2c_cmd_handle_t cmd = i2c_cmd_link_create();
	i2c_master_start(cmd);

	i2c_master_write_byte(cmd, (obj->address << 1) | I2C_MASTER_WRITE, true);
	i2c_master_write_byte(cmd, 0x20, true);
	i2c_master_write_byte(cmd, para, true);
	i2c_master_stop(cmd);
	if (i2c_master_cmd_begin(I2C_NUM_0, cmd, 1000 / portTICK_RATE_MS) == NO_ERROR)
	{
		i2c_cmd_link_delete(cmd);
		status = true;
	}
	else
	{
		i2c_cmd_link_delete(cmd);
	}
	return status;
}

Jstar88
Posts: 4
Joined: Wed Oct 18, 2017 8:17 am

Re: I2C latency

Postby Jstar88 » Sat Feb 17, 2018 6:09 pm

Just solved keeping I2C open and sending a buffer of data!

Who is online

Users browsing this forum: Google [Bot] and 72 guests