Teensy 3.x UART IRDA mode

Status
Not open for further replies.
HI All,

Thought I would post this in case anyone else is searching for info on IRDA mode in the Teensy UARTs. I realize IRDA is kind of old tech but it works in some situations where RF is not desired. There is very little information on this anywhere that I could find on the Web or in the K20 NXP docs.

Anyhoo... Setting IRDA mode is easy as follows:

Code:
Serial1.begin(115200, SERIAL_8N1);     // configuration as basic serial 
UART0_IR = 0b00000100;      // Serial1 uses UART0 registers - sets IR mode (bit2) and 3/16 pulse length (bits0,1)

Tested with Teensy 3.2 only.

In my application I used an integrated IR LED and receiver module the TFBS4711 from Vishay. I limit the IR LED current with a resistor but I can still get at least 300mm of transmission range in normal room light without any additional optics or shades or filters etc. Note, this particular module always echos the transmitted bytes out the receiver. So you have to discard those in software.

Depending on your transmitter and receiver hardware you might have to invert either the TX and/or RX signal using the proper configuration word such as SERIAL_8N1_TXINV_RXINV etc.

Hopefully this will help someone.

Chris
 
Status
Not open for further replies.
Back
Top