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

Customizing the Software LCD Code

Sysconfig is utilized to select and name the needed GPIO pins and timer resource needed by the software LCD solution. The provided Sysconfig file already has the appropriate naming provided for a working solution. Add, remove, or modify the provided pin-out to suit your application needs, while observing the recommendations provided in the Section 2 section. Sysconfig is also where you can change timer clock settings, and thus the LCD refresh rate. If you need to hit a specific refresh rate, keep in mind that the LCD_Update_Clock described in Section 3.2, needs eight update cycles to refresh the entire LCD screen. This means you will need to be servicing the timer interrupt at eight times the refresh rate. For example, if one wanted an LCD refresh rate of 30Hz, then the timer must be setup to interrupt the device at a rate of 240Hz to meet that refresh rate.

Table 3-1 showcases the code definitions and maps that need to be modified to fit your solution. This includes customizing to your chosen pins and the characters to LCD mapping as discussed in Section 1.2. These definitions are found at the beginning of the principle .c file for each project.

Table 3-1 Important Code Definitions and Maps
Type Name Details
#define COM_LINE_TOTAL Number of COM lines used - default 4
#define SEGMENT_LINE_TOTAL Number of Segment lines used
#define SEGMENT_LINE_LOWER_PORT_MASK Port mask of used pins for segments in lower Port A
#define SEGMENT_LINE_UPPER_PORT_MASK Port mask of used pins for segments in upper Port B
#define SEGMENT_LINE_PORT_SPLIT First segment where an upper port pin is assigned. Corresponds to first upper port assignment in gSegmentOffsetMap
uint8_t array gNumberMap[] Array that maps different characters to LCD map.
uint8_t array gSegmentOffsetMap[] Map of different segments lines across a port.
SEGMENT_LINE_LOWER_PORT_MASK must map these segments to port. All Port A segments (lower) must be listed before Port B segments (upper).