I experiment with DS18b20 (digital thermometer) using C (WAVR/AVR STUDIO) and AVR ATMEGA (Atmega16) processor. You can see 2 devices wired :
http://gdlpogoda.republika.pl/youtube/1wire.jpg
I've written Search_rom 1-Wire algorithm in 2 versions.
One uses 64xN bits to store all 64bit codes of N devices on the bus.
http://gdlpogoda.republika.pl/youtube/1wire.rar
The other addresses devices simply by using number from 1 to N, where N is the number of devices on the bus.
http://gdlpogoda.republika.pl/youtube/1wireLOW_MEM.rar
Advantage of this version is low RAM consumption due to lack of huge array.
These libraries make temperature conversion on ds18b20/1820 rather easy. You simply need to write 3 lines of code. Use readme file to config libraries according to your hardware, more at readme file inside rar file.
More here (mostly PL language) : http://mathmed.blox.pl/html
------------------
Biblioteki 1Wire, ściągnij z powyższych linków, w środku (readme.txt) jest polski opis.
Odwiedź mnie na : http://mathmed.blox.pl/html
Link to this comment:
All Comments (0)