1-Wire Slave

prone:
@onik: did you make any progress?

Yes, in fact I did. First there was a delivery delay on my Arduino board, and then the Serial side of the app had to be redesigned, but finally I got to work on the 1wire side.

I cobbled together a little test sketch for transmitting a ROM generated from user input, and verified it with OneWireViewer and an USB adapter (DS9490R). The code attached works, but only if the board is not attached to the reader when starting the viewer, otherwise it doesn't recognize the 1-wire net. I had one crash, but this may be due to the app itself, not the Arduino side.

#include <OneWireSlave.h>;

const int OW_TX_PORT = 13;

unsigned char rom[8] = {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
OneWireSlave ds(OW_TX_PORT);

int checkRom();
int sendRom();
int resetValues();

void setup() {
  pinMode(OW_TX_PORT, OUTPUT);
  Serial.begin(9600);
  Serial.println("* Setup done");
}

void loop() {
  Serial.println("**Input RFID tag (in hex, 4 bytes):");
  while (Serial.available() < 8) {
    delay(10);
  }
  if (checkRom() == 0) {
    Serial.println("***RFID valid for ROM, calculating CRC and sending...");
    Serial.print("****");
    Serial.print((int)rom[0]);
    Serial.print((int)rom[1]);
    Serial.print((int)rom[2]);
    Serial.print((int)rom[3]);
    Serial.print((int)rom[4]);
    Serial.print((int)rom[5]);
    Serial.print((int)rom[6]);
    Serial.println((int)rom[7]);
    sendRom();
  } else {
    Serial.println("\n**Invalid character.");
    resetValues();
  }
  do {
    Serial.read();
  } while (Serial.available());
}

int checkRom() {
  unsigned char data[8];
  unsigned char validValues[22] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F'};
  for (int i = 0; i < 8; i++) {
    Serial.print(Serial.peek());
    data[i] = Serial.read();
    boolean matchFound = false;
    for (int j = 0; j < (sizeof(validValues) / sizeof(validValues[0])); j++) {
      if (data[i] == validValues[j]) {
        matchFound = true;
      }
    }
    if (!matchFound) {
      return 1;
    }
  }
  Serial.println("");
  charToHex(data);
  return 0;
}

void charToHex(unsigned char chars[]) {
  int values[8];
  for (int i = 0; i < 8; i++) {
    switch (chars[i]) {
      case '0':
        values[i] = 0;
        break;
      case '1':
        values[i] = 1;
        break;
      case '2':
        values[i] = 2;
        break;
      case '3':
        values[i] = 3;
        break;
      case '4':
        values[i] = 4;
        break;
      case '5':
        values[i] = 5;
        break;
      case '6':
        values[i] = 6;
        break;
      case '7':
        values[i] = 7;
        break;
      case '8':
        values[i] = 8;
        break;
      case '9':
        values[i] = 9;
        break;
      case 'a':
      case 'A':
        values[i] = 10;
        break;
      case 'b':
      case 'B':
        values[i] = 11;
        break;
      case 'c':
      case 'C':
        values[i] = 12;
        break;
      case 'd':
      case 'D':
        values[i] = 13;
        break;
      case 'e':
      case 'E':
        values[i] = 14;
        break;
      case 'f':
      case 'F':
        values[i] = 15;
        break;
    }
    if (i % 2 == 0) {
      values[i] = values[i] * 16;
    }
    Serial.print("Value ");
    Serial.print(i);
    Serial.print(":");
    Serial.println(values[i]);
  }

  rom[3] = (values[0] + values[1]);
  rom[4] = (values[2] + values[3]);
  rom[5] = (values[4] + values[5]);
  rom[6] = (values[6] + values[7]);
}

int sendRom() {
  ds.init(rom);
  ds.setPower(PARASITE);
  ds.waitForRequest(false);
  return 0;
}

int resetValues() {
  rom[0] = 0x01;
  rom[1] = 0x00;
  rom[2] = 0x00;
  rom[3] = 0x00;
  rom[4] = 0x00;
  rom[5] = 0x00;
  rom[6] = 0x00;
  rom[7] = 0x00;
}