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)
...
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.
[Show More]