Interfacing with DS1821

Anyone have luck or insight interfacing with the DS1821. This is a single wire (DQ) protocol. I can get the reset/presence sequence to work but cannot read (and perhaps presumably write) to it.

There are a plethora of examples and docs out there for pic, jtag, etc plus the Dallas sheets. I am having a hard time finding where things are going wrong. The one thought is the timing on the read is so small between the master signalling a start of a read time slot and when the sample should be taken (15 microseconds) that something is awry. Either that or a confusion over pinMode and LOW/HIGH on digitalWrite.

Essentially trying variations of the following:

const int READ_DUR = 3;
const int READ_WINDOW = 8;
const int READ_QUIET = 64;

byte readByte(int pin) {
byte val = 0x00;
for (int i = 0; i < 8; i++) {
pinMode(pin, OUTPUT);
digitalWrite(pin, LOW);
pinMode(pin, INPUT);

// poll
//for (int i = 0; i < 10; i++) {
// if (digitalRead(pin) == LOW) {
// Serial.println(“Got a low!”);
// }
// delayMicroseconds(6);
if (digitalRead(pin) == HIGH) {
// Serial.println(1 << i, HEX);
val |= (1 << i);
return val;