Home/Support/Support Forum/RS485 the best way to control EN signal?
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

RS485 the best way to control EN signal?

0 votes
Hello,

As you know we have to control EN signal for transmiting data through RS485 line. There is simple way to control this signal. We enable TX line on RS485 bus, when we send data and wait while all data will be transmitted and finally we disabe TX line. The code would be like this:

#define TX485EN(i) BitWrPortI( PDDR, &PDDRShadow, i,6 )
TX485EN(1);
serEwrite("DATA",4);
while(serEwrFree()!=EOUTBUFSIZE);
while (BitRdPortI(STSER_REG,3) || BitRdPortI(STSER_REG,2));
TX485EN(0);

But the problem is waiting all time while data will be transmitted!!!. Imagine if you send 300bytes in 9600kbit/s. You have to wait about 313ms !!! at this time you can't do anythink just wait.

Question: Did anybody try to modify DC library that a serial interrupt self disable TX signal when all data will be transmitted from a serial loop buffer?
I would like that the serial interrupt controls EN line. :confused:
I'm using DC9.62 and RCM3100.

Taris

Best regards
Thanks for your ideas
asked Feb 5, 2009 in Rabbit by Taris New to the Community (6 points)

Please log in or register to answer this question.

5 Answers

0 votes
I use a 74HC221 to trigger a pulse on the start bit of each character in the data output stream. The approach demands a known baudrate from which you can determine the needed delay (9600,8,N,1 would need just above 1ms delay per character)

Henrik
answered Feb 11, 2009 by Henrik New to the Community (7 points)
0 votes
Henrik,

Could you describe more detail how should I connect the trigger pin for the adjustable delay?

Best regards
Taris
answered Feb 11, 2009 by Taris New to the Community (6 points)
0 votes
I have used the attched scheme several times when interfacing an RS232 to and RS485 line.

Henrik
answered Feb 11, 2009 by Henrik New to the Community (7 points)
0 votes
Could someone please repost these images?
Tx
Cow
answered Feb 12, 2010 by Cowtown New to the Community (1 point)
0 votes
Here is the file RS232toRS485sm.JPG. I hope it will bee useful for somebody
answered Dec 9, 2010 by Taris New to the Community (6 points)
...