Infrared Communication
Real Time Embedded Systems www.atomicrhubarb.com/embedded Lecture 1 January 17, 2012 Topic
Section Topic Where in the books Catsoulis chapter/page Simon chapter/page Zilog UM197 (ZNEO Z16F Series Flash Microcontroller Contest Kit User Manual) Zilog UM171 (ZiLOG Developer Studio II ZNEO User Manual) Zilog PS220 (ZNEO Z16F Series Product Specification) Zilog UM188 (ZNEO CPU Core User Manual) Assorted datasheets
IrDA Infra Red transmission of data. IRDA = Infra Red Data Association Developed and maintains IRDA standard. Standard Includes low level protocol and several high level protocols. Not all IR communication is IRDA
IrDA Point to point protocol Asynchronous serial transmission Short distances IrDA 1.0 = 2,400 pbs to 115.2 kpbs, 3 feet Infra Red signals modulated on a 40 Khz carrier.
IrDA SIR - Serial (Slow) infrared 9.6 kbps to 115.2 kbps, RZI modulation MIR - Medium infrared 576 kbps and 1152 kbps, RZI modulation FIR - Fast infrared 4 Mbps, 4 PPM (Pulse-position modulation) VFIR - Very fast infrared 16 Mbps, HHH (1,3) modulation
What is PPM encoding?
PAM The PAM data stream is transmitted as a uniformly spaced sequence of constantwidth pulses. The intensity of each pulse is modulated by amplitude. This is similar to AM radio broadcast, except the carrier is a pulse rather than a sine wave.
PDM Since amplitudes are degraded by noise, the data stream is converted to a constant-amplitude pulse modulation scheme. PDM (Pulse Density Modulation) carries the information in the pulse width, which varies directly to the amplitude of the signal.
PPM PPM (pulse position modulation) results if the PDM waveform is differentiated & rectified. Distance between pulses is the sampled amplitude of the sine wave. Average system power for PPM is much lower than PDM at the expense of greater bandwidth.
PCM In PCM (pulse code modulation), each pulse is encoded into its binary equivalent. During PCM encoding, the serial output stream is conditioned for the communication link.
PCM You establish the patterns used to represent logical one and zero values. A number of PCM codes have been designed for different performance.
What is NRZ, RZ, RZI encoding?
NRZ, RZ, RZI Non-Return to Zero (NRZ) signal does not return to zero after bit is transmitted Return to Zero (RZ) the signal changes not between bits but during each bit RZI Return to Zero Inverted 0 1 0 0 1 1 0 1 0 1 0 0 1 1 0 1 0 1 0 0 1 1 0 1
IrDA
IrDA Ir data Ir Ir Z16 UART ENDEC ENDEC UART Device TxRx TxRx
IrDA layers Physical Layer Optical, encoding of data. IrLAP Link Access Protocol IrLMP Link Management Protocol IAS Information Access Service TinyTP Tiny Transport Protocol IrOBEX Object Exchange Protocol IrCOMM Serial & Parallel Port emulation
Alas, www.blaulogic.com is no more. But Gerd Rausch's code lives on, use the Internet wayback machine: http://web.archive.org/web/2006112420513 8/www.blaulogic.com/pico_irda.shtml
IrDA view angle
SIR Data encoded from NRZ to RZI encoding, then transmitted Led is pulsed for 3 of 16 bit positions
3/16 data modulation Clock Data Bit IR
IR Remote Control Signals The control codes are sent in serial format modulated on a 36-40 khz carrier frequency The data rate sent is generally in the range of 100-2000 bps.
IR Remote Protocols There are many different coding systems in use, and generally different manufacturers use different codes and different data rates for transmission. Common ones: JVC Protocol NEC Protocol Nokia NRC17 Sharp Protocol Sony SIRC Philips RC-5 Philips RC-6 Philips RECS80
SIRC Sony IR Control protocol 12-bit, 15-bit and 20-bit versions of the protocol exist (12-bit described here) 5-bit address and 7-bit command length (12- bit protocol) Carrier frequency of 40kHz Uses predefined addresses (devices like TV or VCR) and commands (+channel,-volume, etc).
Sony SIRC Uses a pulse width encoding of the bits. The pulse representing a logical "1" is a 1.2ms long burst of the 40kHz carrier, while the burst width for a logical "0" is 0.6ms long. All bursts are separated by a 0.6ms long space interval. Typical pulse sequence of the SIRC protocol.
RC-5 Philips RC-5 Protocol The RC-5 code from Philips is possibly the most used protocol by hobbyists, probably because of the wide availability of cheap remote controls (and its simple). The protocol is well defined for different device types ensuring compatibility with your whole entertainment system.
RC-5 5 bit address and 6 bit command length (7 command bits for RC5X) Bi-phase coding (aka Manchester coding) Carrier frequency of 36kHz Constant bit time of 1.778ms (64 cycles of 36 khz) Uses predefined addresses (devices like TV or VCR) and commands (+channel,-volume, etc).
RC-5 Uses bi-phase modulation (Manchester coding) of a 36kHz IR carrier frequency. All bits are of equal length of 1.778ms in this protocol, with half of the bit time filled with a burst of the 36kHz carrier and the other half being idle. Typical pulse sequence of an RC-5 message.
Manchester Encoding? Whats that?
Manchester Encoding? Image from wikipedia The essence: data is encoded in the rising or falling edge.
IR Uses Data Exchange (IrDA) Remote Controls Low data rate communication Application specific protocols Some other stuff
IR References IrDA Infrared Communications: An Overview http://www.webee.com/primers/files/irda.pdf Agilent IrDA Data Link Design Guide San Bergmans Ir Remote Knowledge Base http://www.xs4all.nl/~sbp/knowledge/ir/rc 5.htm
Can you see IR signaling?
Many digital cameras are IR sensitive
IrDA on the ZNEO The Z16 contains two fully-functional, highperformance UART to Infrared Encoder/Decoders (Endecs). Each Infrared Endec is integrated with the on-chip UART to allow easy communication between the Z16 and IrDA transceivers. Infrared communication provides secure, reliable, low-cost, point-to-point communication between PCs, PDAs, cell phones, printers and other infrared enabled devices.
IrDA Block Diagram
IrDA Pins PD4 RDX1 PD5 TXD1 PA4 RXD0 PA5 TXD0
Configure Just like UART but with one additional bit. IREN bit in U0CTL1 (and U1CTL1)
IrDA Transmit Data
IrDA Receive Data
IrDA Recipe All Infrared Endec configuration and status information is set by the UART control registers. So how do we choose between Serial Port and IrDA?
Whats a J10? IrDA Details
IrDA
Can the Z16 speak IR Remote Control (like RC-5 or SIRC)?
What does PA5_TXD0 mean?
So... Z16... what if we don't enable the alternate function on these pins. Then what have we done?
This is RC-5
Recall...
This is RC-5 1 1 1 0 0 1 0 1 0 0 0 0 1 0 Address 5 (VCR) Command 2 ( 2 button)
Can the UART encode/decode these 1's and 0's for us?
Decoding IR remotes That might make an interesting project or lab