EE 120 Microprocessor‐Based System Design Lab Section 6. Lab 10. Interfacing LCD with Microcontroller by Serial Peripheral Interface (SPI).. 20 Digital Design II - San Jose State University
EE 120 Microprocessor‐Based System Design Lab Section 6. Lab 10. Interfacing LCD with Microcontroller by Serial Peripheral Interface (SPI). In this Lab, we will interface the 84x48 Nokia 5110 Liquid Crystal Display (LCD) to the MSP432 microcontroller by Serial Peripheral Interface (SPI). Also, we will design, write, test, and debug communication functions between them. Moreover, this lab uses a handshake scheme (busy and wait) to handle serial communication between software executed on MSP432, which is a master device, and Nokia 5110 LCD, which is a slave device. Figure 1: Busy‐Wait Scheme. Figure 2: MSP432 Serial Communication Interface.LAB PROCEDURE AND RESULTS: 1. Hardware set-up: Figure 3: MSP432 and Nokia 5110 Interface - Pin P9.4 (STE), P9.5 (CLK) and P9.7 (SIMO) are configured for SPI mode. • Pin P9.4 connected to SCE: 0 = enable LCD, 1 = disable LCD. • Pin P9.5 connected to SCLK: Clock. • Pin P9.7 connected to DN: Serial data bits (command or data for display). - Pin P9.3 and P9.6 are set as GPIO. • Pin P9.3 connected to RST: 0 = reset, 1 = run. • Pin P9.6 connected to DC: 0 = DN is command, 1 = DN is data for display.2. Lab11_LCD project: a. lcdcommandwrite function in Nokia5110.c: This function sends an 8-bit command to the LCD screen. Figure 4: Code for lcdcommandwrite Function. b. lcddatawrite function in Nokia5110.c: This function sends an 8‐bit display data to the LCD screen. Figure 5: Code for lcddatawrite Function. c. Nokia5110_OutString function in Nokia5110.c: This function prints a string of characters from the ASCII table shown in the Nokia5110.c program to the LCD screen. Figure 6: Code for Nokia5110_OutString Function.d. Nokia5110_OutUDec function in Nokia5110.c: This function displays a 16‐bit unsigned number in right‐justified 5‐digit decimal format on the LCD screen. Figure 7: Code for Nokia5110_OutUDec Function.e. Nokia5110_OutSDec function in Nokia5110.c: This function displays a 16‐bit signed number in right‐justified 6‐digit decimal format on the LCD screen.
Written for
- Institution
- EE 120 Microprocessor‐Based System Design Lab Sect
- Course
- EE 120 Microprocessor‐Based System Design Lab Sect
Document information
- Uploaded on
- April 28, 2023
- Number of pages
- 9
- Written in
- 2022/2023
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
ee 120 microprocessor‐based system design lab section 6 lab 10 interfacing lcd with microcontroller by serial peripheral interface spi 20 digital design ii san jose state university