The Zen of the 1-Wire Protocol
John Couture
Posts: 370
The Zen of 1-Wire Protocol
Well, folks, I finally solved the riddle of how to program the SX and get them to communicate with the 1-Wire AAG Weather Station ... and I fit the program into a lowly SX18!
The 1-Wire protocol is basically a communication protocol to communicate with sensors and devices using only a single twisted pair of wires.· My weather station is over 400 feet from the shop and is working fine.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture
San Diego Miramar College
Well, folks, I finally solved the riddle of how to program the SX and get them to communicate with the 1-Wire AAG Weather Station ... and I fit the program into a lowly SX18!
The 1-Wire protocol is basically a communication protocol to communicate with sensors and devices using only a single twisted pair of wires.· My weather station is over 400 feet from the shop and is working fine.
- Attached are two routines:
- AAG-Search-608.sxb - This program is used to determine the serial numbers of the AAG Weather Station
- AAG-Weather-845.sxb - This program is used to read the sensors on the AAG Weather Station.· You'll have to code your serial numbers into the program to get it to work with your instrument.
·
- A couple of notes about the programs:
- Although you can combine both programs into an SX48/52, I separated them so that they would fit in an SX18 / SX28.· I do have a version that is combined and working on an SX52 along with a 4-bit parallel LCD.· If there is any interest, I'll clean up the code and post it.
· - As per Jon Williams suggestion, I use a serial port to display the output.· In my case I use an RS-485 network but by commenting out the Enable command you have a standard SerOut command that can be connected to a serial LCD.
·
- Although you can combine both programs into an SX48/52, I separated them so that they would fit in an SX18 / SX28.· I do have a version that is combined and working on an SX52 along with a 4-bit parallel LCD.· If there is any interest, I'll clean up the code and post it.
- References:
- AAG· Weather Station - about $80
http://www.aagelectronica.com/aag/index.html?target=p_1.html&lang=en-us
· - Articles
- Search Algorithm for the BS2P, Jon Williams, Nuts & Volts, Apr 2001
http://www.parallax.com/dl/docs/cols/nv/vol2/col/nv72.pdf
· - 1-Wire Weather Station using the BS2P, Jon Williams, Nuts & Volts, Feb 2002
http://www.parallax.com/dl/docs/cols/nv/vol3/col/nv82.pdf
· - Using 1-Wire Technology in Bench top Instruments, Dan Awtrey, Sensor Magazine, May 2001
http://www.sensorsmag.com/articles/0501/34/main.shtml - also several other articles by Dan Awtrey on using 1 wire sensors and chips on the Sensors Magazine web site http://www.sensorsmag.com, just search on "one wire"
·
- Search Algorithm for the BS2P, Jon Williams, Nuts & Volts, Apr 2001
- 1-Wire Protocol
- Overview of 1-Wire Technology and Its Use
http://www.maxim-ic.com/appnotes.cfm/appnote_number/1796
· - ·Manual - see pg 2 for the family codes
http://pdfserv.maxim-ic.com/en/an/AN155.pdf
· - iButton(tm) Overview (basically the 1-Wire philosophy)
http://pdfserv.maxim-ic.com/en/an/appibstd.pdf
·
- Overview of 1-Wire Technology and Its Use
- Open Source References
- SourceForge - http://oww.sourceforge.net
- AAG· Weather Station - about $80
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture
San Diego Miramar College
Comments
Very nice code.
A very cool application too.
Thanks for posting it.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
"Ability may get you to the top, but it takes character to keep you there."
·
You and Jon Williams are my inspiration. You two are the "zen masters" in my opinion. I'm just a lowly apprentice.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture
San Diego Miramar College
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture
San Diego Miramar College
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax