I am trying to create a modular system that uses UART to broadcast the same data to each microcontroller that gets added to the system. It could have 3 or it could have 10 modules added to the system.

Each PCB module is separated by no more than 1 inch of space (i.e most of the trace length will be running on PCB, the 1 inch is just the jack to make the connection from one PCB to the other). The total length of the system would be about 6ft.

What signal protocol would you suggest that could easily be designed onto a PCB system that is modular? RS485 uses twisted pair, which would be difficult to achieve on a PCB from what I can tell. I was considering hooking up all the Rx's of the "slave" microcontrollers to the Tx of the "master" microcontroller. This would allow instantaneous transmission to all of the slave microcontrollers as needed. I do not intend to use UART to communicate back.

What things should I consider in the design? Could one microcontroller output handle the inputs of up to 10-15 microcontrollers? Will I need to add signal boosters?

It is important to clarify that these devices will be modular, so virtually identical. I can't have some components on boards 5-6 that aren't on boards 7-8 for example. The speed I hope to transmit at is ideally 1Mbps.

  • 1
    \$\begingroup\$ That seems like a lot to expect form a UART. Does it have to be a UART? A more advanced, but also much higher speed, solution would be Ethernet (100 Meg. might be more than enough, but you could even do 1 Gig. easily enough) using UDP broadcast to send from one-to-all. \$\endgroup\$ – manassehkatz-Moving 2 Codidact Aug 8 '18 at 1:56
  • \$\begingroup\$ Unfortunately I do not have Ethernet. I have CAN, UART, SPI, I2C, and USB \$\endgroup\$ – phivms Aug 8 '18 at 3:11
  • \$\begingroup\$ Comments are not for extended discussion; this conversation has been moved to chat. \$\endgroup\$ – clabacchio Aug 9 '18 at 10:10

Could one microcontroller output handle the inputs of up to 10-15 microcontrollers?

The GPIO pins are CMOS, so they can handle many more than that, in terms of fan out. In fact, it is more than you can get from standard 1 unit load RS485 transceiver.

At 1Mbps however, the capacitance of the line comes into play, so a lot depends on the connectors you use.

RS485 uses twisted pair which would be difficult to achieve on a PCB from what I can tell

Running traces on PCB parallel to each other would pretty much have the same effect as twisting wires.

This would allow instantaneous transmission to all of the slave microcontrollers as needed.

Here comes the $100 question: what is "instantaneous" to you?

The simplest solution in your case would be to add a tiny schmitt buffer like SN74LVC1G17 at the output connector of each module. Then you can daisy chain your modules practically indefinitely.

The catch, however, in propagation delay, which for the chip above is about 3 ns. So, for the chain of 10 modules you are looking at 30 ns delay between first and last module. If this is instantaneous enough then just go ahead with UART and don't bother with transceivers or multiple wires.

Another catch is that your master module must be located at the beginning of the chain. If this is not convenient, you can put the buffer between Tx and pass-through line. It has 24 mA driving capability and only 4 ns propagation delay into 50 pF load. This should be sufficient for 6 ft line with 10 connectors.

BTW, differential buses have similar issue - you have to add termination resistors to each module but only activate them at the ends. Which means you have to keep an eye at each module placement anyway. Might as well keep an eye on one module instead of two.

| improve this answer | |
  • \$\begingroup\$ That is an acceptable level of instantaneous. 60x the speed a human can recognize is essentially at minimum. So what you are recommending is just a simple buffer to boost the signal on each module and stick with the simple Tx to Rx configuration. The Master will always be at the beginning of the chain. This will be determined by a switch that determines if it is a master or a slave by the user. \$\endgroup\$ – phivms Aug 9 '18 at 0:09
  • \$\begingroup\$ Yes, that's the idea. I don't see why you'd need the switch, though, since the software on the master will be different from the slaves. If both Tx and Rx connected to the line it is up to software which one to use. \$\endgroup\$ – Maple Aug 9 '18 at 0:58
  • \$\begingroup\$ Ahh I didn't Consider that. Ill keep that in mind. Thanks! \$\endgroup\$ – phivms Aug 9 '18 at 1:24

With a signal path length of 6ft, transmission line effects may well come into play (reflections and ringing causing overshoot and undershoot at devices which can lead to reliability issues or even damage). From this article: A common rule of thumb is that the cable or wire should be treated as a transmission line if the length is greater than 1/10 of the wavelength.

I would go for RS485. It's well suited to the distance and data rate in this case, and will minimise EMI issues when compared with single ended signalling. You can achieve the required impedance by routing the two signals as a differential pair. Electrically this is very similar to a twisted pair cable and will work just as well. There are multiple online calculators to help you set the width and spacing of your board traces for a given impedance.

Route the pair from a pair of connector pins to the receiver, then back again to a different pair of pins, so that each plug in board has both serial in and serial out. The system backplane/interconnect should connect the output from one board to the in of the next to form a nice straight electrical path with no stubs (impedance discontinuities). You'll need a termination resistor at the end of the line. You could move the master anywhere in this topology; in the middle would work fine - but remember you'll need a termination resistor at both ends in this case.

| improve this answer | |
  • \$\begingroup\$ It is a good idea to actually understand what you are quoting. Just FYI, the wavelength @1Mhz is over 250m \$\endgroup\$ – Maple Aug 8 '18 at 17:29
  • \$\begingroup\$ I agree, so it's just as well that I do. Do you? We're not talking about a 1MHz sinewave.The wavelength is related to the edge rate of the driver (which is really quite fast for LVC logic). This led to all sorts of problems in the early 90s as CMOS chips got faster and regular PCB traces were electrically long enough to result in significant reflections. Intel among many others started writing papers on the issue to help people design reliable boards as their CPUs went past 33MHz bus speeds. I read one while designing a board around their 50MHz i860XP. Traces of a few inches could cause issues \$\endgroup\$ – amb Aug 8 '18 at 18:40
  • \$\begingroup\$ Touché. Still, RS485 is serious overkill for this application. There is huge difference between 6 ft and 1 km, as well as between 1 and 50 Mhz \$\endgroup\$ – Maple Aug 8 '18 at 19:04
  • \$\begingroup\$ The ground level could vary quite a bit across a 6ft backplane (or whatever) which will hit noise margins at the far end for single ended. Depends on power distribution. I would prefer not to worry about it and RS485 buffers can be quite cheap/simple…? Regarding reflections, I have checked my gut instinct: CPU is a PIC32MK0512GPD100, max cap load = 50pF => output fall time = 8ns max. IIRC a 1ns fall time corresponds roughly to a 200MHz fundamental, so here our fundamental is 200/8 = 25MHz min. So electrical wavelength is roughly 10ft, signal path is 6ft, threshold for TL effects is 1ft. \$\endgroup\$ – amb Aug 8 '18 at 19:24
  • \$\begingroup\$ Frankly, I don't understand what all these calculations have to do with a choice between single-ended and differential signalling \$\endgroup\$ – Maple Aug 8 '18 at 20:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.