11 years, 4 months ago.

Needs update for current mbed lib

Great driver thanks. It has been working well for me with seven DS18B20 devices. However, it doesn't work beyond mdeb version 43 when I tried to update to accommodate the more modern Ethernet driver and SD file system. Any chance of an update?

Cheers

Question relating to:

The code is all clear and easy to follow so I borrowed an oscilloscope to see what was going wrong. It turns out that the major mbed library rewrite at version 44 has sped up some operations. Specifically, it appears the old library took about 4us to switch between an input and output mode on a digitalinout pin. The problem was in the onewire_bit_out(0) routine after it called _datapin.input() at the end. On my system, with 7 probes and perhaps 30m of wire, it no longer had enough recovery time to float high before initiating the next write less than 1us later. I added a generous wait_us(10) to fix the problem. At some stage I will play around with the pullup resister and refine the time delays. Once I have it all sorted, I intend to re-publish the forked driver. I have also made a few other changes to allow the option of returning immediately after initiating a convert_temperature(), checking for CRC errors in temperature(), and to fix up some errors in the documentation.

posted by David Pairman 01 Aug 2013
Be the first to answer this question.