STM32 - 1-Wire protocol analysis & Implementing of OneWire Protocol using UART peripheral and DMA

0 TL;DR

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.

Read more...

A solution to I2C/IIC bug in STM32

What’s the problem with I2C of STM32?

The STM32 chips are all really well-designed ones, coming with a nice price - for a common, wide-used STM32F1, the price is around 1-2 bucks in small scale order. If take the fact that ST is really nice to small order and always willing to give a good price, everything about STM32 seems so perfect.

However, such bargain has its own weakness - its own I2C peripheral has some really serious hardware bug, that it is really sensitive to the time sequence, even interrupted by a small function, the peripheral would fail with a high possibility. An application engineer of STMicroelectronics has mention this concern in an offline meeting. She said the I2C peripheral is designed as this on purposely, just to avoid some strict patent of NXP. Check here

Read more...