Post History
Since the guaranteed logic high threshold is 1.6 V, passively pulling the line to 3.3 V will be fine. Unless you are operating from batteries or every mW otherwise matters, I would use a pullup to...
#2: Post edited
- Since the guaranteed logic high threshold is 1.6 V, passively pulling the line to 3.3 V will be fine. Unless you are operating from batteries or every mW otherwise matters, I would use a pullup towards the low end of the range since you are operating with less voltage margin than at 5 V.
- With a pullup to 3.3 V, you should be able to connect the DCDI line directly to the microcontroller RX input.
- The micro's TX line can't be directly connected if it actively drives in both directions. Some micros can route peripheral signals to different pins and can disable the high side driver. In that case you can connect the DCDI line to both the RX and TX pins directly.
- If the micro can't be configured to only drive TX low, then you have to add external circuitry to achieve that. The simplest would be a Schottky diode in series. Check the TX line maximum possible logic low, add the diode drop to that, and make sure the result is still solidly below the 1.0 V threshold. If that doesn't work out, you can use transistors:
- <img src="https://electrical.codidact.com/uploads/tkgxo5qg22nwgiy8mi1t83smb0ls">
- Something like this also necessary if the TX line can't sink enough current to solidly overcome the pullup. The values in this circuit are adjusted so that even with only a gain of 20 for Q2, it can still sink 13 mA. That times the worst case pullup of 433 Ω is 5.7 V, which is more than the voltage across the pullup can ever be.
- Another advantage of this circuit is that the TX pin only needs to sink 260 µA, compared to the 7.6 mA required to drive low against a 433 Ω pullup.
If you can arrange the RX input of the micro to be 5 V tolerant, then you can pull DCDI to 5 V for greater noise immunity. The circuit above will still work without modification for driving DCDI from the TX pin.
- Since the guaranteed logic high threshold is 1.6 V, passively pulling the line to 3.3 V will be fine. Unless you are operating from batteries or every mW otherwise matters, I would use a pullup towards the low end of the range since you are operating with less voltage margin than at 5 V.
- With a pullup to 3.3 V, you should be able to connect the DCDI line directly to the microcontroller RX input.
- The micro's TX line can't be directly connected if it actively drives in both directions. Some micros can route peripheral signals to different pins and can disable the high side driver. In that case you can connect the DCDI line to both the RX and TX pins directly.
- If the micro can't be configured to only drive TX low, then you have to add external circuitry to achieve that. The simplest would be a Schottky diode in series. Check the TX line maximum possible logic low, add the diode drop to that, and make sure the result is still solidly below the 1.0 V threshold. If that doesn't work out, you can use transistors:
- <img src="https://electrical.codidact.com/uploads/tkgxo5qg22nwgiy8mi1t83smb0ls">
- Something like this also necessary if the TX line can't sink enough current to solidly overcome the pullup. The values in this circuit are adjusted so that even with only a gain of 20 for Q2, it can still sink 13 mA. That times the worst case pullup of 433 Ω is 5.7 V, which is more than the voltage across the pullup can ever be.
- Another advantage of this circuit is that the TX pin only needs to sink 260 µA, compared to the 7.6 mA required to drive low against a 433 Ω pullup.
- If you can arrange the RX input of the micro to be 5 V tolerant, then you can pull DCDI to 5 V for greater noise immunity. The circuit above will still work without modification for driving DCDI from the TX pin.
- <blockquote>With that circuit, I can connect MCU UART TX → your circuit → DCDI, and MCU RX directly to DCDI, and then use normal UART timing on the MCU, right?</blockquote>
- Yes.
- <blockquote>And on the firmware side, the only thing I need to manage is switching between transmit and receive at the right times?</blockquote>
- Sortof. You don't "switch" between transmit and receive like you would with a RS-485 line, for example. The hardware isn't in one of transmit or receive mode. Both are simultaneously active. Electrically, anyone can pull the bus line low at any time.
- The firmware needs to make sure that it is only causing the UART to send when that is allowed by the higher level protocol. Keep in mind that the UART probably has an outgoing FIFO of at least one but possibly several bytes. That means the UART will continue to send for a while after the firmware stops giving it characters. Hopefully the higher level protocol is designed to make this process easy.
- Another issue is that all transmitted characters will be received by the UART too. The firmware will have to keep track of what it sent and discard those received characters. It could even do collision checking to make sure the sent characters got onto the wire correctly without something else pulling it low at the same time.
#1: Initial revision
Since the guaranteed logic high threshold is 1.6 V, passively pulling the line to 3.3 V will be fine. Unless you are operating from batteries or every mW otherwise matters, I would use a pullup towards the low end of the range since you are operating with less voltage margin than at 5 V. With a pullup to 3.3 V, you should be able to connect the DCDI line directly to the microcontroller RX input. The micro's TX line can't be directly connected if it actively drives in both directions. Some micros can route peripheral signals to different pins and can disable the high side driver. In that case you can connect the DCDI line to both the RX and TX pins directly. If the micro can't be configured to only drive TX low, then you have to add external circuitry to achieve that. The simplest would be a Schottky diode in series. Check the TX line maximum possible logic low, add the diode drop to that, and make sure the result is still solidly below the 1.0 V threshold. If that doesn't work out, you can use transistors: <img src="https://electrical.codidact.com/uploads/tkgxo5qg22nwgiy8mi1t83smb0ls"> Something like this also necessary if the TX line can't sink enough current to solidly overcome the pullup. The values in this circuit are adjusted so that even with only a gain of 20 for Q2, it can still sink 13 mA. That times the worst case pullup of 433 Ω is 5.7 V, which is more than the voltage across the pullup can ever be. Another advantage of this circuit is that the TX pin only needs to sink 260 µA, compared to the 7.6 mA required to drive low against a 433 Ω pullup. If you can arrange the RX input of the micro to be 5 V tolerant, then you can pull DCDI to 5 V for greater noise immunity. The circuit above will still work without modification for driving DCDI from the TX pin.
