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-3-lab3b:start [2017/02/16 17:18] – [8.2. Design Phase] Marthalearn:courses:unit-3-lab3b:start [2022/10/04 11:38] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== Lab 3b: LCD Parallel Interface - PMP IO Control ======+====== Lab 3b: LCD Parallel Interface - PMP I/O Control ====== 
 +[[{}/learn/courses/unit-3/start|Back to Unit 3]] 
 +[[{}/learn/courses/unit-3-lab3a/start|Back to Lab 3a]]
 == Download This Document == == Download This Document ==
-  * +{{ :learn:courses:unit-3-lab3b:lab_3b.pdf |Lab 3b PDF}}
  
 ===== 1. Objectives ===== ===== 1. Objectives =====
-  - Develop an application of foreground-background task scheduling. +  - Identify the PIC32 processor pins used for the LCD interface. 
-  - Use change notification interrupts to detect push button presses and releases. +  - Implement LCD control using the PIC32 Parallel Master Port (PMP).  
-  - Eliminate multiple button operations using a timer interrupt to implement a non-blocking delay. +  - Understand handshaking requirements for interfacing two systems operating at differing clock speeds.
-  - Implement the push-on / push off operation using a software-based finite state machine. +
  
 ---- ----
Line 23: Line 23:
 ===== 3. Equipment List ===== ===== 3. Equipment List =====
 ==== 3.1. Hardware ==== ==== 3.1. Hardware ====
