-->
Page 2 of 2

Re: Could I reach 800 samples/sec using i2c?

PostPosted: Sun Apr 12, 2020 1:29 pm
by eriksl
I'd recommend using the NON-OS SDK instead. That might give you a change to leverage some overhead. But don't use the espconn functions but call LWIP directly. If you do, you may be able to get it quite efficient.

Re: Could I reach 800 samples/sec using i2c?

PostPosted: Mon Apr 13, 2020 4:18 pm
by Pail Roy
Thanks or your answer.
Are the I2C functions in NON-OS like the SDK ones?.
I mean, I use this to read I2C in SDK:

cmd = i2c_cmd_link_create();
i2c_master_start(cmd);
i2c_master_write_byte(cmd, ADC_SENSOR_ADDR << 1 | READ_BIT, ACK_CHECK_EN);
i2c_master_read(cmd, data, data_len, LAST_NACK_VAL);
i2c_master_stop(cmd);
ret = i2c_master_cmd_begin(i2c_num, cmd, 1000 / portTICK_RATE_MS);
i2c_cmd_link_delete(cmd);

but if i remember correctly I couldn't find similar ones in NON-OS.
By collecting 8 samples form ADC and sending them in a single UDP message I'm able to reach the SPS i need,but the system constantly crashes in less than a minute,and reboots.

Re: Could I reach 800 samples/sec using i2c?

PostPosted: Mon Apr 13, 2020 4:41 pm
by RichardS
The crash is probably caused by something taking to long to finish... sprinkle in some yields() and see if that helps, when I was using ESP8266 this helped a lot... now I am all ESP32...

RichardS