Using the SN75176A in NeoPixel & Other Applications
I have received many great comments and emails regarding my post on Driving WS2812/NeoPixels RGB LEDS over CAT5 Ethernet Cable, and it is in fact one of my most popular posts. A few people have requested that I go into a bit more detail on how the SN75176A chip is used in this application, so in this post I will explain a bit more detail about using this device.
The SN75176A is a Differential Bus Transceiver, which means that it is used to convert back and forth between a normal "single-ended" signal on one side and a "differential signal" on the other. There is a good Wikipedia article that goes into great detail on the benefits of differential signaling, but the quick overview is that it provides lower signal degradation and better noise immunity than single-ended signaling, allowing us to send our NeoPixel data over much longer distances.
There seems to be a bit of confusion with some readers regarding the SN75176A's ability to be used for both to sending and receiving differential signals, so let's see if we can clear things up a bit. This device contains both a single-ended to differential "transmitter" and a differential to single-ended "receiver". Depending on how a couple of control lines on the device are set, we can enable one or both components as needed. The following diagram shows how things are hooked up inside the chip:
The "A" and "B" pins are the differential signal lines which are connected to the long run of cable between devices. The "D" pin is used to send data on the differential pins and the "R" pin has the received data from the differential lines. Finally, the "RE" and "DE" pins are inputs to the device that enable the receiver and/or transmitter, respectively. Notice the "bar" over the RE, indicating that it is "active-low", meaning the a low input enables the receiver and a high input disables it.
If you want to configure the device as a transmitter, you would connect both the RE and DE pins to VCC – this disables the receiver and enables the transmitter so that any data applied to the D line is sent to the differential outputs on A and B. Now if you want to configure the device as a receiver, you would connect the RE and DE pins to ground, disabling the transmitter and enabling the receiver so that data received on the A and B pins is converted to a single-ended signal on the R pin.
You may be wondering what happens if the RE and DE signals are not tied to the same high/low levels. If you connect the RE low and the DE high, both the transmitter and receiver are enabled, and any data sent out using the D pin is "looped-back" or echoed on the "R" pin. This can be useful in some configurations to confirm data being sent or to detect collisions with other transmitters on the differential lines. The other configuration is when the RE pin is high and the DE pin is low. In this configuration, both the transmitter and receiver are disabled, effectively preventing data from being sent or received on the differential pins.
Now it's not needed in my NeoPixel application because data is always flowing in the same direction, but if you needed to both send and receive data over the differential pins, you could connect the RE and DE lines to your microcontroller, allowing it to select the data direction, either transmitting or receiving as needed. Notice that even though you can enable both the transmitter and receiver at the same time, you are not able to send and receive data between two such devices at the same time, as only one device at a time can be in transmit mode, otherwise the data gets corrupted (just like two or more people talking at the same time makes it difficult to understand what anyone is saying).
Hopefully this explanation will help out some of you that have been looking to tweak or modify the circuit in my long-distance NeoPixel post, or just give you a better understanding of how the design works, and maybe inspire you to try applying this idea in your own design. Also, thanks to Leo B. for prompting me to finally get around to writing this post! Read More......