Shop OBEX P1 Docs P2 Docs Learn Events
RS485 NETWORK - Schematic with AUTO TERMINATION - UPDATED REV-K - FINAL?? — Parallax Forums

RS485 NETWORK - Schematic with AUTO TERMINATION - UPDATED REV-K - FINAL??

DavidMDavidM Posts: 630
edited 2009-03-12 00:14 in Propeller 1
Hi

I have attached a schematic of what I want to achieve for a RS483 HALF DUPLEX Network system for the PROP!

My main aim was to design just the one board and that configuration of the network was all done via software and automatically.
The use is for network systems that need to be set up in temporary installations.

There are two connectors for each SLAVE device and only 1 connector for the MASTER.
When a connector/cable is inserted , pins 3 & 4 of the connector will make HIGH the inputs to the EXPANDER CHIP. the software in SPIN will detect this and configure the TERMINATION'S and BIASING accordingly.

I am not using the interrupt pin of the expander.

The "DEVICE ENABLE " and "RECEIVE ENABLE" PINS of the RS485 chip will be controlled via the I2c buss. The two RX & TX LEDS will be illuminated accordingly.
RX & TX Data is NOT sent via the I2C Buss.
The cabling will be pre made and each cable will have a MALE and FEMALE end so that the user cannot connect incorrectly.
Apparently this RS485 device can handle up to 256 NODE!!
I am restricted to 4 PROP Pins on the 6 pin header ( at the top)
I have a 3.3V regulator shown ONLY because I have an existing device(s) that I need to connect to ( and I made provision of 5V ). The power supply can be ignored. But the whole board runs on 3.3V

I will be using special SWITCHCRAFT Connector's ( EN3 Series) as indicated as they are inexpensive, IP68 rated ( I need this for outdoor use) and impossible to connect the wrong way around. They are also easy to make up and assemble.

I will be using the standard full duplex serial object in SPIN, but I will create my own object to handle the I2C control etc.
The I2C buss is in addition to the existing PROP I2C buss, but there is no reason you can't use that.
I will be using 2-WIRE TWISTED PAIR Cabling ( BELDEN #9841). But I will be using 4 PIN Connectors so That I can connect pins 3 & 4 of EVERY cable Connector ( internally) so it acts like a switch. This will prevent the user from MANUALLY terminating the devices. Basically I want the whole system to be "PLUG & PLAY"

So I have a question..

Q1) Can the BIAS resistors ( R1 & R3) & the TERMINATION resistor( R2) be set via OPTO COUPLERS the way I have shown it? Is the Polarity Correct?

Any comments are welcome.

By the way, I know very little about RS485, this will be my first go at it, But I have done a lot of reading and research.

regards

Dave M

Post Edited (DavidM) : 3/10/2009 10:39:47 PM GMT
«1

