Hi all,
Ok i'm going to use a pair of MAX3120
https://datasheets.maximintegrated.com/en/ds/MAX3120.pdf to convert TTL to IR light, and back from IR light to TTL again on the other side. The TTL data is from a boggo UART, coming from a basic 8bitter (AVR ATmega) so is 0-5v TTL, with HIGH = MARK(1) and LOW = SPACE (0), and line IDLE = HIGH(1).
From the MAX3120 datasheet Page 5 in the table of pin allocations
"IR Transmitter TTL/CMOS Data Input. High = IR LED on"
and
"IR Receiver TTL/CMOS Data Output. Pulses low for IR input pulse"
This therefore to me suggests the MAX3120 transciever INVERTS the signal as it passes through ie TTL HIGH -> IR LED ON -> IR LIGHT FALLS ON RECIVER DIODE -> RX OUTPUT TTL LOW
And to avoid running the IR led all the time when just idling the line (which is most of the time), i want a logic level inversion between the AVR TX output and the MAX3120 TX input.
With an inverter in the line:
at IDLE or MARK:
TTL HIGH -> TTL LOW (inversion) -> IR LED OFF -> NO IR on reciever -> TTL HIGH output
at SPACE
TTL LOW -> TTL HIGH(inversion) -> IR LED ON -> IR on reciever -> TTL LOW output
SO far so good i think??

For data coming back the other way, it the reverse that's required, ie the thing sending the data to the MAX3120 needs to have an inverter in between them to achieve the same result as the data comes back (in fact, because the thing sending the UART at the other end is an FTDI USB->UART device, and they have a software pin inversion, i don't need h/w to achieve this)
That, was, in my head, all fine, and looked correct! But then i looked at the "typical operating circuit" on Page 1 of the MAX3120 datasheet and it also shows an inverter in the RX line between the MAX3120 and the UART device (in that case, a MAX3100 SPI UART expander)

why? This doesn't look right to me, as that would cause a double inversion (because the MAX3120 inverts itself)??
Can someone check my working and see who you think is right??
