Microchip Technology MA180025 Data Sheet

Page of 450
PIC18F87J90 FAMILY
DS39933D-page 208
 2010 Microchip Technology Inc.
17.11 Configuring the LCD Module
The following is the sequence of steps to configure the
LCD module.
1.
Select the frame clock prescale using bits,
LP<3:0> (LCDPS<3:0>).
2.
Configure the appropriate pins to function as
segment drivers using the LCDSEx registers.
3.
Configure the appropriate pins as inputs using
the TRISx registers.
4.
Configure the LCD module for the following
using the LCDCON register:
Multiplex and Bias mode (LMUX<1:0>)
Timing source (CS<1:0>)
Sleep mode (SLPEN)
5.
Write initial values to pixel data registers,
LCDDATA0 through LCDDATA23.
6.
Configure the LCD regulator:
a) If M2 or M3 bias configuration is to be used,
turn off the regulator by setting
CKSEL<1:0> (LCDREG<1:0>) to ‘00’. Set
or clear the CPEN bit (LCDREG<6>) to
select Mode 2 or Mode 3, as appropriate.
b) If M0 or M1 bias generation is to be used:
• Set  the  V
BIAS
 level using the BIAS<2:0>
bits (LCDREG<5:3>).
• Set or clear the CPEN bit to enable or
disable the charge pump.
• Set or clear the MODE13 bit
(LCDREG<2>) to select the Bias mode.
• Select a regulator clock source using the
CKSEL<1:0> bits.
7.
Clear LCD Interrupt Flag, LCDIF (PIR3<6>),
and if desired, enable the interrupt by setting the
LCDIE bit (PIE3<6>).
8.
Enable the LCD module by setting the LCDEN
bit (LCDCON<7>).