View previous topic :: View next topic |
Author |
Message |
Guest_X44 Guest
|
rs485 real example basics |
Posted: Sat May 08, 2004 6:37 am |
|
|
I've searched this forum for how I should start designing a basic pic-based circuit with rs485.
By basic I mean to provide me the least functionality of it. What 485 drivers should I use, and how should this be addressed?
I'm not after fancy features, just down-to-earth basics.
Unfortunately, I couldn't find anything in this forum that's just basic enough for me to learn.
I know C and CCS and have limited experience in designing circuits based on 16f87x devices and rs232, but not 485.
Maybe someone can provide some leads.
Thank you. |
|
|
Guest
|
Re: rs485 real example basics |
Posted: Sat May 08, 2004 7:14 am |
|
|
Guest_X44 wrote: | I've searched this forum for how I should start designing a basic pic-based circuit with rs485.
By basic I mean to provide me the least functionality of it. What 485 drivers should I use, and how should this be addressed?
I'm not after fancy features, just down-to-earth basics.
Unfortunately, I couldn't find anything in this forum that's just basic enough for me to learn.
I know C and CCS and have limited experience in designing circuits based on 16f87x devices and rs232, but not 485.
Maybe someone can provide some leads.
Thank you. |
u can use SP481 from sipex... to connect this rs485 driver u need to connect the rx/tx pin of pic to ro/di pin of 485 driver... while re/de pin should be connected to one of the pic i/o... this pin will control d xmission/reception of data... |
|
|
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Sat May 08, 2004 7:28 am |
|
|
I've used the DS75176 RS485 driver extensively and I'm very satisfied with it. To drive it you need to define the #use RS232 statement with the XMIT,RCV and ENABLE pins, connect the PIC's RX/TX to the driver's RX/TX and connect the ENABLE pin to the both Transmit_Enable/Receive_Enable pins of the driver. |
|
|
Guest_X44 Guest
|
|
Posted: Sun May 09, 2004 4:54 pm |
|
|
Thank you. This forum is giving me leads.
Does anyone have a driver to share for the DS75176 RS485 driver?
Also, do I need any level converters? Any more devices to connect to to complete a basic circuit? What about the crystal? What freq. should I use?
A _simple_ working circuit and code would be of great help. Even just sending/receiving a character or two just to demonstrate the basics is enough. |
|
|
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Sun May 09, 2004 5:13 pm |
|
|
The whole thing is very straight forward. Yo don't need any drivers (code) or level converters. As for the speed, it depends on the baud rate, whether you are gonna use a hardware or software UART, and any interrupts you might have in your code. |
|
|
Guest_X44 Guest
|
|
Posted: Sun May 09, 2004 8:26 pm |
|
|
Haplo, et. al,
On the DS75176 what do the RO, RE, DI, DO, RI mean? The specs I have don't say much.
Which pins are used and which of these connect to the PIC and, which of these connect to the outside world?
Is there a standard connector for a rs485? Is it a 9-pin d type male connector? I've seen pc motherboard with such. Which of the driver's pins connects to the d type connector?
Thanks. |
|
|
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Sun May 09, 2004 8:40 pm |
|
|
DORI and /DORI go to your +/- RS485 lines, RO goes to the PIC's receive, DI to the PIC's send and DE and /RE to the 'enable' pin you have defined in your #use RS232. |
|
|
Guest_X44 Guest
|
|
Posted: Sun May 09, 2004 8:55 pm |
|
|
Thank you so much, Haplo.
Another question, there are two (2) / DORIs there. The inverted /DO /RI and the DO RI.
hich of these go to the + and which one to -? |
|
|
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Sun May 09, 2004 9:16 pm |
|
|
The inverted one goes to -. |
|
|
Guest_X44 Guest
|
|
Posted: Mon May 10, 2004 5:15 pm |
|
|
Haplo, et. al.
Neutone's web site includes a schematic (http://home.houston.rr.com/neutone/Assorted%20circuits.pdf)
What are those diodes for connected to the MAX483?
Is it at this port that other rs485 circuits (external) can directly connect to?
Are optocouplers necessary (advisable) to isolate the PIC?
Thank you. |
|
|
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Mon May 10, 2004 5:36 pm |
|
|
Since that is Neutone's circuit I'll let him comment on it, but in general poeple use opto-couplers/diodes for protection. It depends on your application. For example I usually use two 5.6v zener diodes from the DORI and /DORI lines to the ground, along with two 24ohms series resistors. |
|
|
Guest_X44 Guest
|
|
Posted: Mon May 10, 2004 6:54 pm |
|
|
Hi Haplo,
Could you, perhaps, tell me (and maybe for benefit of other newbies) how the protection diodes and resistors and couplers are wired up, acc to your circuit. |
|
|
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Mon May 10, 2004 7:28 pm |
|
|
As I said, I usually use two 5.6v zener diodes from the DORI and /DORI lines to the ground. I also use two 24ohms resistors in series with the RS486 +/- lines to my driver chip (similar to R23 and R39 in Neutone's design). |
|
|
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Mon May 10, 2004 9:22 pm |
|
|
And again, the amount of protection you'll need depends heavily on your application. If you want very strong protection, I suggest you to follow Neutone's Design. His circuit is protected against just about anything...over-voltage, spikes, noise, lightning strikes, famine, pestilence,... |
|
|
Neutone
Joined: 08 Sep 2003 Posts: 839 Location: Houston
|
|
Posted: Tue May 11, 2004 7:29 am |
|
|
Haplo wrote: | And again, the amount of protection you'll need depends heavily on your application. If you want very strong protection, I suggest you to follow Neutone's Design. His circuit is protected against just about anything...over-voltage, spikes, noise, lightning strikes, famine, pestilence,... |
It's not tested aginst famine and pestilence yet.
I have heard of our sales people going to a site after a near lighting strike and selling replacements for all of our competitors product that were fried. Also that circuit I posted should have used transistors to drive the opticouplers. The drive strength of the max part is marginal for driving an opticoupler and it's best not to put that much on the PIC. |
|
|
|