Go Down

Topic: Keep Serial TX low before and after Serial Com (Read 407 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.

james13

If you are reading this old post, you may also be interesting in reading this post.

Robin2 gave me a good starting code example.

I managed to adapt his code to 57600 baud and can listen to other arduino's great. I'm still battling on to understand what the V1 is actually putting out using a cheap logic analyzer. The V1 Technical document states 57600 8 bits no parity and 1 stop bit, but the analyzer can't make heads or tails out of it (neither can I yet).  :o

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy