Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
Much simplier to use a 16F628 or similar with
built in USART and use an RS485 transceiver like
MAX487. Than all u have to do is send and receive
with the USART and control the direction with MAX's
T/R pin (Transmit/Receive).
It is a very strange circuit from the link provided by C_Man: 485 drivers in 232 DB-9 configuration????!!!!
Use one of the RS-485 drivers (MAX485, 487, ...) Connect PB0 to DE/RE*, PB1 to RX and PB2 to TX- you are the design engineer, it is up to you which pin goes where.
If your micro doesn't have UART it is still fine: you can create one in software, but as Zedman said it is just easier to select a micro with UART in.
Checkout this site
( Interconnect many PIC devices over an RS485 network. PIC network protocol source code and application schematic based on a PIC16F873 )
although source code is in C , you can easily port it to basic. It is a clean code implementing rs485 network.
Rs485 is similiar with rs232 . basic code which is written for for rs232 will meet your requirement
YES. My comments concern to the electrical drawing example. It use the SN75176
tranceivers to drive the RS485 line but in a strange configuration. I´m sure they
will NOT work properly in such way, I mean from the noise rejection point of view,
because it break the most important feature of the RS485 wich is the
differential current mode in wich any electrical noise is cancealed.
In the pin assignements, they use the PIN2 & PIN3 of a DB9 without take
care that such pins are used universally for a RS232 communicaton. As the RS485
Standard Protocols doesn´t mention any hardware specification, it´s usual to see
an RS485 node sharing a DB9 connector with RS232 BUT using another pins.
What I guess they try to do is a "quasi-full duplex" configuration with 2 wires (??).
It will work sending and receiving chars for hobbies purpose, but THIS IS NOT RS485.
I would preffer to use only one tranceiver, in half duplex but full differential wired.
IMO, it´s not a model to follow nor suggest.
Just my $0.02.
Sorry I'm not good at Endlish because I'm Vietnamese. I have a problem.I want to connect pic to pic use rs485.The master is pic 18f4550 and slave is 16f887.I use pins TX,RX(rs232) to transceiver
And my code master:
#fuses HS, NOWDT, NOLVP, NOBROWNOUT, NOPROTECT, PUT