One of the readers looks like this and runs on a separate Arduino Uno. It was originally written for DS1992 so loops taking memory into account might not end soon enough, yet i did not even get to this point. Disabling if (presence) continue seemed to not help much (see not yet proposed commit )
#include <OneWire.h>
OneWire ds(2); // 1-wire on pin 2
byte addr[8]; // Contains the eeprom unique ID
void setup(void)
{
Serial.begin(9600);
digitalWrite(2, HIGH);
}
void loop(void)
{
byte i;
byte actually_useful_data[16];
SearchAddress(addr);
ReadAllMem(); //print all mem content
Serial.print("Pause \n");
delay(5000);
}
void SearchAddress(byte* address) //Search for address and confirm it
{
int i;
if ( !ds.search(address))
{
Serial.print("No device found.\n");
ds.reset_search();
delay(250);
}
Serial.print("ADDR= ");
for ( i = 0; i < 8; i++)
{
Serial.print(address[i], HEX);
Serial.print(" ");
}
if ( OneWire::crc8( address, 7) != address[7])
{
Serial.print("CRC is not valid, address is corrupted\n");
return;
}
if ( address[0] != 0x08)
{
Serial.print("Device is not a 1-wire Eeprom.\n");
return;
}
Serial.println();
}
void ReadAllMem()
{
int i;
ds.reset();
ds.select(addr);
ds.write(0xF0, 1); // Read Memory
ds.write(0x00, 1); // Read Offset (xx): 00 xxh
ds.write(0x00, 1); // Read Offset (yy): yy 00h
for ( i = 1; i <= 128; i++) //whole mem is 144
{
Serial.print(ds.read(), HEX);
Serial.print(" ");
if ((i % 16) == 0){
Serial.println();
}
}
Serial.println();
}
Project does not work for me
Two different programs do not recognize an emulated DS1990a:
My source code:
One of the readers looks like this and runs on a separate Arduino Uno. It was originally written for DS1992 so loops taking memory into account might not end soon enough, yet i did not even get to this point. Disabling
if (presence) continue
seemed to not help much (see not yet proposed commit )