Page 1 of 1

RS485 using SN75176

Posted: Fri Aug 29, 2008 11:28 pm
by wayne millard
Hi team,

on the properties of the RS232 port the is a hardware flow control can this be used to control the transmite and receiver of the 485 chip.
do i connect RTS & CTS to together.

Thanks
Wayne

Re: RS485 using SN75176

Posted: Sat Aug 30, 2008 1:36 am
by Sean
In most half-duplex RS485 applications the 75176 is held in receive mode unless the local device is transmitting. The normal RS232 hardware flow control signals are not suitable for this operation.

It should be possible to use Flowcode output commands to generate a signal to perform this function. Flowcode delay timers could be used to ensure that the 75176 remains in transmit mode for the duration of each transmission (worst case timings must be used). Control timing could be improved by using a small amount of C code to monitor the USART status flags and confirm completion of each transmission.

RS232 hardware flow control should be turned off.

Are the transmit and receive enable pins of the 75176 connected together to allow use of a single direction control signal?

Re: RS485 using SN75176

Posted: Sat Aug 30, 2008 1:02 pm
by wayne millard
Thanks for the reply.
yes i need to reply to comands that are sent to a pic18F4520 so i need to control a 75176 transmite and receive.

Thanks
Wayne

Re: RS485 using SN75176

Posted: Mon Sep 01, 2008 10:44 am
by Sean
You can use the flowcode output command to allow any unused i/o line to be used to enable the SN75176 transmit mode. If the /RE and DE pins of the SN75176 are both connected to the selected PIC i/o pin, the output should be set high immediately prior to issuing the RS232 tramsmit command.
A single line of C code, in a Flowcode C code block, is then required to wait for completion of the transmit sequence by testing the TRMT bit of the TXSTA register (0 while transmitting, 1 when complete).

c code:

while (txsta.TRMT == 0);

After this condition has been met the direction control output can be cleared to put the 75176 in receive mode again.

Re: RS485 using SN75176

Posted: Mon Sep 01, 2008 5:06 pm
by wayne millard
Hi sean,

How do i read the statas of txsta.TRMT == 0 to set port pin to 0v to get ready for receive data.

Thanks,
wayne

Re: RS485 using SN75176

Posted: Mon Sep 01, 2008 5:22 pm
by Sean
I have attached a small code segment that illustrates the 75176 direction control. It assumes that RC5 is being used as the direction control pin, and that a single character 'X' is being sent.
485tx1.fcf
(3.5 KiB) Downloaded 1036 times

Re: RS485 using SN75176

Posted: Mon Sep 01, 2008 10:18 pm
by wayne millard
Hi sean,

Thanks for all your help.

wayne

Re: RS485 using SN75176

Posted: Mon Oct 17, 2016 2:46 pm
by joe nova
[/img]
Sean wrote:I have attached a small code segment that illustrates the 75176 direction control. It assumes that RC5 is being used as the direction control pin, and that a single character 'X' is being sent.
The attachment 485tx1.fcf is no longer available


Dear

I'm trying to run the suggestion of Sean, 485tx1 in my version 6.1.3.2, and I'm not getting, someone help me? File and the error codes are in the Annex.