top of page

I. Description

1. What is IrTransceiver

 

IrTransceiver is a module designed to connect 2 or more microcontroller based systems by infrared. It is an intelligent transceiver designed to carry the task to perform a reliable connection. The communication protocol is transparent for the microcontrollers interconnected. IrTransceiver communication is performed both ways between a master IrTransceiver and one or more slave IrTransceivers. On the microcontroller side it has a I2C interface with a set of specific commands. Using this commands the master microcontroller connected by I2C to the master IrTransceiver can initiate data transfers in both directions to/from slave microcontrollers connected to slave IrTransceivers. All the communication protocol is implemented inside IrTransceiver, including packing transferred data with 16bit CRC checksum and verifying data integrity at destination.

 

2. Applications

 

-Remote terminals connected bi-directional to main controller

-Intelligent remote controls able to read and interpret parameters received from target and return appropriate commands

-Reliable remote control consoles for robots or toys

-Wireless data exchange between two or more microcontroller systems situated in the same room

-Electric, electromagnetic and radio noise proof remote scanners for electric power operated heavy machinnery

-Any wireless bi-directional data transfer which requires bullet proof data integrity, electric, electromagnetic and radio noise immunity and simplicity of implementation

 

3. Basic configuration and basic operation


The basic configuration connects a master microcontroller to one slave microcontriller.

The configuration consists of master microcontroller connected by I2C to a master IrTransceiver who will be wireless linked to a slave IrTransceiver connected by I2C to the slave microcontroller.
Once given a command by master microcontroller, let's say to send a data stream of 32 bytes to the slave microcontroller, the master IrTransceiver contacts the slave IrTransceiver by Infra Red.
The protocol of communication between the 2 IrTransceivers is transparrent to both microcontrollers, is bulletproof reliable and data is sent and verifyed at destination being packed with a 16bit CRC checksum.
After safely receiving the data stream the slave IrTransceiver informs the slave microcontroller of it's availability. This is done by setting a specific flag in STATUS register, or/and by hardware interrupt.
The slave microcontroller then reads the data stream through I2C. The master IrTransceiver is informed about data being received by slave IrTransceiver and about it being read. It reports to master microcontroller about data delivery accomplishement by setting a specific bit in STATUS register or/and by hardware interrupt.

 

4. Network capabilities

 

Up to 63 IrTransceivers can be interconnected in a star type InfraRed network.

Every IrTransceiver has assigned an internal address for the IR network. One network consists of one master IrTransceiver with IR address 0 and 1 up to 62 slave IrTransceivers, being assigned with addresses from 1 to 62. Each data or command transfer is initiated by master and is dedicated to one specific IR peer.

Address 63 is for broadcast.



6. Data integrity

 

This transceiver was built for industrial control so the integrity of data sent and received is guaranteed.

Data path between source and destination microcontroller is I2C-->InfraRed-->I2C so both InfraRed and I2C transfers provide data integrity verification.

This ensures that any data transfers between microcontrollers over this interface is undistorted.

 

Infrared transferred data between IrTransceivers

IrTransceivers pack every stream they exchange with 16bit CRC checksum and acknowledge data transfer only when data integrity is validated at destination. Corrupted data is not acknowledged and the transfer is automatically repeated by IrTransceivers protocol until checksum matches.

 

I2C transferred data between IrTransceiver and microcontroller
Because I2C communication standard doesn't include a data integrity check, a 8bit CRC checksum is calculted by default by IrTransceiver after any I2C string written or read on its Operating I2C Address. This CRC8 checksum is stored in CRC_BYTE register. Microcontroller can read this register after any I2C transfer and check transferred data integrity.



7. Operating distance


As tested indoor, the connection is working at full speed at 15m (50ft) between IrTransceivers. Greater distances may slow down the communication.
Due to wall reflections, in one room, it works no matter the orientation of the infra red transmitter/receiver.

 


8. Interferrence


Being an Infra Red connection, it doesn't interfere with any radio communication as GSM or wireless radio networks or remotes, and what is the most important, is immune to electric noise made by electric appliances, switches, electric motors, relays or other electric power tools.
Being a custom protocol it doesn't interfere with domestic IR remotes as TV, VCR,A/C etc remotes.



9. Transfer Speed


The first goal of this project was reliability and data integrity and then the speed. The communication between IrTransceivers works at 5600bps. Due to CRC, protocol headers, acknowledges, retries, the real data speed transfer is lower. It is not intended to transfer photo or video streams, but critical industrial data, commands and parameters.
 

10. Power saving

 

If Power Saving programmable flag is set, IrTransceiver switches to sleep mode in 0.64s after Reset if no I2C or IR activity occurs. It wakes up when any activity on I2C or IR is detected.

This is useful when IrTransceiver is embedded in battery operated remotes and systems.

 

5. Data Addressing Modes

 

