dsPIC33/PIC24 Family Reference Manual
DS30009740B-page 38 2010-2013 Microchip Technology Inc.
12.0 CONFIGURING THE LCD MODULE
To configure the LCD module:
1. Select the frame clock prescale using bits, LP<2:0> (LCDPS<2:0>).
2. Configure the appropriate pins to function as segment drivers using the LCDSEx
registers.
3. If using the internal reference resistors for biasing, enable the internal reference ladder
and:
• Define the Mode A and Mode B interval by using the LRLAT<2:0> bits (LCDREF<2:0>)
• Define the low, medium or high ladder for Mode A and Mode B by using the
LRLAP<1:0> bits (LCDREF<7:6>) and the LRLBP<1:0> bits (LCDREF<5:4>),
respectively
• Set the VLCDxPE bits (LCDREF<10:8> and enable the LCDIRE bit (LCDREF<15>)
4. Configure the following LCD module functions using the LCDCON register:
• Multiplex and Bias mode – LMUX<2:0> bits
• Timing Source – CS<1:0> bits
• Sleep mode – SLPEN bit
5. Write the initial values to the LCD Pixel Data registers: LCDDATA0 through LCDDATA31.
6. Clear the LCD Interrupt Flag, LCDIF, and if desired, enable the interrupt by setting bit,
LCDIE.
7. Enable the LCD module by setting bit, LCDEN (LCDCON<15>).