-  - Basys MX3 trainer board. +  - [[https://digilent.com/shop/basys-mx3-pic32mx-trainer-board-for-embedded-systems-courses/|Basys MX3 trainer board]] 
-  - PC or Linux Workstation computer. +  - [[https://digilent.com/shop/usb-a-to-micro-b-cable/|Micro USB cable]] 
-  - [[http://store.digilentinc.com/usb-a-to-micro-b-cable/|Micro USB cable]]. +  - Workstation computer running Windows 10 or higher, MAC OS, or Linux 
-  - [[http://store.digilentinc.com/analog-discovery-2-100msps-usb-oscilloscope-logic-analyzer-and-variable-power-supply/|Analog Discovery 2]]. + 
 +In addition, we suggest the following instruments: 
 + 
 +  - [[http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,842,1018&Prod=ANALOG-DISCOVERY|Digilent Analog Discovery 2]]
  
  
 ==== 3.2. Software: ==== ==== 3.2. Software: ====
-  - [[http://www.microchip.com/mplab/mplab-x-ide|Microchip MPLAB X® v3.35 or higher]]. +The following programs must be installed on your development workstation:
-  - [[http://www.microchip.com/SWLibraryWeb/product.aspx?product=PIC32%20Peripheral%20Library|PLIB Peripheral Library]]. +
-  - [[http://store.digilentinc.com/waveforms-2015-download-only/|WaveForms 2015]].+
  
 +  - [[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/xcdemo/xcpluspromo.aspx|XC32 Cross Compiler]]
 +  - [[https://digilent.com/shop/software/digilent-waveforms/|WaveForms]]
  
 ---- ----
  
 ===== 4. Project Takeaways ===== ===== 4. Project Takeaways =====
-  - How to implement a bi-directional parallel IO interface.+  - How to implement a bi-directional parallel I/O interface.
   - How to use delays to control signal timing.   - How to use delays to control signal timing.
   - How to manage ASCII text strings.   - How to manage ASCII text strings.
- 
  
 ---- ----
Line 57: Line 61:
  
 ===== 7. LCD Background Information ===== ===== 7. LCD Background Information =====
-Character [[https://en.wikipedia.org/wiki/Liquid-crystal_display|Liquid Crystal Displays]] (LCD) are low cost electronic devices that are capable of generating visual displays consisting of alphanumeric characters and graphical symbols commonly used for [[https://en.wikipedia.org/wiki/Embedded_system|embedded system]] [[https://en.wikipedia.org/wiki/User_interface|human machine interfaces]] (HMI). Many suppliers of LCD devices are based on the [[https://en.wikipedia.org/wiki/Hitachi_HD44780_LCD_controller|Hitachi HD44780]] LCD controller, and hence have a common hardware and software interface. Some LCD devices have serial interfaces that use UART, I2C, and SPI communications((PmodCLS: Character LCD with Serial Interface, [[http://store.digilentinc.com/pmodcls-character-lcd-with-serial-interface/|http://store.digilentinc.com/pmodcls-character-lcd-with-serial-interface/]])). These protocols are covered in Unit 4. Other LCD devices use interfaces consisting of four or eight data lines and three control lines((PmodCLP Character LCD with Parallel Interface, [[http://store.digilentinc.com/pmodclp-character-lcd-with-parallel-interface/|http://store.digilentinc.com/pmodclp-character-lcd-with-parallel-interface/]])). Although the LCDs that use a serial interface require fewer processor I/O pins, the display controller IC is still based on the Hitachi HD44780, which uses 8 or 11 I/O pins. Hence, the serial LCD devices have an on-board microprocessor that translates the serial communications instructions to parallel I/O. +Character [[https://en.wikipedia.org/wiki/Liquid-crystal_display|Liquid Crystal Displays]] (LCD) are low-cost electronic devices that are capable of generating visual displays consisting of alphanumeric characters and graphical symbols commonly used for [[https://en.wikipedia.org/wiki/Embedded_system|embedded system human machine interfaces]] (HMI). Many suppliers of LCD devices are based on the [[https://en.wikipedia.org/wiki/Hitachi_HD44780_LCD_controller|Hitachi HD44780]] LCD controller, and hence have a common hardware and software interface. Some LCD devices have serial interfaces that use UART, I2C, and SPI communications((PmodCLS: Character LCD with Serial Interface, [[https://digilent.com/shop/pmod-cls-character-lcd-with-serial-interface/]])). These protocols are covered in Unit 4. Other LCD devices use interfaces consisting of four or eight data lines and three control lines((PmodCLP Character LCD with Parallel Interface, [[https://digilent.com/reference/pmod/pmodclp/start]])). Although the LCDs that use a serial interface require fewer processor I/O pins, the display controller IC is still based on the Hitachi HD44780, which uses 8 or 11 I/O pins. Hence, the serial LCD devices have an on-board microprocessor that translates the serial communications instructions to parallel I/O. 
  
-The handshaking required to successfully communicate with the LCD on the Basys MX3 is representative of many common parallel interfaces. +The handshaking required to successfully communicate with the LCD on the Basys MX3 is representative of many common parallel interfaces.
  
  
Line 94: Line 98:
     - Initializes a loop counter to a value of zero.     - Initializes a loop counter to a value of zero.
     - Displays your name on the first line.     - Displays your name on the first line.
-    - Repositions the cursor to the beginning of the second line and displays the text “LAB 3.”+    - Repositions the cursor to the beginning of the second line and displays the text “Lab 3b.”
     - Repositions the cursor to the eighth character position of the second line.     - Repositions the cursor to the eighth character position of the second line.
     - Displays the value of the loop counter.     - Displays the value of the loop counter.
Line 133: Line 137:
   - List the processor hardware resources that you will be using in this design.   - List the processor hardware resources that you will be using in this design.
   - Generate a data flow diagram that identifies tasks (functions) and the information that needs to be passed between these tasks.   - Generate a data flow diagram that identifies tasks (functions) and the information that needs to be passed between these tasks.
-  - Using the DFD and the multiple CFDs shown in Appendix B, develop and test the functions that will initialize the LCD and display single characters and a string of characters. You should use the? software delay function used in Lab 1b.+  - Using the DFD and the multiple CFDs shown in Appendix B, develop and test the functions that will initialize the LCD and display single characters and a string of characters. You should use the software delay function used in Lab 1b. 
  
 ==== 8.4. Testing ==== ==== 8.4. Testing ====
   - Demonstrate that the test program developed for requirement 4 executes correctly using the test string “\0141234\0115678\0119ABC\r”.   - Demonstrate that the test program developed for requirement 4 executes correctly using the test string “\0141234\0115678\0119ABC\r”.
   - Demonstrate that the test program developed for requirement 5 executes correctly.   - Demonstrate that the test program developed for requirement 5 executes correctly.
 +
  
 ---- ----
  
 ===== 9. Questions ===== ===== 9. Questions =====
 +  - What are the advantages of using the PMP interface over the bit-banging interface?
 +  - What are the advantages of using the bit-banging interface over the PMP interface?
   - How would the LCD display be affected if the application described above is combined with an application that uses interrupts?    - How would the LCD display be affected if the application described above is combined with an application that uses interrupts? 
-  - How can the blocking semaphore represented by the Busy Flag be eliminated? 
   - What is the maximum rate at which characters can be written to the LCD?   - What is the maximum rate at which characters can be written to the LCD?
 +
  
 ---- ----
Line 158: Line 166:
  
 ===== Appendix A: Basys MX3 Schematic Drawings ===== ===== Appendix A: Basys MX3 Schematic Drawings =====
-{{ :learn:courses:unit-3-lab3a:lab3a-figure-a-1.png?nolink |Figure A.1. LCD connection schematic diagram for Labs 3a and 3b.}}+{{ :learn:courses:unit-3-lab3b:lab_3b_3_fig_a_1.jpg?nolink&550 |Figure A.1. LCD connection schematic diagram for Labs 3a and 3b.}}
 //Figure A.1. LCD connection schematic diagram for Labs 3a and 3b.// //Figure A.1. LCD connection schematic diagram for Labs 3a and 3b.//
- 
  
 ---- ----
Line 175: Line 182:
  
 {{ :learn:courses:unit-3-lab3a:lab3a-figure-b-4.png?nolink |Figure B.3. Control flow diagram for LCD Write operation using bit-banging.}} {{ :learn:courses:unit-3-lab3a:lab3a-figure-b-4.png?nolink |Figure B.3. Control flow diagram for LCD Write operation using bit-banging.}}
-//Figure B.3. Control flow diagram for LCD Write operation using bit-banging.//+//Figure B.4. Control flow diagram for LCD Write operation using bit-banging.//
  
 {{ :learn:courses:unit-3-lab3a:lab3a-figure-b-5.png?nolink |Figure B.5. LCD display character control flow diagram.}} {{ :learn:courses:unit-3-lab3a:lab3a-figure-b-5.png?nolink |Figure B.5. LCD display character control flow diagram.}}
 //Figure B.5. LCD display character control flow diagram.// //Figure B.5. LCD display character control flow diagram.//
 +
 +----
 +
 +[[{}/learn/courses/unit-3/start|Back to Unit 3]]
 +[[{}/learn/courses/unit-3-lab3a/start|Back to Lab 3a]]
 +[[{}/learn/courses/unit-4-1/start|Go to Unit 4 Part 1]]
 +