Datasheet
2009-2011 Microchip Technology Inc. DS39957D-page 169
PIC18F87K90 FAMILY
11.6 PORTE, TRISE and
LATE Registers
PORTE is an 8-bit wide, bidirectional port. The
corresponding Data Direction and Output Latch registers
are TRISE and LATE.
All pins on PORTE are implemented with Schmitt
Trigger input buffers. Each pin is individually
configurable as an input or output. The RE7 pin is also
configurable for open-drain output when ECCP2 is
active on this pin. Open-drain configuration is selected
by setting the CCP2OD control bit (ODCON1<6>)
Each of the PORTE pins has a weak internal pull-up. A
single control bit can turn off all the pull-ups. This is
performed by clearing bit, REPU (PADCFG1<6>). The
weak pull-up is automatically turned off when the port
pin is configured as an output. The pull-ups are
disabled on any device Reset.
Pins, RE<6:3>, are multiplexed with the LCD common
drives. I/O port functions are available only on those
PORTE pins according to which commons are active.
The configuration is determined by the LMUX<1:0>
control bits (LCDCON<1:0>). The availability is
summarized in Ta b l e 11-9.
TABLE 11-9: PORTE PINS AVAILABLE IN
DIFFERENT LCD DRIVE
CONFIGURATIONS
(1)
Pins, RE2, RE1 and RE0, are multiplexed with the
functions of LCDBIAS3, LCDBIAS2 and LCDBIAS1.
When LCD bias generation is required (in any applica-
tion where the device is connected to an external LCD),
these pins cannot be used as digital I/O. These pins
can be used as digital I/O, however, when the internal
resistor ladder is used for bias generation.
PORTE is also multiplexed with the Enhanced PWM
Outputs B and C for ECCP1 and ECCP3, and Outputs
B, C and D for ECCP2. For all devices, their default
assignments are on PORTE<6:0>. On 80-pin devices,
the multiplexing for the outputs of ECCP1 and ECCP3 is
controlled by the ECCPMX Configuration bit. Clearing
this bit reassigns the P1B/P1C and P3B/P3C outputs to
PORTH.
RE7 is multiplexed with the LCD segment drive
(SEG31) that is controlled by the LCDSE3<7> bit. I/O
port function is only available when the segment is dis-
abled. RE7 can also be configured as the alternate
peripheral pin for the ECCP2 module. This is done by
clearing the CCP2MX Configuration bit.
RE3 can also be configured as the Reference Clock
Output (REFO) from the system clock. For further details,
refer to Section 3.7 “Reference Clock Output”.
EXAMPLE 11-5: INITIALIZING PORTE
Note: These pins are configured as digital inputs
on any device Reset.
LCDCON
<1:0>
Active LCD
Commons
PORTE Pins
Available for I/O
00 COM0 RE6, RE5, RE4
01 COM0, COM1 RE6, RE5
10 COM0, COM1
and COM2
RE6
11 All (COM0
through COM3)
None
Note 1: If the LCD bias voltages are generated
using the internal resistor ladder, the
LCDBIASx pins are also available as I/O
ports (RE0, RE1 and RE2).
CLRF PORTE ; Initialize PORTE by
; clearing output
; data latches
CLRF LATE ; Alternate method
; to clear output
; data latches
MOVLW 03h ; Value used to
; initialize data
; direction
MOVWF TRISE ; Set RE<1:0> as inputs
; RE<7:2> as outputs