SLAAEE9 November   2023

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Glass Segment LCD Basics
    1. 1.1 Driving a Segment LCD
    2. 1.2 LCD Mapping
  5. 2Hardware
    1. 2.1 Choosing Pins to Connect to LCD Module
  6. 3Software Implementation
    1. 3.1 Customizing the Software LCD Code
    2. 3.2 Software Flow
    3. 3.3 Integrating Software LCD Solution Within an Application
  7. 4Additional Resources

LCD Mapping

With every LCD, documentation is provided as to the mapping of LCD to different COMx and SEGy lines. A pair of segment lines is combined with four COMx lines to generate one numeric or alphabetic (English) character. Special symbols are given specific COMx + SEGy crosses, or utilized in the spare cross from the typical character mapping. An example of an LCD map can be seen in Figure 1-2.

GUID-20231025-SS0I-F0NV-F0S4-R63JHZHHJPDD-low.svg Figure 1-2 Segment LCD Map Example

From a software perspective, a character needs to be translated from the LCD map, to a numerical representation that can be utilized to determine which segments, and thus pins, needs to be turned on or off at each COMx stage. This translation would need to be done for each character one would want to display, and for each special symbol on the LCD. For this solution, perform the following steps to do a translation:

  1. Determine character to be displayed.
  2. Build out a table of the four COMx lines and two adjacent SEGy lines, placing a “1” corresponding to where a character needs a segment on, and a “0” for where a segment needs to be off.
  3. Rotate this table so the highest COMx line is the most significant bit of the binary number created. This is how the crosses will be represented in the MCU memory.
  4. For better understanding, change the binary value to hex representation, and combine the segments into a single 8-bit character, where the most significant bits are the representation of the lowest segment.

Figure 1-3 walks through an example of this translation with the character “4”. This translation will be stored in a lookup table described in Table 3-1.

GUID-20231025-SS0I-JGT2-RN1N-ZKDCTTVV2XLD-low.svg Figure 1-3 Mapping Characters