Abstract: IrDA infrared communication is a low-cost, widely adaptable short-distance wireless communication technology. This article introduces the relevant protocols and implementation methods of IrDA, and gives an example of application design of IrDA infrared communication in navigators.
Keywords: Infrared Data Association (IrDA), infrared communication, high-speed infrared, 4PPM modulation, high-speed serial/parallel interface
A navigator is a vehicle-mounted or handheld route guidance device. To realize path guidance accurately, quickly and successfully, it must be supported by a large amount of geographical information data that can be continuously updated, which requires it to have the function of communicating with other devices and exchanging data. As a member of the embedded device, the communication solutions that can be selected include: PCI bus, IrDA, USB, Ethernet, PC card and some traditional I/O. Among them, only IrDA can realize wireless communication. IrDA1.0 supports a communication rate of up to 115.2Kbps, while IrDA1.1 can support up to 4Mbps.
The advantage of wireless communication is that it can eliminate the device's dependence on cables and connectors. As long as both communicating parties support the IrDA protocol, a communication link can be quickly established and data exchange can be achieved.
60% of notebook computers on the market now support infrared transmission, and infrared interfaces have become a must-have standard component for almost all handheld computers. Most of the PC motherboards produced now have infrared interfaces reserved. As long as the appropriate infrared transceiver module is selected, infrared wireless data communication can be achieved. It can be seen that the rapid popularization of infrared technology enables us to finally break through the limitations of connections between digital terminals.
1 Introduction to IrDA and its communication protocol
The Infrared Data Association (IrDA) is an independent organization established in June 1993. It has developed a series of open standards for short-range infrared wireless data communications. The goal of IrDA is to develop standards and protocols that can be implemented at a reasonable and low cost to promote the development of infrared communications.
IrDA data communication is divided into three categories according to transmission rate: SIR, MIR and FIR. Serial infrared (SIR) rates cover the rates typically supported by RS-232 ports (9600 b/s19.2 Kb/s38.4 Kb/s57.6 Kb/s 115.2Kb/ s). MIR refers to the rates of 0.576 Mb/s and 1.152 Mb/s. High-speed infrared (FIR) is usually used to refer to rates of 4 Mb/s and is sometimes used to refer to all rates above SIR.
In IrDA, the physical layer, link access protocol (IrLAP) and link management protocol (IrLMP) are the three necessary protocol layers. In addition, there are optional layers suitable for special application modes.
In the basic IrDA application mode, devices are divided into master devices and slave devices. The master device probes its visual range, looking for slave devices. It then selects one of those devices that responds to it and attempts to establish a connection. During the process of establishing a connection, the two devices coordinate with each other to determine the final communication rate based on their joint highest communication capabilities. The above "searching" and "coordination" processes are all performed at a baud rate of 9.6Kb/s.
IrDA data communication operates in half-duplex mode because when transmitting, the receiver is shielded by the light of its own transmitter. Two communicating devices simulate full-duplex communication by quickly turning the link, with the master device responsible for controlling the timing of the link.
The IrDA protocol is arranged in layers, and the application data is transmitted layer by layer and finally sent out in the form of light pulses. As shown in Figure 1, IrLAP and IrLMP are the two software layers required in addition to the physical layer in the protocol. The first layer on the physical layer is the link access protocolIrLAP, which is an adaptation of the HDLC (Advanced Data Link Control) protocol to adapt to the requirements of infrared transmission. The functions of the IrLAP layer are link initialization, device address search and conflict resolution, connection startup, data exchange, disconnection and link closure. IrLAP specifies the frame and byte structure of infrared data packets, as well as the error detection method for infrared communications. The layer above IrLAP is the link management protocol, or IrLMP, which manages the link functions and applications in the link connections provided by IrLAP. It evaluates the services on the device and manages the coordination of parameters such as data rate, number of BOF (start of frame), and connection reversal time, as well as error-corrected transmission of data.
The IrDA physical layer protocol puts forward suggestions for working distance, working angle (viewing angle) optical power, data rate and anti-interference ability when different brands of equipment are interconnected.
2 Design and implementation of IrDA infrared communication in navigator
2.1 Implementation of physical layer protocol
The design of this protocol ensures error-free communication at axis deviation angles of 0 to 1m and 0° to 15°. These include specifications for modulation, viewing angle, optical power, data rate and noise removal to ensure physical interconnectivity between different brands and types of equipment. The protocol also takes into account the presence of ambient lighting or other sources of IR noise, as well as interference between devices participating in IR communications.
The protocol requires reasonable selection of the light intensity of the transmitter and the sensitivity of the receiver to ensure that the link can work within a distance of 0 to 1m. When the data rate is less than 4 Mb/s, RZI (return to zero inversion) modulation is used, and the maximum pulse width is 3/16 of the bit period; while the data rate of 4 Mb/s uses 4PPM (pulse position) modulation. Figure 1 shows the block diagram of the IrDA physical layer.
The coding effect of RZI (Return to Zero) modulation required by IrDA is shown in the IR frame data in Figure 2. The encoder/decoder required for this solution can be integrated in the I/O chip or can be used as an independent component.
4PPM modulation is shown in Figure 3. Two data bits are combined together to form a 500ns "data symbol group". Divide this symbol group into four 125ns time slots, and place single pulses in different time slots according to the status of the symbol group. After the demodulator locks the phase of the input bit stream, it can decode the data based on the position of the pulse in the 500ns period.
2.2 Design of hardware circuit
The core MCU of the navigator is Intel's SA1110. Its serial port 2 is specially designed for IrDA infrared communication. It integrates two independent encoding/decoding modules that support SIR and FIR and can be used with IrDA-compatible LE on the market. D transceiver directly connected.
The infrared transceiver is HP's HSDL-3600, which supports a data transmission rate of 9.6kb/s~4Mb/s, and its typical link transmission distance can be greater than 1.5m. The data rate that can be received can be selected via pin FIR_SEL. When FIR_SEL is set to low, the maximum rate can reach 115.2kb/s; when set to high, the maximum rate can be 4Mb/s. At the same time, it also has two pins MD0 and MD1, which are used to select the luminous power. Users can set it according to their own needs to save power in short-distance communication situations. The combinations of feature selections can be clearly seen from the transceiver control truth table shown in Table 1.
Table 1 Transceiver control truth table
MD0 | MD1 | FIR_SEL | Receive function | Launch function |
1 | 0 | X | closure | closure |
0 | 0 | 0 | SIR | full distance |
0 | 1 | 0 | SIR | 2/3 distance |
1 | 1 | 0 | SIR | 1/3 distance |
0 | 0 | 1 | FIR | full distance |
0 | 1 | 1 | FIR | 2/3 distance |
1 | 1 | 1 | FIR | 1/3 distance |
Figure 4 is the functional block diagram of HSDL-3600, which gives the pin description and typical peripheral circuits of HSDL-3600. Among them, CX1 takes 0.47μF, CX2 takes 6.8μF, and R1 takes 2.5Ω. In application, pins TXD and RXD are directly connected to TXD2 and RXD2 of SA1110 respectively. Three of the 32-bit data lines of SA1110 are connected to MD0, MD1 and FIR_SEL through latches, so that the working mode of HSDL-3600 can be controlled through software.
2.3 Data flow of IrDA infrared communication
The infrared communication port (ICP) of SA1110 supports both SIR and FIR.
In SIR mode, all serial data transmitted between the TXD2/RXD2 pin and the UART of the ICP are modulated/demodulated according to the SIR IrDA standard. Logic 0 is represented by a light pulse that is 3/16 bits wide, or 1.6 μs wide (1.6 μs is 3/16 of the bit width at the maximum bit rate of 115.2 Kbps). The beginning of bit 0 corresponds to the rising edge of the pulse. Logic 1 is represented by a pulse of no light. Bytes are sent LSB first. Each frame consists of a start bit, 8-bit data, and stop bits, without parity.
In FIR mode, the communication process is much more complicated. All serial data transmitted between the TXD2/RXD2 pin and the ICP's HSSP (High Speed Serial/Parallel) interface are modulated/decoded according to the 4PPM IrDA standard. When encoding, a byte is divided into four separate code unit groups (2-bit pairs). The lowest code unit group is transmitted first, but each code unit group is not reordered. In this way, a byte is composed of four "slices" (each slice is 500ns), and each "slice" is divided into four time slots (each time slot is 125ns).
The high-speed serial/parallel (HSSP) interface is used in ICP to implement a special 4Mb/s protocol. The 4Mb/s serial frame format is shown in Table 2.
Table 2 High-speed serial frame format for IrDA transmission (4Mbps)
boot flag start flag | address | Control (optional) | data | CRC-32 | stop sign |
Boot flag ㄧ1000ㄧ0000ㄧ1010ㄧ0000ㄧ---Repeat 16 times Start flag ㄧ0000ㄧ1100ㄧ0000ㄧ1100ㄧ0110ㄧ0000ㄧ0110ㄧ0000ㄧ Stop flag ㄧ0000ㄧ1100ㄧ 0000ㄧ1100ㄧ0000ㄧ 0110ㄧ0000ㄧ0110ㄧ |
The boot flag is used for reception synchronization. When reception starts, a serial shift register is used to receive four 4PPM slices from the RXD2 pin, latching and decoding these slices at a time. If these slices cannot be decoded into correct pilot flags, the slot count is delayed by 1 and the above process is repeated until the pilot flag is identified, then the flag slot counter is synchronized. The boot flag is repeated at least 16 times and is repeated continuously when idle (no data is sent). Therefore, at any time after the 16 boot flags are transmitted, the start flag may be received.
After receiving the 8-slice length start flag, compare it with the standard encoding. If any part of the start flag differs from the standard encoding, a frame error is signaled and the search for the frame leader flag begins again. Once the correct start flag is verified, each subsequent set of 4 slices is decoded into a data byte and placed into a 5-byte temporary FIFO register. When the temporary FIFO is filled, the data values are pushed into the receive FIFO one by one.
The first data byte of a frame is an 8-bit address area, which is used to specify the receiver during one-to-many communication. A maximum of 255 independent addresses (00000000~11111110) are allowed. 11111111 is a universal address used to broadcast information to all stations. Receive address matching can be activated or disabled. If receive address matching is activated, the received address will be compared with the address match value. If the two values are equal or the input address is a universal address, all data bytes, including the address bytes, will be stored in the receive FIFO. If the values do not match, no data is stored in the receive FIFO, the remainder of the frame is ignored, and the search for the next boot flag begins.
The second data byte of a frame may include an optional user-defined 8-bit control area, which must be decoded by software because it is treated as ordinary data in HSSP.
A frame can contain any number of multiple 8-bit data (including address and control bytes) up to 2047 bytes. HSSP does not limit the size of a frame, but when selecting the data length, the CRC check capability should be taken into consideration. Generally, the data length does not exceed the maximum amount of data when the CRC check can detect all errors in transmission.
HSSP uses a determined 32-bit cyclic redundancy check (CRC) to detect bit errors that occur during transmission. The calculation of the CRC value uses the address, control and data areas, and its generating polynomial is:
CRC(x)=x 32 +x 26 +x 23 +x 22 +x 16 +x 12 +x 11 +x 10 +x 8 +x 7 +x 5 + x 4 +x 2 + x+1
The CRC value is not placed in the receive FIFO, but in a 5-byte temporary FIFO, and compared with the CRC value calculated when receiving.
If two slices without pulses (0000) are received in the data area, the search for a stop flag begins. Once the stop flag is acknowledged, the last byte put into the receive FIFO is marked as the last byte of the frame.
3 Prospects and prospects
With the development of infrared communication technology, its communication rate will continue to increase. In 2001, IrDA will launch the 16Mbps Very High Speed Infrared (VFIR) standard. The range of IrDA infrared communication has also expanded from 1m to dozens of meters, but the expansion of distance comes at the expense of increased power consumption.
For small devices like navigators, IrDA infrared communication is a convenient and fast way to exchange data with the host. With the implementation of the IrDA protocol on PCs, printers, scanners, digital cameras, local area network (LAN) access equipment, pagers, cellular phones, medical facilities and other devices, ubiquitous digital connections are about to become a reality.
Previous article:Using TL16C750 to realize high-speed serial communication between DSP and PC
Next article:Application of LVDS in communication system backplane design
- Popular Resources
- Popular amplifiers
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- CGD and Qorvo to jointly revolutionize motor control solutions
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Nidec Intelligent Motion is the first to launch an electric clutch ECU for two-wheeled vehicles
- Bosch and Tsinghua University renew cooperation agreement on artificial intelligence research to jointly promote the development of artificial intelligence in the industrial field
- GigaDevice unveils new MCU products, deeply unlocking industrial application scenarios with diversified products and solutions
- Advantech: Investing in Edge AI Innovation to Drive an Intelligent Future
- CGD and QORVO will revolutionize motor control solutions
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- C2000Ware for C2000 MCUs
- MSP430F5529 ADC Reference
- EEWORLD University ---- Linux driver development: character device driver
- Can I apply for a demo test in the Qorvo New Product Forum?
- 4418 development board Win8.1 PL2303USB to serial port driver installation
- Application of Time-of-Flight Technology in Distance Measurement and Positioning
- How to use AD to draw the power layer of a four-layer board
- Prize-winning live broadcast: Application of NXP LPC553x in dual motor control is now open for registration!
- Has anyone used XN297?
- [RVB2601 Creative Application Development] Chapter 6: Building a TCP Client