Arduino and 1-wire

(BUMP)

I'm new to this whole Arduino thing but it is a great design and tool, and I'm very enthusiastic about what I may be able to do with it.

Recently I received my own Arduino USB development board to play around with, and I also happened to order one of Dallas semiconductor's 1-wire temperature sensors. Painfully going through the datasheet for the DS12S20, I hacked together code to try to interface with this unit. I am not working in parasite power mode.

After getting the timing is right and the subroutines in place in order to read and write to the one wire interface, I was able to come up with a working software. The current version simply sends a request to do a conversion, waits until it is done, and then requests the scratchpad from the unit.

I thought that this would take much longer than a few hours, however at this point I can communicate with the temperature sensor and read back data. At this point, I simply have the nine bytes set back over in their numeric value, via the serial port (USB interface in my case).

Interestingly enough, so far I am able to receive proper data. What is sent back is on par with what the data sheet says should be sent back, including reserved registers and CRC codes, and the data that I received corresponds to what this should be by default. Also, I was able to make the Arduino write to the temperature sensor's storage registers and read the data back properly, so everything is working in that department.

The problem is, when I send a request to do a conversion, that is fine and well, except that the data that is returned for bytes one and two (which should be the temperature reading), always are returned as the default power on value for the DS12S20. For some reason, I cannot get it to convert and return temperature readings.

So, at this point it is only a marginal success in that I can get these sensors to hold two bytes for me, however I cannot get it to do what it was designed to do, and convert temperatures.

If anyone at this point is still trying to interface these or other chips that use the one wire interface, to Arduinos, it is possible with not too much code, however I am stumped at this point as to why the sensor will not initiate a conversion and return sensible data. I've tried hooking up an oscilloscope to the one wire data pin, and the transaction seems to be taking place properly, yet the DS12S20 will not write the finished conversion value to the scratchpad. Perhaps I have a bad sensor, however at this point I only have one so I cannot confirm this to be the problem.

The other thing is that in the data sheet for this temperature sensor, all of their examples heavily rely on the "parasite power mode" and I do not see specific examples of using it with external power. Any suggestions?