If you just want to use 1-wire based device and just don’t want to know any technical detail, jump to the last part.
1 Reason to use DS18B20
I’m trying to add some temperature sensor to my STM32-based computer water-cooling controller.
You know, a common solution to this is to use some thermistor and try to use some ADC(Analog-Digital-Converter) to capture the voltage on that. The temperature captured by thermistor won’t be too accurate, just around 1 degree or so. If you need a temperature with accuracy of 0.0625 degree, the DS18B20 would be a good choice.
But DS18B20 has an really time sensitive 1-wire protocol. A normal solution to this problem is to use GPIO and
NOP() instruction to simulate this, but I tend to use something different.