Go Down

Topic: Keep Serial TX low before and after Serial Com (Read 342 times) previous topic - next topic

Temo

Basically I am trying to emulate this



I try to use Serial.write but I guess the communication pin just stays high before and after.

The device that I was trying to emulate communicates on only one wire. There is also ONLY ONE DATA LINE so all the sending and receiving communication is done on the same wire.

So my question is,
What kind of communication is this?
Is there a library for this communication Protocal?
Should I just use softserial?
How do I write this code?

Code: [Select]
void setup() {
  // initialize both Serial1 ports:
  Serial1.begin(57600);

}

void loop() {
  // read from port 1, send to port 0:
    Serial1.begin(57600);
    Serial1.write(0xAA);
    delayMicroseconds(390);
    Serial1.write(0xD8);
    delayMicroseconds(390);
    Serial1.write(0xEA);
    delayMicroseconds(390);
    Serial1.write(0x31);
    delayMicroseconds(390);
    Serial1.write(0x09);
    delayMicroseconds(390);
    Serial1.write(0x77);
    delayMicroseconds(390);
    Serial1.write(0x77);
    delayMicroseconds(390);
    Serial1.write(0x00);
    delayMicroseconds(390);
    Serial1.write(0x00);
    delayMicroseconds(390);
    Serial1.write(0x00);
    delayMicroseconds(390);
    Serial1.write(0x0C);
    delayMicroseconds(390);
    Serial1.write(0x00);
    delayMicroseconds(390);
    Serial1.write(0x00);
    delayMicroseconds(390);
    Serial1.write(0xA0);
    delayMicroseconds(390);
    Serial1.write(0xAB);
    Serial1.end();
    delay(68);
   
 
}

robvoi

What device is it? What protocol is used? Normal UART?

You may have a look here:
http://playground.arduino.cc/Learning/OneWire

Robert

Temo

What device is it? Valentine 1 Radar Detector. They have an entire service book explaining the com data.
What protocol is used? I don't know. This is my question. I know they use 8bit with 1 stop bit no parity<sp?> but I don't understand how to program the arduino so that my TX line is low before and after the data is send
Normal UART? No, UART normally has two wire (TX and RX). This device does all the receiving and transmitting on the same wire by stopping going low after sending a package.

Go Up