1-Wire – Through the Looking Glass (Scope) and Down the Rabbit Hole (Bit Level)

preview_player
Показать описание
With an Arduino and some DS18B20 temperature sensors as example …
↓↓↓ Complete description, time index and links below ↓↓↓

Like many people on this planet I have a lot of time on my hands right now (that virus thing). So why not do a bit by bit analysis of what’s happening on a 1-Wire bus? Maybe I – or you – can gain some insights into the meaning of life.

And some insights I gained: How to probe a 1-Wire bus with the scope (differentiating between slave and master signals, hard pull-up and resistor pull-up), how the 1-Wire search (“Search ROM”) works (9 minutes at 29:06) and much more.

►Intro
00:00 Intro – be warned, it will get ugly (and watch the previous video first)
►Operating a parasite powered 1-Wire bus
01:30 Overview – what’s on the breadboard and a quick recap of the code
03:41 Ones and zeros – on the 1-Wire bus, it’s a question of time(ing)
06:38 Broadcasting a command – “Skip ROM” [CCh] and “Convert T” [44h]
08:12 Preparing for a command – master reset and clients present, real long lows
10:24 Voltage levels – what’s high, what’s low and difference between master and slaves
14:14 Probing trickery – a diode and some resistors make the bus easy to probe
16:42 Addressing a slave – “Match ROM” [55h] followed by a 64-bit slave ROM address
21:24 Command for that slave – “Read Scratchpad” [BEh] followed by data from the slave
23:54 Repeat for another slave – nothing new here but for a DallasTemperature lib oddity
25:34 Noise while bus is high – slaves pulling parasite power through pull-up resistor
►Initializing a 1-Wire bus
26:46 Overview – discovering slaves on the bus, their addresses, power mode and details
29:06 1-Wire search – “Search ROM” [F0h] for implementing a binary tree search
38:16 Slave power mode – first slave addressed [55h] and “Read Power Supply” [B4h]
40:45 Slave details – first slave addressed [55h] and its scratchpad read [BEh]
41:45 Repetitive stuff – more of the same over and over again
45:04 Bus activity summary – of all the bus activity including the repetitive stuff
45:53 Code review – redundancies, oddities and maybe a bug
►Differences to a direct powered 1-Wire bus
47:54 Overview – changes on the breadboard and in the probing
49:18 Difference – “Read Power Supply” [B4h], and it differs from the datasheet too
►Timing considerations
51:23 Recovery time – depends on a lot of things, including temperature
►Summary
54:37 Three main point – parasite vs direct power, 1-Wire is easy and trust no one

#robertssmorgasbord #tutorials #tutorial #how-to #Arduino #temperature #temperaturesensor #bus #dallas
Рекомендации по теме
Комментарии
Автор

Thank you! ... The specific information I needed to implement inside of a PIC micro controller in assembly language was from 29:08 to 38:28 and your explanation helped me out greatly.

ICPolyman
Автор

I have implemented DS18B20 long long time ago but still I enjoyed your video my friend !!! Very well explained all timings and loved every detail there !

Jindraxx
Автор

Hi Robert. The diode. Very ingenious way to differentiate between devices. Excellent reference material. Thank you very much for sharing your knowledge with us. Regards, RJM

rene-jeanmercier
Автор

Robert I learnt a lot from this 1-wire series. Great video.

WunHeart
Автор

Very informative. I absolutely loved the video. Thanks a lot!

altairibn-laahad
Автор

I'm glad I was strapped in ! but plenty of "takeaways" of me ...cheers.

andymouse
Автор

Nice demonstration of 1-wire.

Just one remark at „error in the datasheet“: *No!*

A bit transfer from device to host is always started by a short 0 from the host and a 0 or 1 response from the device. The short 0 is kind of the clock pulse merged on the single data line.
Datasheet describes exactly what the protocol defines and the silicon got implemented.
Getting the power status of a device is by reading a single bit and as 0 means „I need parasitic“, all devices responses are or‘ed together to a „all devices have enough power?“ answer, as power on the data line dos not hurt.

fromgermany
Автор

Thank you! Thank you, thank you. thank you

guilhermecarvalho
Автор

I am trying to capture the wave in the oscilloscope. The sensor works fine. I am getting correct temperature reading in Arduino ide serial monitor. But when connected to oscilloscope, i am not able to debug which part is which. I even connected the diode like u said to differentiate the master signal from the slave. My professor wants me to find the 16 bits of the temperature that is stored in scratch pad and the digital value 16 bits has to match with the celcius value shown in the ide. Even after connecting diode and changing the resistor to 1.5k, i am not able to differentiate anything. The oscilloscope that I use is tektronix DPO 5204. How can i debug it. ( i am using in normal power supply mode only. Not parasitic mode)

dharshnesaravanan
Автор

Greetings :) First of all, Thank You very much for explaining 1-Wire techology in your videos. However, one part still needs to be unraveled about how the temperature number is mathematically generated. In other words, how Byte becomes a real temperature number. Thank you very much in advance if you have time to ecplain it.

gerdvipre
Автор

Could you please help me. I can also send you the picture of the circuit and the waveform if you want

dharshnesaravanan
Автор

Thank you - this was a very helpful video for debugging and your effort here are really appreciated. One minor point just to let you know. I found the hand and pen waving throughout the video really distracting, and it caused me to need to look away a lot in order to listen to the content - if possible I'd recommend less of this, as it distracts from otherwise excellent content. Many thanks.

kjc