Comments

  • dMajodMajo Posts: 855
    edited 2009-02-24 18:15
    A1: No, uslually you use analog switches to do the job.

    The attached schematic is how the things are usually done:
    - the termination is a 100/120 resistor (maybe a typo 120K)
    - you need to disconnect the resistor network only from A/B signals and you want less things as possible to remain connected here due to impedance/noise when high data rates are used
    - the only reason to disconnect the resistor network from power supply is for power consumption: since the network sides are usually connected to Vcc/Gnd or +Vcc/-Vcc usually the switches are on sides (some times I have seen two opposite switches only on the power side connecting it or to Vcc or shorting the network on Gnd).

    Consider also that you have 485 line drivers with integrated/switchable termination

    Now some comments:

    The bias resistors are not necessary on new line drivers with "fail safe" feature: they are used to force the receiver in a known state when the device is disconnected or the other nodes are not powered (to prevent a receiver from getting noise during a disconnected state each node should have its own biasing resistors and their values are usually dimensioned on how much partecipants are expected on the bus). If you leave them only on termination sides 1k1/2k2 should be ok.

    With the schematic showed you do not need any pin to drive the termination (it is done automatically when the "out" connector is plugged. The pin going to the prop will report if a connector is present or not and (because of the 470 resistor) will allow to force the termination off when the connector is unplugged and/or preserve the prop io in case of errata software (drive it high when connector plugged)

    R4/R5 and R6/R7 on your schematic will probably not do the job you expect. Without bridge the input will see Vcc with the bridge Vcc*0.66 (probably too high to be a·logic 0)

    The best place the leds (maybe 3) is on IC1 pins 1, 4 and 2/3: you have not to write software to drive them and they will report the states you want to see (on pin 1 maybe with an aux transistor, it depends on the 485 receiver drive capability, I have not seen the datasheet)

    If you want high data rates and good response times you must wire the rx-enable on the prop like rx and tx (it is waste of time, each time you need to switch from transmision to reception, to communicate it through I2C: this should be managed by/in the serial driver and synced with the transmit fifo)

    If the application is outdoor (so also·the cables between the nodes) and/or the nodes are powered from different power plugs (maybe not on the same earth potential) you want to consider a galvanic separation


    Some links:

    LTC2854/LTC2855
    http://www.linear.com/pc/downloadDocument.do?navId=H0,C1,C1007,C1017,P36295,D19199
    ·(built-in termination)


    Analog Switches http://datasheets.maxim-ic.com/en/ds/MAX4751-MAX4753.pdf

    Isolated RS485 http://www.linear.com/pc/downloadDocument.do?navId=H0,C1,C1007,C1017,P1746,D2570


    App.notes
    Determining Clock Accuracy Requirements for UART Communications·(post edited)
    Selecting and Using RS-232, RS-422, and RS-485 Serial Data Standards·(post edited)
    How Far and How Fast Can You Go with RS-485?·(post edited)
    Guidelines for Proper Wiring of an RS-485 (TIA/EIA-485-A) Network

    Using RS-485/RS-422 Transceivers in Fieldbus Networks·(post edited)

    Methods for Trimming the Power Required in RS-485 Systems

    Considerations for Selecting an RS-485 Transceiver in Electronic Power Meters

    RS-485 Data Interface Gives Isolated, Full-Duplex Operation·(post edited)

    Explanation of Maxim RS-485 Features·(post edited)

    AN10658 Sending I2C-bus signals via long communications cables·(post edited) This is regarding the I2C bus but on chapter 4 is well explained what happens (generally) on long communication lines



    Post Edited (dMajo) : 2/25/2009 12:47:52 PM GMT
    864 x 858 - 62K
  • DavidMDavidM Posts: 630
    edited 2009-02-25 03:09
    Hi dMajo,


    Thanks for the informative reply.

    I have few questions but firstly the obvious things...

    1) I will scrap the power supply 3.3 volt circuit and just stick with 5V ( this gives me more choices in RS485 devices )
    2) I will run the RX & TX LEDS of the data lines as you suggested. ( I may use a line level mosfet to help out)
    3) I will scrap the I/O Expander
    4) The RX Enable line will be controlled via DIRECTLY via a prop pin and via the serial object as suggested.

    You have suggested a transceiver with built in termination. this is nice but that's the only device with that feature.
    So I will have a terminating resistor but I will use a ANALOG switch to control it. This can be done by some logic XOR gates ( I will post a new schematic later).

    Depending on the features of the transceiver selected, the use of bias resistors is not necessary so long as the device has FAIL SAFE. ( from what I understand)

    Now the main question is..

    GALVANIC ISOLATION..

    All my devices ( the nodes) are self power by battery.
    I will be using 2-wire twisted pair cabling but I will not connect the shield to anything ( Unless I need to), this leads to now only selecting devices that have ISOLATION, these devices are more expensive

    I guess I need help selecting the right kind of device first and working from that.

    regards

    Dave M
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2009-02-25 06:08
    There are some devices that have the isolation built in as you said, but they are cost in both price and board real estate. A couple weeks ago I was researching on RS-485 networks and isolation. I believe it was Maxim that had lots of information, app notes and articles I was reading through. I was more of researching than designing at the time, so I can't offer much further advice there.

    On the other topic, I agree the biasing resistors are NOT needed as long as the device has fail safe, but I read an article once that discussed what is really fail safe related to driver ICs.

    Why does the termination need to be dynamic? Why not a jumper or switch set by the user?


    EDIT: Add the underlined "NOT" above - thank you David for pointing that out.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto for SunSPOT, BitScope
    www.tdswieter.com

    Post Edited (Timothy D. Swieter) : 2/25/2009 6:39:04 AM GMT
  • DavidMDavidM Posts: 630
    edited 2009-02-25 06:35
    HI Timothy,

    Termination's need to be AUTOMATIC because the end user ( customer) does not need to know about the inner workings of our products. and also its less for them to think about. and besides I think I have a solution for AUTO TERMINATION so if it can be automated then automate it! The networks are set up in temporary installations.

    Just to correct you, I believe bias resistors are NOT needed if the device has fail-safe!

    I have the famous book "SERIAL PORT COMPLETE" it has lots of information about RS485 but it 10 years old.

    If I need a RS485 chip then the MAX3535E has all the bells and whistles I could possibly want, they also have an evaluation board, I am getting pricing and availabity on this. this device could be just overkill for my needs.

    I really need to know what device I require , the main concern is running the network off 12 batteries (1 for each node device), according to the SERIAL PORT COMPLETE book, if a system runs on individual batteries for each node then GALVANIC ISOLATING is required??


    thanks

    Dave M
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2009-02-25 06:45
    First, thank you for pointing out the lack of the NOT - that is what I meant, I apologize for the confusion.

    I am interested in learning more as you go along here since I have various applications that I may need to do similar work. Mainly my applications have been with DMX-512A, which is a physical layer of RS-485 as well as a packet specification. There have been a few other networks too with RS-485 that I have been involved in, but not in designing the circuits, just applying them. With different nodes at different voltages I would recommend making sure the network is isolated. We had an installation that was all powered off of one "battery" and we lost a ground on the power distribution system to some of the nodes. POP! went the RS-485 ICs because they were the path for ground some how - still puzzling this one out myself. Thus, I need to keep reading and learning. This will be a good thread to watch.

    Serial Port Complete is a book I have paged through, but don't have on my self at the moment, I will add it to my list to reference in the future.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto for SunSPOT, BitScope
    www.tdswieter.com
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2009-02-25 06:55
    Yikes!! I was looking at the price of the MAX3535E IC on Digi-key - not cheap! (US$9.92/each for 25pcs) In fact it is the price that starts to make me wonder how can the system be "value engineered" for best performance and what other options may be.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto for SunSPOT, BitScope
    www.tdswieter.com
  • DavidMDavidM Posts: 630
    edited 2009-02-25 07:16
    Hi Timothy,

    Yes, its a little pricey but it depends on the benefits you can give to a customer and the designer.

    I just found another CHIP - ADM2483BRWZ-ND, its half the price looks like the same features.

    I have also noticed that these ISOLATED Type devices require some kind of transformer/ voltage circuit?

    We need to look into this.


    Dave M
  • dMajodMajo Posts: 855
    edited 2009-02-25 14:43
    I·have updated previous post with some more links.

    Now some other considerations:
    - As I have understand your application will be batt powered so:
    1) If it is really only battery powered (no batt recharge plugs, no ground wires) probably you not need galvanic isolation: a good shelded (>70%) twisted pair will do the job (shields connected on both the sides)
    BTW: the·isolated ones are not so expensive considering that they have built-in optocouplers to isolate microprocessor·signals from 485 line, also the 485 receiver/transmitter are powered through a switching power supply through a isolation transformer (sometimes built-in other times external, but its the only sensitive external component required).·With other transceivers you need to provide optocouplers isolated power supply and this mean more components, more pcb space, more soldering for production and increased desingn time in development.
    2) The bias resistors are not necessary with "failsafe" devices, but all of them should be "failsafe". Now your·plug bridge will give·you the information so·even if "not failsafe" if the unit is disconnected you can simply ignore the incoming traffic (caused by noise) because you know you are disconnected. The problem is when you are sure you are connected, all transmitters online are hiZ and your·receiver output delivery you data: how you discriminate it from noise? (this means higher software efforts, stronger fail-tolerant protocol, ...) My suggestion is to·keep the bias possibility (but unconnected: you can auto-disable the termination[noparse][[/noparse]120ohm] with the plug-bridge and drive separately the bias with hwjumper or an other IO pin) in order to allow·nodes from other producers, since you don't know which kind of line driver they are using (bias-on will draw more batt power)
    3) For battery powered device you may consider schottky diodes on all nodes and try keeping the termination disabled (my schematic allow for this and it is under prop control so you can enable/disable depending eg. on data rates/cable lenght)
    4) going to 5v drivers will reduce your batt operating time because when the batt goes below 5v the 485 driver will fail (at least the 485 specs). Solution: you can use Step-UP/Down DC-DC converter to power the prop and a wide voltage supply range line driver connected to Vbat or a 3.3V one connected to Vcc (regulated)
    5)LEDs: With 350-1678-ND, 350-1680-ND, 350-1772-ND, 350-1773-ND, HLMPD150A-ND·and such 1/2mA leds you MAYBE need a booster only on 485 receiver output: eg LTC2854/LTC2855·do not need it since they have 4mA output capacity (also TI has receiver outputs currents of 20mA)

    - General considerations
    1) when developing a product (specially on low quantities) you consider sometimes more the versatility/reusability rather than the cost down to the cents. That means that the 485 full-duplex drivers is capable to do also 422 and you have to bridge the transmitter with the receiver on the connector to have the classic 485 half-duplex configuration. In case of full-duplex you have to provide double termination (one for each line). Where the difference: full-duplex is single master to multiple slaves because the communication lines are in parallel on slaves but crossed on master (higher speed/response in communication); half-duplex allow for multi-master to multiple slaves and inter-slave communication (it's up to the protocol) because each node is able to transmit and listen to the bus traffic.
    2) on half-duplex bus it is some times preferable to have distinct signals for rx/tx enalbe because it can allow for loopback and so also implement collision-detection way before the destination node ack-timeout and so increase the throughput on the bus
    3) consider profibus style solution: the master/slave provide·one db9 connector with A/B/Vcc/Gnd/Shl pins. The power supply is to power the bias resistors that are in the conector with the termination one. The connector have a hw-switch to enable/disable the resistor network. Both the cables goes to the connector and this allows a hot connection/disconecction of the slave without breaking the communication on the bus

    Some TI links: 1, 2, 3
    PB-DPconnectors: Fast-Connect, 6GK1500-0EA02, 6GK1500-0FC10, 6ES7972-0BA60-0XA0

    PS.: It could seems I am pushing for Maxim but is not so. The·reason is that 85% of the parts for my projects comes from Maxim/ST/TI/LT·because when in development/ptototyping stage it is easier to get free samples from them
  • DavidMDavidM Posts: 630
    edited 2009-02-25 23:05
    Hi dMajo,

    Thanks for another excellent reply, lots to read here..

    Some questions and observations..

    Q1) If I use a shielded cable (BELDEN #9841) , then should I connect the shield ( braid) to say pin 3 or 4 inside my connector and have that connect to GND? and then can i still use my detect feature?

    Q2) I am using 12V SLA batteries 2.2ah, the voltage will not go below say 9 volts.
    Q3) regarding LED's will use a pair of LOGIC LEVEL MOSFETS to dive them, as I do this in my normal serial coms devices. the mosfets minimise the interference on the RX & TX Lines yet give plenty of power to the LEDS.

    regards

    Dave M
  • DavidMDavidM Posts: 630
    edited 2009-02-26 04:43
    HI,

    I have decided to use the MAX3535ECWI Device

    Its about $10 each for 25 pcs.

    It has all the bells and whistles. I am now inquiring about the evaluation KIT that MAXIM have.

    datasheets.maxim-ic.com/en/ds/MAX3535EEVKIT.pdf

    I have spoken to a maxim tech guy here in oz, he recommened that the SHIELD of my cable should be connected to all output grounds.
    I am pretty sure that I don't need any biasing resistors.
    I will be working on a schematic and post this soon.

    Any comments?

    regards
    Dave M
  • dMajodMajo Posts: 855
    edited 2009-02-26 20:52
    First some assumptions:
    - app is battery powered at 12V
    - by referring to the MAX3535ECWI we intend Fig.11(p.19) and TAC(p.24)

    Now the answers:
    A2) since battery power is always precious I suggest you a switching regulator: because of the enough high batt voltage (and maybe the need for some others behind the 3.3V for the prop) something like this will do the job. You can supply directly the digital part; if something analog filter the Vana power supply in this way.
    A3) OK. Anyway the MAX3535ECWI have 4mA of receiver output current so no need for boosters for 1/2mA leds (remember power efficiency: less parts less power consumption).
    A1) Here is not so easy: the first answer is no. Now since the 485 line is isolated it means that you will have two distinct grounds the inner (gnd1) and the outer/isolated (gnd2). The shield can connect to gnd2 or to transformer center. In every way it is good norm to foresee a resistor in the path from schield connection and gnd/tf-center: if·not need you solder-bridge it (this, depend on the application, prevent high current flows along the shield between nodes on different potential).·With the shield on the transformer center, with some additional components, it allows for short detection between the shield and one of the signal lines (btw it is possible to predict at which distance from the diagnosing device the short is). Eventual bias resistors should be Vcc2/Gnd2 powered. Now for the auto-termination/bias you should use a small signal relay: the contact/s will enable·the resistor/s while the coil will be safely driven by the prop (a suggestion here due to power efficiency is to use a set/reset relay so you not waste current all the time, just on switching operation). To inform the prop you will need an optocoupler: led driven by Vcc2/Gnd2+plug_bridge, the transistor will safely report the state to the prop
    Now the question is if the self-built supply isolation (MAX3535ECWI oscillator with external transformer) is capable to supply all this things: some math is needed. Any way you can connect to Vcc2/Gnd2 an your-made isolated supply voltage without connecting the transformer to the MAX3535ECWI. This will open the the possibility for other isolated 485 drivers where usually you must provide both: the logic/internal power supply and the isolated/external one.

    Try to utilize the double functionality of /RE. For power savings on slow data rates and if your project budget can afford to, it will be nice to drive also /SLO by a set/reset signal relay (remember isolation)

    Post Edited (dMajo) : 2/26/2009 9:04:46 PM GMT
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2009-02-26 23:28
    dMajo - thank you for taking the time to write all this down and answer David's questions. Man - this is good learning stuff here. I need to study this thread more.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto for SunSPOT, BitScope
    www.tdswieter.com
  • DavidMDavidM Posts: 630
    edited 2009-02-27 00:22
    Hi, dMajo

    Thanks again for more info.

    regarding your comments...

    POWER SUPPLY
    I have a switching regulator already with 1.5 amps of power at 5V ( LM2595T-5.0), I have plenty of power! and The device when operated will not run out of juice as it it used only for short periods of time, well within the capabilities of my battery.

    RX & TX LEDS.
    My LEDS will be placed on a MEMBRANE OVERLAY PANEL, so these are usually higher amperage( for brightness), Plus they need to be pretty BRIGHT so that short transmissions are seen. Also re my mosfet to drive these. I am already using this idea elsewhere and it works really well, as I said before the use of a mosfet (ZVN2106A) will ensure low current consumption of the RX & TX Lines as well as driving much brighter LEDS.

    SIGNAL GROUND/SHIELDING
    Ok, we aggree that the shield of the cable should be connected to the SIGNAL GROUND , But you have mentioned that a resistor maybe required? I was under the impression that the DRIVER handles SHORT CIRCUITS? If a resistor is required what value would this be?

    TERMINATING RESISTOR
    You now say to use a SMALL SIGNAL RELAY. For my applications I cannot use relays!, But I think you mentioned that a ANALOG SWITCH would work. I will be controlling the analog switch via some logic gates. The logic gates and the analog switch will be on the OUTPUT CIRCUIT, But I will need to bring back a logic signal to the prop to tell it that the TERMINATING RESISTOR has been activated, So I guess the use of an OPTO-COUPLER here ( between the LOGIC GATE and the PROP) is necessary for isolation.

    BIAS RESISTORS
    Are you saying I still need these??

    Thanks

    Dave M
  • dMajodMajo Posts: 855
    edited 2009-02-27 19:10
    DavidM said...
    SIGNAL GROUND/SHIELDING
    Ok, we aggree that the shield of the cable should be connected to the SIGNAL GROUND , But you have mentioned that a resistor maybe required? I was under the impression that the DRIVER handles SHORT CIRCUITS? If a resistor is required what value would this be?
    AN10658 Sending I2C-bus signals via long communications cables·(post edited) This is regarding the I2C bus but on chapter 4 is well explained what happens (generally) on long communication lines

    Yes, the driver handles shorts. But what happens if, with the shield (low-ohm), you connect two GNDs together and there is lets say 5v potential difference between them? Which is the current flowing in the shield? Now, usually there is no need, but having a place for a smd resistor on pcb that you can bridge with a drop of solder, can spare time in eventually cut traces and find a way to insert one.
    DavidM said...
    TERMINATING RESISTOR
    You now say to use a SMALL SIGNAL RELAY. For my applications I cannot use relays!, But I think you mentioned that a ANALOG SWITCH would work. I will be controlling the analog switch via some logic gates. The logic gates and the analog switch will be on the OUTPUT CIRCUIT, But I will need to bring back a logic signal to the prop to tell it that the TERMINATING RESISTOR has been activated, So I guess the use of an OPTO-COUPLER here ( between the LOGIC GATE and the PROP) is necessary for isolation.
    With a signal relay is meybe easier schematic/implementation. Also an analog switch like this or this will do the job but it must be powered by Vcc2/Gnd2 connections and the logic drivers (the INx pins that drive the contact closure) must be optocoupled to the prop. This means that with Vcc2/Gnd2 (the power derived through the MAX3535ECWI oscillator and external transformer) you will supply the MAX3535ECWI internal receiver and transmiter, the analog switch-ic and the transistor side of optocouplers (driving INx pins) with eventually needed resistors (pullup/pulldown): will it be enough?
    DavidM said...
    BIAS RESISTORS
    Are you saying I still need these??
    No as long as all the nodes are "failsafe". But if you want to link on bus someone others node, than you do not know if his line driver is also "failsafe" One option is to have them and keep them disconnected until not needed. Like for the shield resistor having the place on pcb and not soldering the components will make your pcb design/project a one-time-for-always. Consider that on low quantity productions/prototypes the pcb cost is more relevant·on the overall project cost, so having one made for several applications/conditions, will lower the cost (at least in the future when you could reuse it for an other design)


    ·
  • DavidMDavidM Posts: 630
    edited 2009-02-28 06:40
    OK,

    Based on further reading of this thread I have UPDATED my schematic ( its very different to the original)

    I have incuded a BILL OF MATERIALS for the critcal components but these need reviewing.
    I have added a table to show how I want the connectors to behave.

    The MAX3535 chip was not in the eagle cad library so I had to draw up a fake one.

    Any comments welcome.

    regards

    Dave M
  • DavidMDavidM Posts: 630
    edited 2009-03-01 01:28
    HI

    I have updated the schematic,

    The 2nd XOR Gate should be a AND Gate instead.

    regards


    Dave M
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2009-03-01 01:58
    Your schematic is interesting to dissect. I can't comment much on the technical side of isolation as I mentioned before, but I always learn from seeing and reading this.

    So, if I get this straight, the way you are able to do the auto detection is because you have the shield on two pins of the connector. When the connector is plugged in then the shield is grounded. This means the shield will be grounded at every node, right? I know for a DMX-512A system that one isn't suppose to ground the shield at each node because of the potential for ground loops. In your application though you are using batteries so the ground loop idea is out. Then again, I guess the ground loop idea would be out because it is isolated from the rest of the circuitry too. Am I right in my thinking/understanding?

    I like the way the Tx/Rx LED work, I didn't notice this before. Have you done something similar in the past with LEDs/mosfets wired like this? Does it work OK?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto for SunSPOT, BitScope
    www.tdswieter.com
  • DavidMDavidM Posts: 630
    edited 2009-03-01 03:09
    HI Tim

    Re LED/MOSFETS,

    Yes, I use this idea on another device and it works VERY WELL, I was interfacing a AEROCOMM AC4490 Transceiver and if I hooked up LED's directly ( in line) they would not allow the transceiver to work, I assume a difference in voltage/current?? requirements of the LED's, So by using the mosfets they "TAKE" very little away from the RX & TX Lines, but then you can run the LED much brighter from say 3.3v or even 5V, Also you can change the mosfets to P channel if you are dealing with inverted RX & TX lines which the aerocomm device has I believe.


    RE: ISOLATION
    You need an isolated power supply and any signals that go to or from the Transceiver to say a micro-controller. Notice that there is no isolation from the MAX3535E device to the PROP, this is because this device has built in ISOLATION for logic and a build in switching regulator for power, but the power INTO the device needs to have and ISOLATED connection. that's the reason for the transformer. I hope that the other logic devices on my ISOLATED side have enough power , I need to check this as I assume its all 5V, I could add a small 3.3v regulator if need be.

    Keep in mind I am still learning this as we speak! The BOOK "SERIAL PORT COMPLETE" has a lot of info regarding RS485. MAXIM has lots of good articles on RS485 as dMajo has shown me.

    RE- AUTO DETECT,
    Nearly all RS485 network installations are fixed and mostly permanent and use TERMINAL CONNECTORS and are installed/configured by knowledgeable persons,
    I need "AUTO EVERYTHING" so that my devices can be set-up in no time and temporary and by people how no nothing about the protocol used, say like for live music/shows etc , so I can see your interest as you use DMX. (By the way I need to add DMX capability to another device later.)
    My devices are also used in HARSH environments, i.e dust, rain, moister etc that's the reason i selected IP68 connectors. At first I was just going to use 2 pin connectors, but these EN3 connectors are available in 2 to 8 pin configurations in panel mount , PCB mount and cable mount.

    The reason I use 4pins and not say three pins is that there is NO SHEILDING for these connectors so I need a way for the CONTACT to be made.
    So If a connector is pluged in it makes contact with the ground and is shared by all other connected devices.
    It also pulls low the logic to drive the terminating switch. have a look at the table for connectors ( top right) in my latest schematic and by adding the AND GATE I can tell the PROPELLER that this "NODE" should be a MASTER or SLAVE based on the combination on connectors.

    The other advantage of the connectors is that you cannot make a mistake in the connections.

    But Just Remember I have not tested this schematic yet!
    regards


    Dave M
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2009-03-01 11:00
    Thanks Dave - I follow you on everything. I took a second look at the schematic for the LEDs/MOSFETs and something seems backwards there - or maybe I need to learn something. To me the LEDs and positive voltage should be switched on the source/drain of the MOSFET. Or maybe I just need to sketch out the schematic in a different way to see that it is correct.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto for SunSPOT, BitScope
    www.tdswieter.com
  • DavidMDavidM Posts: 630
    edited 2009-03-01 12:12
    Hi Tim,

    I could have these around the wrong way, calling the input and the output of a mosfet DRAIN or SOURCE is confusing, why not just stick with positive and negative?? to me this is just engineers showing off. RANT HERE ....Also every explanation of mosfets goes on about the material its made from, Who cares, just tell me how to USE it and how to CONNECT it.smile.gif

    I guess DRAIN is where you stick the device you want to drive ( NEGATIVE?) ( the load?)
    and SOURCE is where the power comes from POSITIVE??

    Also, my understanding of mosfets is ( please help out)

    N Channel means its normally off when the gate is LOW??
    P channel means the the mosfet is ON when the gate is LOW??
    A mosfet behave more like a ON/OFF SWITCH
    A transistor behaves more like VARIABLE SWITCH

    but then again what would I know smile.gif

    I was under the impression you just follow the arrow on the mosfet symbol, I will have to read up on the basics again for this device.

    if know of a good website that explains mosfets SIMPLY then please let me know.

    thanks

    Dave M
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2009-03-01 12:53
    MOSFETs are good on/off controls and transistors are too when saturated, but they also have other uses like amplification. N-channel MOSFETs are normally off when the gate is low and N-ch are used to sink current. Usually the P-ch are the opposite and source current. I admit, I am an EE and I get my drain/source mixed up too - but that is because I don't use them much, only in the past year have I gotten back into circuit design and I love it, but I need to keep doing this to get my skill back up to snuff.

    So, if you are going to use N-ch, then the positive voltage should be at the anode of the LED (or the resistor). The cathode of the LED should go into the drain of the N-ch MOSFET. The gnd should be at the source of the MOSFET. The arrow of the MOSFET says if it is an N-ch or P-ch.

    I don't have a good web site source off hand.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto for SunSPOT, BitScope
    www.tdswieter.com
  • DavidMDavidM Posts: 630
    edited 2009-03-01 12:58
    HI Tim,

    after watching this youtube video I was wrong!



    The SOURCE of the mosfet connects to GROUND ??
    The DRAIN connects to the NEGATIVE of the device you want to drive.

    So whats with the arrow in the mosfet symbol? no wonder I am confused..

    I have updated my schematic.. for the mosfet & I changed the way the OPTO COUPLER was connected and also there was no 5v connection made to the driver!

    Regards

    Dave M
  • DavidMDavidM Posts: 630
    edited 2009-03-02 09:12
    Ok,

    I have revised my OPTO-COUPLER circuit, and also the AND gate is now a NAND gate, so i get a HIGH for MASTER

    I DO need some help with the IC selections I have made, are they the correct types? i.e LOGIC CONTROLLED

    regards

    Dave M
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2009-03-02 11:13
    The MOSFET/LED section mostly makes sense to me now, however why eliminate the current limiting resistors for the LEDs?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto for SunSPOT, BitScope
    www.tdswieter.com
  • DavidMDavidM Posts: 630
    edited 2009-03-02 12:33
    HI Tim,

    The leds are never ON long enough! The data i send is very small and always send and receive a few bytes at a time.

    I have tried with resistors and depending on the led, sometimes you can hardly see them turn on, but that was running at 3.3 volts. if you run at 5v you could put resistors in and the "tweek" the values to get the leds to be of the same brightness, assuming two different colours.

    What do you think of my OPTO-COUPLER set-up, Will it work?


    regards

    Dave M
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2009-03-02 12:43
    I have had limited experience with opto-couplers, but I think what you have will work. When the LED is off, the output is also off. The output is pulled high with a 10K and the 1K protects the Propeller. Then, when the LED of the opto-coupler is on, it turns on the output and the current flows through the opto-coupler. The Propeller input should then be low. That particular circuit should be easy to breadboard/prototype to be sure it works as intended.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto for SunSPOT, BitScope
    www.tdswieter.com
  • DavidMDavidM Posts: 630
    edited 2009-03-02 13:02
    Thanks Tim,

    will the logic output from the NAND Gate be enough to turn on the led of the opto-coupler, or do I need/ or is there such a thing as /a logic input opto-coupler?

    Thanks
    Dave M
  • dMajodMajo Posts: 855
    edited 2009-03-02 20:38
    DavidM said...
    Ok,

    I have revised my OPTO-COUPLER circuit, and also the AND gate is now a NAND gate, so i get a HIGH for MASTER

    I DO need some help with the IC selections I have made, are they the correct types? i.e LOGIC CONTROLLED

    regards

    Dave M
    Sorry, but I am ill and I spent the weekend in bed

    Now some notes:
    1. First it seems to me you have confused the wirings to the max (exchanged DI with RO1)
    2. RX and TX leds have missing series resistor
    3. The termination resistor is 120 ohm NOT 120Kohm
    4. The analog switch states for Vcc AbsMax 6.5V and RecMax. 5.5V while the MAX3535ECWI Vcc2 max 7.5V: The Vcc2 you are using to supply ext.logic is unregulated (the max have internal regulator between Vcc2/Gnd2 and internal logic) so you must assume the max value. Try something like this or this·or similar. The same consideration is for other logic supply.
    5. Regarding the logic ports: the simbol for xor is wrong, your objective is not clear (what do you want to accomplish?)
      1. The pull-up system on the xor inputs won't work: R3/R7 should be 100/1000 ohm. When the connector is unplugged the input will see Vcc2(logic one)·through R1/R6 resistor. When plugged the input will see V=Vcc2/(R1+R3+R4)*(R3+R)· => 5V/14k8*10k1=3.4V => too high to be logic zero: with R3=R7=1k 5v/5k8*1k1=0.95V with R3=R7=100 5V/4k9*0k2=0.2V
      2. Now with one plug inserted the termination will be active. With both or none of the plugs inserted it will be disactive.
      3. The OK1 led (again missing series resistor) will be·OFF when J2 plugged and J3 unplugged. In all other situations the led is ON
      4. The X-OR pinout on your schematic is wrong
    DavidM said...
    The leds are never ON long enough! The data i send is very small and always send and receive a few bytes at a time.

    I have tried with resistors and depending on the led, sometimes you can hardly see them turn on, but that was running at 3.3 volts. if you run at 5v you could put resistors in and the "tweek" the values to get the leds to be of the same brightness, assuming two different colours.
    You always need resistor on led (also on optocoupler): RLED = (VCC - VLED - VDS_SAT(Drain-Source saturation voltage))/ILED.
    DavidM said...
    will the logic output from the NAND Gate be enough to turn on the led of the opto-coupler, or do I need/ or is there such a thing as /a logic input opto-coupler?

    After some mods:
    1. By using both the x-or gates (no need for nand) you will have P24(MasterDetect) high when J2 is plugged in and low when unconnected. If you want it·for J3 than just wire pin 6 to pin 2 instead of 1. This xor is capable (25mA sink/source) to drive the optocoupler led [noparse][[/noparse]PostEdit] Sorry I have seen now your B revision (regarding second xor/nand): you should explain what you want from "MasterDetect" to be reported to·you
    2. Use a small jumper (remember the 100 ohm shield resistor) for SLO. When·you need high speeds you need to leave it floating. It can be a solder bridge.
    3. By applying in parallel to the led a small capacitor you will increase the light-time. When doing that for both the mosfets you can consider a decoupling cap near their power supply (the same you usually do for ICs)

    Post Edited (dMajo) : 3/2/2009 8:51:13 PM GMT
    1680 x 1050 - 228K
  • DavidMDavidM Posts: 630
    edited 2009-03-02 22:30
    Hi dMajo,

    I hope your are feeling better!

    Again THANK YOU SO MUCH for an EXCELLENT reply!
    I will study your comments and suggestions and make the changes to the schematic and post it in the next couple of days.
    I guess I owe you some FINISHED BOARDS when i get this job done!


    regards


    Dave M
  • dMajodMajo Posts: 855
    edited 2009-03-03 20:16
    Hi DavidM, one thing more:

    try to keep the MAX RE and DE signals separate if you can afford a pin more. RE have double function: as input will enable the receiver, as output it will report faults. If actually you do not need this, you can just drive them together (in parallel) with software.

    Even if the line driver haven't a hardware fault indicator (like MAX with RE) with this configuration you can do loopback (by enabling both them together, during transmission) and you will receive back what you have sent: if the information is different there is a short/malfunction on the bus

    Note also that with no connection on A+Y and B+Z and by adding just a second termination between Y-Z (of course you will need a connector with more pins) you have a RS422 or full-duplex 485. If the connectors are not on the pcb there is no reason to not add two more pins on pcb header and layout the second termination (an.sw+120R: that will not be mounted for half-duplex purposes). The AY and BZ connections will be made in the path between the header and the chassy connector (let's say on the header male)

    Cheers
Sign In or Register to comment.