Signal integrity between boards question - Page 1
Forum section: electronics / beginners

author: rrinker
author_rank: Super Contributor
timestamp: December 31, 2018, 07:11:42 am
content: Probably a stupid one, but here goes.I have 2 projects that work together. Each contains a microcontroller. My original plan had 4 IO lines from one micro connecting over a relatively short distance to pins on the other board (with protection and pullup resistors and capacitors), say 99% of the time less than 1 meter. For simplicity I was going to use RJ45 connectors and UTP cable. 4 signals, pair each with a common so I'd have the common reference between boards as well as the signal. I didn't see any problem doing this. But a design change has me now needing SIX signals between boards. All signals are straight digital signals, either high or low, no analog here. I'm thinking pairing 2 unrelated, or even related, signals, where they both could be high, both be low, or be opposite one another, is such a good idea. Should I find a different way to do the interconnect, maybe a pair of 6p6c RJ12 and continue the signal paired with a ground approach, or maybe just use flat 8 conductor cable instead of twisted pairs> This is also not high frequency - if the signal state changes more than once per minute it would be a lot.What says the collective wisdom of the EEVBlog? Besides "What is this guy thinking?"Perhaps I should have laid off the iced tea and just sleep on it (it's after 2am here) and see if I can remember why I should do one thing or the other.

author: xyrtek
author_rank: Regular Contributor
timestamp: December 31, 2018, 07:18:20 am
content: Google differential bus transceiver, so many options you probably have some on hand

author: tggzzz
author_rank: Super Contributor
timestamp: December 31, 2018, 10:37:31 am
content: Quote from: rrinker on December 31, 2018, 07:11:42 amThose are three misapprehsions...It isn't a stupid question.Those signalsare analogue; photon counting and femtoamp circuits are the "common" digital signals. What you have is analogue signals that areinterpretedby the receiver and classified as 0 or 1 or something else. Ensuring the "something else" doesn't occur is what "signal integrity" is all about.Whether or not it is "high frequency" doesn't depend on the number of transitions per second. Theonlything that matters is the transition time, which is dictated by the transmitter logic family. If the transmitter is 74LVC1G* family, then your signal will have components above 1GHz. For experimental illustration of the theory, seehttps://entertaininghacks.wordpress.com/2018/05/08/digital-signal-integrity-and-bandwidth-signals-risetime-is-important-period-is-irrelevant/

author: Lusu
author_rank: Contributor
timestamp: December 31, 2018, 11:59:58 am
content: Since you do work with 2 micros... can't you use UART (serial), IIC or SPI to send the data? This way, for serial or IIC you need to transfer just 2 pairs (+GND and +VCC if needed):TX or SDA + GND on Orange/Orange-White (pins 1 and 2)RX or SCL + GND on Green/Green+White (pins 3 and 6)leaving pins 7 and 8 free for "PoE" (7 GND and 8 VCC)and 4 and 5 for whatever else you need(I yould use this configuration on pins instead of 1-2, 3-4 etc. because if someone plugs it by mistake in a switch/router -- because it is an "ethernet cable", nothing bad should happen)If you use differential bus drivers, then you don't have GND on the first 2 pairs, but you can still transfer it on pin 7.Edit:https://incentre.net/ethernet-cable-color-coding-diagram/, I usually use TIA/EIA 568-B standard

