PDA

View Full Version : RS485 without a 555



The Master
- 16th August 2009, 18:08
Hi, I just had a random idea. Ive been using the 555 timer method to automatically switch an RS485 chip from receive to send. I was just thinking though, is the 555 part really needed? Couldnt i just fix the data input pin to high and connect the TX pin from the chip to the pins that change it to a sender (possibly through an invertor). This method would mean it changes to and from sender/receiver faster and requires less components (even if it needs an invertor).

Is there a reason everyone seems to use the 555 method instead of this? Are there any potential problems doing it this way?

dhouston
- 16th August 2009, 21:13
Hi, I just had a random idea. Ive been using the 555 timer method to automatically switch an RS485 chip from receive to send. I was just thinking though, is the 555 part really needed? Couldnt i just fix the data input pin to high and connect the TX pin from the chip to the pins that change it to a sender (possibly through an invertor). This method would mean it changes to and from sender/receiver faster and requires less components (even if it needs an invertor).

Is there a reason everyone seems to use the 555 method instead of this? Are there any potential problems doing it this way?
The 555 switches from send to receive not receive to send. You could delay 25mS or so before switching the line direction or you could watch the output buffer to see when it is clear (not easy with a software UART) - the 555 does this automatically.

The Master
- 16th August 2009, 21:40
When RE and DE are both low the chip is in receive mode. To send data both pins need to be high then the DI pin also needs to go high. All the 555 circuit does is makes RE and DE high when DI goes high then sets them back to low shortly after DI goes low. So i guess the question is really why is the slight delay needed?

If DI is set to high permenantly then the data pin connects to RE and DE. When data is sent it switches the chip to send mode and because DI is already high it sends a high bit.

Some of my circuits use a 555 and the really small ones use an IO pin to save space. If it could be used how i said then i could save an IO pin or a few components.

Ioannis
- 17th August 2009, 07:59
Do you mean that your data are always 1?

If it is, then sure youdo not need the 555. But what kind of data is always 1? Power supply?

Ioannis

The Master
- 17th August 2009, 09:58
The data isnt always 1. When the TX pin goes low then the RS485 chip resets back to a receiver so the line goes low

Ioannis
- 17th August 2009, 10:23
If the data line retuns to zero,that does not mean end of transmission. Do not get confussed.

End of transmissions happens some time later. This "later" gives the 555 as a monostable multivibrator.

Ioannis

The Master
- 17th August 2009, 10:42
What exactly is this "end of transmission"? I thought it was either on or off

Ioannis
- 17th August 2009, 12:06
I believe there is a problem with the basics here.

E.g. you have to send the following byte:

1 1 1 0 0 1 1 0

You send all the bits and not the '1's only

The RE and DE (if connected together) must be at high level before the first bit and a little after the last bit.

Ifyou send with a baud rate of 9600, then each bit is 1/9600=0,1042msec nd the full 8+2 bits (Start and Stop) will be 1,042msec. So the RE and DE have to be more than 1,042 msec high. Not just for the time that a bit of the data is 1.

Is that more clear now?

Ioannis

The Master
- 17th August 2009, 12:41
Yes, I understand what your saying but i dont understand why. The value can only be 1 or 0. When the 485 chip is in receiver mode then isnt that a 0?

Ioannis
- 17th August 2009, 13:51
What value?

You have a control input (Send or Receive) and a couple of data input/output.

When you send data, regardless if it is 1 or 0, you make control input high. This input is control not data. Your data can be 1 or 0. When you are done with data, then control input is set to low again, and you are ready to get any valid data.

In reallity the chip has 2 control pins and 2 data pins. Control are anti phase active so you can connect them together. Data can only be sent or received. Not at the same time if you have only one couple of lines (A-B), so you can connect data in and data out together too.

Ioannis

The Master
- 17th August 2009, 15:56
I agree with what you are saying there but i think you missed my point.

Lets say we have 2 RS485 chips connected together and for now we are only going to send data in 1 direction. By default both the control and data inputs on 1 chip are low. The chip on the other side will be outputting low.

To make the output of the second chip go high you need to turn on the control inputs (disables the receiver and enables the transmitter) and make the input pin high. The output of the second chip will only be high if the control inputs and data input are all high.

If the data input goes low then the output on the 2nd chip will go low.
If the control inputs go low then this chip is no longer sending so the 2nd chip will still go low even if the data input on the first chip is still high

dhouston
- 17th August 2009, 15:57
I suggest you ask your question of an expert who also happens to be really good at explaining things with clarity. You can email Jan Axelson at jan (at) lvr.com. I've always found her to be responsive and helpful.

Ioannis
- 17th August 2009, 16:46
Hmm, now I see what you are cooking. But this, I have to say, is risky as you may get out of sync in the data stream.

But with a little careful design, it may work.

Ioannis