Page 1 of 1

SparkFun_RFD77402_Arduino_Library to much timeout

Posted: Thu Oct 22, 2020 6:11 am
by MeanPhoenix
i have problem with this library and cjmcu-402
i have to much time out and errors when i want to get distance.
my core ver is : 1.9.0
and stm32f103c8t6 bluepill(64K) is my board
i havnt any problem at mega2560
SparkFun_RFD77402_Distance_Sensor___VCSEL_Time_of_Flight-1.0.0.zip

i have pull up resistor
i test it with mega2560 the reading sensor between 50 to 53 has delta time.
but with stm32f103c8t6 i have only two delta time With two values of 50 and 60 ms.
i think mega2560 is More reliable than stm32f103c8t6.
delay used in lib and i think the problem about it or millis function has problem.

Re: SparkFun_RFD77402_Arduino_Library to much timeout

Posted: Thu Oct 22, 2020 12:42 pm
by fpiSTM
There is some fixes available for I2C in the master for STM32F1 series, it should be fine to test it.
Did you try several speed?
By default the lib seems to be at : I2C_SPEED_STANDARD (100k)
Did you try I2C_SPEED_FAST (400k)?

Re: SparkFun_RFD77402_Arduino_Library to much timeout

Posted: Fri Oct 23, 2020 3:29 pm
by MeanPhoenix
Yes, I tried, but it got worse

Re: SparkFun_RFD77402_Arduino_Library to much timeout

Posted: Fri Oct 23, 2020 3:37 pm
by fpiSTM
You should try to change the default timeout set to 10 ms.
I will use a define for all 10 ms delay then test some values (higher and lower) to see if this change the issue.

Re: SparkFun_RFD77402_Arduino_Library to much timeout

Posted: Fri Oct 23, 2020 10:12 pm
by MeanPhoenix
fpiSTM wrote:
Fri Oct 23, 2020 3:37 pm
You should try to change the default timeout set to 10 ms.
I will use a define for all 10 ms delay then test some values (higher and lower) to see if this change the issue.
i ,tested it to
But this is what I did not test is master from github because right now iam working on another project and i afraid to change the core.