The exchange of data over IR network through IrTransceivers implements a flexible addresing mode in order to designate the slave microcontroller and the type and location/s of memory where data is to be stored/read. The maximum amount of memory that can be addressed is 256KBytes.

The master microcontroller who initiate the transfer specifyes:

- IR address of slave IrTransceiver connected to the designated microcontroller

- direction of transfer, send data or get data

- length of data stream to be transferred (1-32bytes for one frame)

- what kind of memory of the designated controller to be accessed, RAM, EEPROM or SRAM

- type of memory addressing, byte or word address

- word addressing scheme, individual byte or memory block.

Byte addressing can address 256bytes, Word addressing, 65535bytes and Memory Block addressing, 256Kbytes.

 

29mm

11. IrTransceiver PCB layout

PCB size of IrTransceiver is 35x29mm. On the short left side a 6pin header is present.
The header signals are +5V, GND, SCL, SDA, /INT(/LED), and /RESET.
The top long side is equipped with the IR receiver and transmitter and should be visually in contact with the transceiver/s interconnected to.

Power, I2C, Interrupt and IrTransceiver Reset connector to microcontroller

InfraRed interface

29mm

35mm

Master IrTransceiver

Slave IrTransceiver

12. A typical data transfer communication session

 

(this chapter shows only how "send data" works as an example. "receive data" and all the other commands will be detailed later)

1) Master microcontroller activity:

 - master microcontroller checks by I2C if IrTransceiver is ready by reading its STATUS register

 - the microcontroller uploads by I2C the stream of data to be transferred, the address of the destination IrTransceiver and the memory address where the data will be loaded by the destination microcontroller

 - master microcontroller initiates the transfer by setting a bit in IrTransceiver STATUS register

2) IrTransceiver activity

 - master IrTransceiver contacts the slave IrTransceiver, set as destination of data stream, transferring the data packed with 16bit CRC checksum (In fact all the protocol of communication between IrTransceivers uses 16bit CRC)

 - slave IrTransceiver verifyes the CRC and confirms the reception of data

 - if any error occurs, the transfer is repeated till good completion (this is a simplification)

 - having received the data stream the slave transceiver notifies the slave microcontroller about it. This is done at choice by hardware interrupt or by setting a bit in STATUS register to be polled.

3) Slave microcontroller activity

 - reads STATUS of slave IrTransceiver to see the nature of request (in this example, data received)

 - reads the stream of data from IrTransceiver and loads it on the directed destination memory address

 - confirms data read by clearing the appropriate IrTransceiver STATUS bit

4) IrTransceiver activity

 - slave IrTransceiver informs master IrTransceiver about data being delivered to the destination microcontroller

 - master IrTransceiver notifyes the master microcontroller about data being delivered, by hardware interrupt or setting a bit in STATUS register

5) Master microcontroller activity

 - reads status to see if transfer is completed without errors

 - initiates next transfer

 

13. I2C interface of IrTranscever to microcontroller

 

IrTransceiver has assigned 2 different I2C addresses, Configuration Address = 0x5A and Operation Address which can be configured by user to any value except 0x5A or 0x0 (By default = 0xAA). Configuration Address is used to access IrTransceiver Configuration Registers and Error Byte Definitions. Operation Address is used to access Command Byte (writable command flags) and Status Byte (readable report flags). Also Operation Address is used to upload/download data streams to be transferred between transceivers. IrTransceiver has an internal data buffer of 32 bits, so the stream of data transferred by one operation can be between 1 to 32 bytes.

By reading CRC_BYTE register, all I2C communication can be verifyed by this 8 bit CRC checksum that uses the Dallas/MAXIM polynomial, expressed as X^8 + X^5 + X^4 + 1.

14. Infrared IR interface of IrTransceiver

 

Infrared interface of every IrTransceiver employes one High Power Infrared Emitting Diode working at 940 nm and one IR Receiver Module Demodulator with carrier frequency of 40KHz.

15. IrTransceiver internal architecture

 

IrTransceiver consist of two different blocks, the I2C Interface Controller

and InfraRed Protocol Controller.  There are two types of IrTransceiver, Master and Slave.

- I2C Interface Controller handles the communication with uController, downloads/uploads data streams to be transferred into/to a 32 Bytes I2C buffer, interprets COMMAND register, updates STATUS register and exchanges data delivery information with IR Protocol Controller. 

- IR Protocol Controller handles the communication protocol between IrTransceivers, packs frames with 16 bit CRC checksum, check data integrity and encode and drives IR interface.

IR Protocol Controller employs 2 different 32 Bytes data buffers, one for data received one for data to send. The polynom used by communication protocol is CCITT-16 Polynomial, expressed as X^16 + X^12 + X^5 + 1.

16. Microsystem to Microsystem wireless communication using IrTransceivers, block schematic

bottom of page