Are there plans to add support for the Dallas 1-wire protocol to the IOIO? I would like to use my IOIO to read temperature from the DS18B20. --
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ioio-users/-/GYmNbbEXVLoJ.
To post to this group, send email to ioio-...@googlegroups.com.
To unsubscribe from this group, send email to ioio-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ioio-users?hl=en.
Circa 1997-1998, I used the DS1994 1-wire cans for a PIC16C5X-based project. Dallas, at the time, had sample code written in various flavors of microcontroller assembly language, *not* including the PIC family, and a few high-level languages like C. They also meticulously described the timing of the protocol in terms even a green-horn could understand.
The routines for communicating with these 1-wire devices were, and are, simple enough to de-cypher and port from a related language and their description. I ended up porting the example code from 8051 assembly language to Parallax PIC assembly language. Since all you're doing is banging a single data pin high or low to create square-wave pulses, or measuring the length of pulses sent by the device, and the timing of the communication is quite slow in the grand scheme, you should be able to code this interface against any general purpose I/O pin. I also recall seeing code written more recently, for other dev platforms like Arduino, in easier to understand language (BASIC-like, not assembly!) You'll have to "pay attention" to the port during a transaction to get the timings right, but since the timings are so slow, and relatively fault tolerant, (as far as pulse length,) I can't imagine it would be that difficult to achieve reliable 1-wire communication through the abstraction layer of Java in this environment.
That said, unless you've got some special reason to use the 1-wire devices, (for user-inserted data via the cool can package,) you'd probably have much better luck using sensors that use one of the other interfaces already natively supported by the IOIO.
To view this discussion on the web visit https://groups.google.com/d/msg/ioio-users/-/a2MSWGN7H3QJ.