In my project I want to communicate my Arduino with TI BQ2018 Battery Monitor. Communication is done with proprietary HDQ and I cant find any Library supporting it. However in one of the manuals http://www.ti.com/lit/an/slva101/slva101.pdf they state that I could use UART with 57600, non-parity and 2 stop bits which should mean that I can send and receive 8-bit word for each bit of communication. I suppose I can use ordinary serial in my Mega?
But, to do so it says:
"Also note that the TX and RX of the UART must be tied together. In case the TX output is not
an open-drain output, it will need to be inverted and then drive the gate of an NFET with the
open drain tied to the RX input. See Figure 1.
No, any inverter will work like a transistor, FET or logic gate. Like for example the 74HC04 has 6 inverters in it.
Any logic level N-type FET will work.
Any nFET with on-resistance in the 0 to 200 ohms should be quite happy to interface to logic - assuming using a
2k2 pull-up or so. Clearly something cheaper than a large power MOSFET would be good! Without knowing more
I don't see a reason why a bipolar NPN transistor can't serve the same role (remember base resistor). Two NPNs
could be used, the first as an inverter...
A 74HC244 could also be used with the UART's TX going to one of the output enables, and LOW to a buffer's input -
then the buffer's output will work like open-drain. For instance pin1 form TX, pin2 LOW, pin 18 to RX and the pull-up
resistor. This works because the output enables are active low, so no inverter needed.