SLAAEO3 September   2024 MSPM0L2228

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction: MSPM0 and LCD End Applications
  5. 2MSPM0 LCD Portfolio
  6. 3Segmented LCD Operation
    1. 3.1 LCD Structure (Simplified)
    2. 3.2 LCD Drive Basics
  7. 4MSPM0 LCD Features
    1. 4.1 Muxing
      1. 4.1.1 Muxing Example
    2. 4.2 Voltage Generation
      1. 4.2.1 Charge Pump
      2. 4.2.2 Contrast Control
    3. 4.3 LCD Clocking
    4. 4.4 LCD Memory and Blinking Mode
      1. 4.4.1 LCD Memory Organization
      2. 4.4.2 Blinking
    5. 4.5 LCD Output Pin Configuration
    6. 4.6 Low Power Mode Feature
  8. 5LCD Layout and Software Considerations
    1. 5.1 LCD Layout Tips
      1. 5.1.1 Hardware-Driven Layout
      2. 5.1.2 Software-Driven Layout
      3. 5.1.3 General Layout Rules
    2. 5.2 LCD Software Tips
      1. 5.2.1 Create a Look-up Table
      2. 5.2.2 Use of #defines
      3. 5.2.3 Efficient Clearing of the LCD Memory
      4. 5.2.4 Double-buffering of the Display Buffer Using Dual Display Memory
  9. 6Additional Resources

Create a Look-up Table

Creating a look-up table containing commonly displayed data, such as numbers, characters, or symbols, makes code easier to read. For example, if numbers are displayed on the LCD, create a look-up table containing the values to write into the LCD memory registers to display each digits 0-9. Using the look-up table in the code snippet below, a write to display a digit looks like: DL_LCD_writeMemory(LCD, memIdx, displayData);

//lookup table for digits on LP-MSPM0L2228 segmented LCD 
const char digit[10][4] = {
    {0x07, 0x09, 0x08, 0x0A}, /* "0" LCD segments a+b+c+d+e+f+k+q */
    {0x00, 0x00, 0x00, 0x0A}, /* "1" */
    {0x03, 0x0A, 0x00, 0x0C}, /* "2" */
    {0x01, 0x0A, 0x00, 0x0E}, /* "3" */
    {0x04, 0x02, 0x00, 0x0E}, /* "4" */
    {0x05, 0x0A, 0x01, 0x00}, /* "5" */
    {0x07, 0x0A, 0x00, 0x06}, /* "6" */
    {0x00, 0x08, 0x00, 0x0A}, /* "7" */
    {0x07, 0x0A, 0x00, 0x0E}, /* "8" */
    {0x05, 0x0A, 0x00, 0x0E}  /* "9" */
};
DL_LCD_writeMemory(LCD, memIdx, displayData);