author: rrinker
author_rank: Super Contributor
timestamp: December 31, 2018, 08:27:32 pm
content: To clarify what I am doing, this is all model railroad related.The one board, call that A, is effectively this:http://www.modelrailroadcontrolsystems.com/cpnode-version-2-5/although I am building my own using an ATMega328p, not sticking an Arduino of some sort on it.The second board, call that one B, is one I posted some time ago, which drives some servos. It too uses an ATMega328p.B has 4 inputs, driven by outputs from A. Set position of servo 1, set position of servo 2, lockout of the local buttons for servo 1, and lockout of the pushbuttons for servo 2.B has 2 outputs that will drive inputs of A. Position of servo 1 and position of servo 2.There's a reason i want to stay away form multiplexers and other such things - board A is a general purpose IO board, exposing multiple IO pins (my version adds some MCP23S17 port expanders), A given board A may control 4 or 5 board Bs. As well as receive inputs from other sensor devices to detect track occupancy, and also drive LEDs that will be located in signals along the track. Board A has no logic - all it does is sent and receive the status of each input or output byte by byte back to the controlling computer program via RS485. The idea is to configure every board identically - address on the bus for the board As will be set by jumpers. Any board should be completely interchangeable, no custom code. This has already been done with the CMRI system which I am for the most part emulating, but frankly the existing hardware is much too expensive per IO pin, compared to what can be done with small micros and port expanders, combined with the low cost of getting PCBs from places like JLCPCB and PCBWay, which is why I am going the DIY route.The use of RJ45 to interconnect A and B is not set it stone, I haven't laid out the PCB yet. I am using RJ45 and UTP to connect the pushbutton and LED panels - since there are 4 lines needed for each I can pair each with a ground. Most CMRI installations just use screw terminals and individual wires to link input sensors and output devices to the IO boards, so I have no problem doing that. When I only had 4 lines, all going the same direction, to worry about, the RJ45 approach seemed the easiest and neatest, in all cases respecting the standard ethernet pinouts to pair a signal with a ground, since a common reference between boards is needed anyway. The board A end of these cables was just going to be stripped out to wires anyway. Or use RJ45's for groups of 4 - another IO device I previous contemplated using use RJ12 for each group of 4 IO bits plus a +5 and ground.

author: rstofer
author_rank: Super Contributor
timestamp: December 31, 2018, 08:56:36 pm
content: I would probably use a flat cable. I might make every other wire a signal GND. For 6 signals, I would move to a 14 wire flat cable or maybe 16 wire.You're not in a hurry for the signals to get from board to board and the input pins will have some hysteresis if not Schmitt Triggers and the distance isn't far enough to worry about. Any type of cable will probably work fine.I'm not much on the telephone connectors.I would seriously consider building all the boards with RS485 and not daisy-chaining boards together. I see where that isn't feasible with pre-manufactured boards.I just like the multimaster ROBIN protocol:http://www.bdmicro.com/code/robin/

author: rrinker
author_rank: Super Contributor
timestamp: January 01, 2019, 03:43:16 am
content: The CMRI protocol is even simpler - it only has 4 message types (it's a polled system rather than multi-master). I'm actually simplifying it even more - one of the commands is a setup which allows the remote boards to tell the master how many bits of input and how many bits of output they have. But I'm writing the code so that the master always sends a certain number of bytes, and the slaves always report the same number of bytes, even if there aren't that many physical IO pins. Say a board only has a pair of 23S17s hooked up for output. so 32 bits of output. Only the first 4 bytes sent will count, the others will simply be ignored, and ever node gets sent 8 bytes for output One thing that does, besides simplifying the program on the master side, is make the transfer time for every board equal. Always receives 64 bits, always sends 32 bits, or some number yet to be determined.The servo drivers though are not part of the network, they connect to the node boards. They have pushbuttons and LEDs for local control, plus the lines for connection to the node boards for remote control. Thus the same servo driver board can work for mainline dispatcher controlled turnouts as well as purely manual ones like in a yard.My reasoning behind going with phone connections for all of this stuff is that the current is very low, they are easy to connect together even in the dark recesses under the layout, they aren't going to be constantly plugged and unplugged (a major weakness of RJ connectors), and I have the proper crimp tool for anything from 4p2c up to 8p8c already since my DCC system already uses 6 conductor flat cable for its control bus.The node boards ARE linked via RS485, no daisy chaining. The commercial board I linked does the same thing, as to the boards designed by the guy who originated the protocol and system. The vendor I linked provides an Arduino library for CMRI that is open source, so that is the basis for my code. I'm prototyping with Arduinos, but my real boards hard wire in an ATMega328p, instead of making a larger board that plugs in to an Arduino, or allows an Arduino to plug in, like the commercial one I linked. I considered other Atmel micros because I could use a smaller chip and make each servo driver just run a single servo, but as is usual with these things, the larger chip with enough pins to do everything for 2 servos is less than twice the cost. Making boards the drive 4 or more servos defeats my distributed architecture desire, where I'd end up having one monster board that would drive say 8 servos, and servo cabled going everywhere. 2 seemed like a good number, because that means one board for a crossover, or a passing siding.