orgua / OneWireHub

OneWire slave device emulator
GNU General Public License v3.0
348 stars 89 forks source link

CRC problems with SparkFun Pro Micro #23

Closed hJcRox closed 7 years ago

hJcRox commented 7 years ago

Hi I am trying to use a SparkFun Pro Micro @16 MHz with the OneWireHub 2.0. I am using the DS18B20 example with only one sensor to test. The problem I have is CRC8 errors when reading temperature, about 5-15% failure rate. I have tried various things to try to understand the problem and its cause:

Would be fine with some hints on how to continue debugging. The possibilities with this SW seems great. But it must be more reliable.

Regards Jan

hJcRox commented 7 years ago

Hi again I found the problem. It seems to be a combination of a too short time-out ONEWIRE_TIME_MSG_HIGH_TIMEOUT = 15000_us and the Dallas Java 1-wire API sometimes running too slow. This caused CRC8 errors and "Error: first bit of byte timeout" traces in the Arduino monitor. After changing to ONEWIRE_TIME_MSG_HIGH_TIMEOUT = 150000_us everything seems to be perfect. No CRC8 errors and no error-traces in the monitor. Regards Jan

orgua commented 7 years ago

this behavior seems very odd but i have never worked with a ATmega32U4. its hard to say anything without a logic-analyzer on your side. sometimes you get these logic-8 very cheap. but besides that you have done everything you could do! Very good. Changing this one value should be fine, but i have the same ds2490 and it never needed a higher timing. it would only hurt when your µC has to do other stuff. polling is very slow this way.

orgua commented 7 years ago

ok, made a remark in readme in section "### HELP - What to do if things don't work as expected?"