Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
learn:courses:unit-5:start [2017/03/24 20:10] – Marthalearn:courses:unit-5:start [2022/10/04 11:38] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Unit 5: IrDA Communications Protocols ====== ====== Unit 5: IrDA Communications Protocols ======
 +[[{}/learn/courses/unit-4-1/start|Back to Unit 4 Part 1]]
 +[[{}/learn/courses/unit-4-2/start|Back to Unit 4 Part 2]]
 +
 === Unit 5 Lab === === Unit 5 Lab ===
-  * [[https://reference.digilentinc.com/learn/courses/unit-5-lab5a/start|Lab 5a]]+  * [[/learn/courses/unit-5-lab5a/start|Lab 5a]]
  
  
 === Download This Document === === Download This Document ===
-  * {{ :learn:courses:unit-5:unit_5.pdf |Unit 5 PDF}}+{{ :learn:courses:unit-5:unit_5.pdf |Unit 5 PDF}}
  
 ===== 1. Introduction ===== ===== 1. Introduction =====
Line 18: Line 21:
  
 ===== 2. Objectives: ===== ===== 2. Objectives: =====
-  * Identify the IrDA protocol by capturing the bit stream on the IR_RX pin using the Analog Discovery 2. +  - Identify the IrDA protocol by capturing the bit stream on the IR_RX pin using the Analog Discovery 2. 
-  * Develop a C function that executes an algorithm to decode the IrDA bit stream. +  - Develop a C function that executes an algorithm to decode the IrDA bit stream. 
-  * Display the received codes on the LCD and send to the UART communications port.+  - Display the received codes on the LCD and send to the UART communications port.
  
  
Line 26: Line 29:
  
 ===== 3. Basic Knowledge: ===== ===== 3. Basic Knowledge: =====
-  * How to configure I/O pins on a Microchip® PIC32 PPS microprocessor.  +  - How to configure I/O pins on a Microchip® PIC32 PPS microprocessor.  
-  * How to configure the Analog Discovery 2 to display logic traces. +  - How to configure the Analog Discovery 2 to display logic traces. 
-  * How to implement the design process for embedded processor based systems.+  - How to implement the design process for embedded processor based systems.
    
  
Line 36: Line 39:
 ===== 4. Unit Equipment List ===== ===== 4. Unit Equipment List =====
 ==== 4.1. Hardware ==== ==== 4.1. Hardware ====
-  * [[http://store.digilentinc.com/basys-mx3-pic32mx-trainer-board-recommended-for-embedded-systems-courses/|Basys MX3 trainer board]] +  - [[https://digilent.com/shop/basys-mx3-pic32mx-trainer-board-for-embedded-systems-courses/|Basys MX3 trainer board]] 
-  * [[http://store.digilentinc.com/usb-a-to-micro-b-cable/|Standard USB A to micro-B cable]] +  - [[https://digilent.com/shop/usb-a-to-micro-b-cable/|Standard USB A to micro-B cable]] 
-  * Workstation computer running Windows 10 or higher, MAC OS, or Linux+  - Ordered List ItemWorkstation computer running Windows 10 or higher, MAC OS, or Linux
  
 In addition, we suggest the following instruments: In addition, we suggest the following instruments:
-  * [[http://store.digilentinc.com/analog-discovery-2-100msps-usb-oscilloscope-logic-analyzer-and-variable-power-supply/|Digilent Analog Discovery 2]]+  - [[https://digilent.com/shop/analog-discovery-2-100ms-s-usb-oscilloscope-logic-analyzer-and-variable-power-supply/|Digilent Analog Discovery 2]]
  
 ==== 4.2. Software ==== ==== 4.2. Software ====
 The following programs must be installed on your development work station: The following programs must be installed on your development work station:
-  * [[http://www.microchip.com/mplab/mplab-x-ide|Microchip MPLAB X® v3.35 or higher]] +  - [[http://www.microchip.com/mplab/mplab-x-ide|Microchip MPLAB X® v3.35 or higher]] 
-  * [[http://www.microchip.com/SWLibraryWeb/product.aspx?product=PIC32%20Peripheral%20Library|PLIB Peripheral Library]] +  - [[http://www.microchip.com/SWLibraryWeb/product.aspx?product=PIC32%20Peripheral%20Library|PLIB Peripheral Library]] 
-  * [[http://www.microchip.com/xcdemo/xcpluspromo.aspx|XC32 Cross Compiler] +  - [[http://www.microchip.com/xcdemo/xcpluspromo.aspx|XC32 Cross Compiler] 
-  * [[http://store.digilentinc.com/waveforms-2015-download-only/|WaveForms 2015]] +  - [[https://digilent.com/shop/software/digilent-waveforms/|WaveForms]] 
-  * [[http://www.putty.org/|PuTTY Terminal Emulator]]+  - [[http://www.putty.org/|PuTTY Terminal Emulator]]
  
 ---- ----
  
 ===== 5. Project Takeaways ===== ===== 5. Project Takeaways =====
-  * Understanding of the basics of IrDA protocols. +  - Understanding of the basics of IrDA protocols. 
-  * Using instrumentation to characterize data streams. +  - Using instrumentation to characterize data streams. 
-  * Use processor external interrupts to decode signal timing patterns. +  - Use processor external interrupts to decode signal timing patterns. 
-  * Approaches to using state machines to process data.+  - Approaches to using state machines to process data.
  
  
Line 84: Line 87:
 The Basys MX3 platform is equipped with a Rohm RPM973-H11 infrared communications module that provides the digital interface, as shown in Fig. 7.1. The three microprocessor control pins shown in Fig. 7.2 are the IR_TX, IR_RX, and the IR_PDOWN. The Rohm RPM973-H11 is in a low power mode whenever the IR_PDOWN control signal is in the high state. The IR_PDOWN must be in a low state to transmit or receive infrared signals. Both IR_TX and IR_RX are [[https://en.wikipedia.org/wiki/Logic_level|active low]] signals. The Basys MX3 platform is equipped with a Rohm RPM973-H11 infrared communications module that provides the digital interface, as shown in Fig. 7.1. The three microprocessor control pins shown in Fig. 7.2 are the IR_TX, IR_RX, and the IR_PDOWN. The Rohm RPM973-H11 is in a low power mode whenever the IR_PDOWN control signal is in the high state. The IR_PDOWN must be in a low state to transmit or receive infrared signals. Both IR_TX and IR_RX are [[https://en.wikipedia.org/wiki/Logic_level|active low]] signals.
  
-{{ :learn:courses:unit-5:fig-7-1.png?nolink&600 |Figure 7.1. RPM973-H11 block diagram.}}+{{ :learn:courses:unit-5:fig-7-1.png?nolink&500 |Figure 7.1. RPM973-H11 block diagram.}}
 //Figure 7.1. RPM973-H11 block diagram.// //Figure 7.1. RPM973-H11 block diagram.//
  
-{{ :learn:courses:unit-5:fig-7-2.png?nolink&400 |Figure 7.2. Schematic diagram of PIC32 connection to the RPM841-H11 Infrared Module.}}+{{ :learn:courses:unit-5:unit_5_fig_7_2.jpg?nolink&500 |Figure 7.2. Schematic diagram of PIC32 connection to the RPM841-H11 Infrared Module.}}
 //Figure 7.2. Schematic diagram of PIC32 connection to the RPM841-H11 Infrared Module.// //Figure 7.2. Schematic diagram of PIC32 connection to the RPM841-H11 Infrared Module.//
  
Line 97: Line 100:
 Figure 7.3 shows that the IR LED modulation for a 38 kHz carrier is determined as the inverse of the period between LED pulses. The LED is only on for about 2.4 μs out of the 26.3 μs carrier frequency period. The duty cycle of the LED is less than 10% resulting in lower power consumption. Figure 7.3 shows that the IR LED modulation for a 38 kHz carrier is determined as the inverse of the period between LED pulses. The LED is only on for about 2.4 μs out of the 26.3 μs carrier frequency period. The duty cycle of the LED is less than 10% resulting in lower power consumption.
  
-{{ :learn:courses:unit-5:fig-7-3.png?nolink&600 |Figure 7.3. IrDA 38 kHz carrier signal.}}+ 
 +{{ :learn:courses:unit-5:unit_5_fig_7_3.png?nolink |Figure 7.3. IrDA 38 kHz carrier signal.}}
 //Figure 7.3. IrDA 38 kHz carrier signal.// //Figure 7.3. IrDA 38 kHz carrier signal.//
  
 Figure 7.4 shows a complete IrDA message using the NEC protocol. The signal is low whenever an infrared light is detected. The NEC protocol message contains 32 bits organized in eight bit bytes sent with LSB first. After a 9 ms leader and a 4.5 ms gap, a 560 μs bit marker signals the start of the LSB of the first data byte, as shown in Fig. 7.5.    Figure 7.4 shows a complete IrDA message using the NEC protocol. The signal is low whenever an infrared light is detected. The NEC protocol message contains 32 bits organized in eight bit bytes sent with LSB first. After a 9 ms leader and a 4.5 ms gap, a 560 μs bit marker signals the start of the LSB of the first data byte, as shown in Fig. 7.5.   
  
-{{ :learn:courses:unit-5:fig-7-4.png?nolink&600 |Figure 7.4. Screen capture of a NEC IrDA control message.}}+ 
 +{{ :learn:courses:unit-5:unit_5_fig_7_4.png?nolink |Figure 7.4. Screen capture of a NEC IrDA control message.}}
 //Figure 7.4. Screen capture of a NEC IrDA control message.// //Figure 7.4. Screen capture of a NEC IrDA control message.//
  
 Figures 7.5 and 7.6 show expanded views of portions of the NEC IrDA protocol, showing the sync followed by three of the 24 data bits. Note that the differentiation between a ONE bit and a ZERO bit is the length of the gap following each 560 μs period of 38 kHz modulated infrared pulses. The last byte contains 9 pulse bursts to allow the last bit to be framed correctly. Figures 7.5 and 7.6 show expanded views of portions of the NEC IrDA protocol, showing the sync followed by three of the 24 data bits. Note that the differentiation between a ONE bit and a ZERO bit is the length of the gap following each 560 μs period of 38 kHz modulated infrared pulses. The last byte contains 9 pulse bursts to allow the last bit to be framed correctly.
  
-{{ :learn:courses:unit-5:fig-7-5.png?nolink&600 |Figure 7.5. Details of the message leader and first three data bits.}}+{{ :learn:courses:unit-5:unit_5_fig_7_5.png?nolink |Figure 7.5. Details of the message leader and first three data bits.}}
 //Figure 7.5. Details of the message leader and first three data bits.// //Figure 7.5. Details of the message leader and first three data bits.//
  
-{{ :learn:courses:unit-5:fig-7-6.png?nolink&600 |Figure 7.6. 38 kHz pulse burst timing representing two ZERO bits and a ONE bit.}}+ 
 +{{ :learn:courses:unit-5:unit_5_fig_7_6.png?nolink |Figure 7.6. 38 kHz pulse burst timing representing two ZERO bits and a ONE bit.}}
 //Figure 7.6. 38 kHz pulse burst timing representing two ZERO bits and a ONE bit.// //Figure 7.6. 38 kHz pulse burst timing representing two ZERO bits and a ONE bit.//
 +
  
 Figures in Reference 4 are reproduced below to illustrate the timing of the NEC protocol. The encoding of an NEC protocol message in Fig. 7.7 shows that the entire packet consists of two bytes of data: the address byte and the command byte. Each byte is followed by its [[https://en.wikipedia.org/wiki/Ones%27_complement|one’s complement]]. The consequence of this encoding is that although the time to transmit a ONE bit is twice that of transmitting a ZERO bit, the time to send any NEC encoded message is constant regardless of the value of the address and control bytes. Figures in Reference 4 are reproduced below to illustrate the timing of the NEC protocol. The encoding of an NEC protocol message in Fig. 7.7 shows that the entire packet consists of two bytes of data: the address byte and the command byte. Each byte is followed by its [[https://en.wikipedia.org/wiki/Ones%27_complement|one’s complement]]. The consequence of this encoding is that although the time to transmit a ONE bit is twice that of transmitting a ZERO bit, the time to send any NEC encoded message is constant regardless of the value of the address and control bytes.
Line 285: Line 292:
 ---- ----
  
 +[[{}/learn/courses/unit-4-1/start|Back to Unit 4 Part 1]]
 +[[{}/learn/courses/unit-4-2/start|Back to Unit 4 Part 2]]
 +[[{}/learn/courses/unit-5-lab5a/start|Go to Lab 5a]]
 +[[{}/learn/courses/unit-6/start|Go to Unit 6]]
  
 {{tag>reference learn microprocessor courses basys-mx3}} {{tag>reference learn microprocessor courses basys-mx3}}