I’ve been building a project using PlatformIO and the ESP32 on a custom board.
I’m interfacing an LED matrix using a matrix driver that communicates over I2C. The issue that I am facing is that for some reason there is a big delay between consecutive I2C transfers (write only) that is causing very poor refresh rate. This using the Wire library.
This is how I’m sending the data:
I am filling 2 buffers with data
Code: Select all
uint8_t i2cAddrbuffer[1054];
uint8_t i2cCMDbuffer[1054];
int tail = 0;
for(int y = 0; y<9; y++){
for(int x = 0; x<39; x++){
i2cAddrbuffer[tail] = 0xFE;
i2cCMDbuffer[tail++] = 0xC5;
i2cAddrbuffer[tail] = 0xFD;
i2cCMDbuffer[tail++] = IS31FL3741addrmap[y][x][1];
i2cAddrbuffer[tail] = IS31FL3741addrmap[y][x][0];
i2cCMDbuffer[tail++] = 0x3;
}
}
Code: Select all
for(int i = 0; i<tail; i++)
I2CWriteByte(addr, i2cAddrbuffer[i], i2cCMDbuffer[i]);
tail=0;
Is this an inherent problem with the Wire library? Should I use the original ESP I2C library?
I thought that this could be an issue that could be caused by task switching from FreeRTOS (I’m running this code on the Setup function) but lowering the freertos scheduler frequency didnt help.
Thanks in advance!