PIC16C925/926
4.4 PORTD and TRISD Registers
PORTD is an 8-bit port with Schmitt Trigger input buff-
ers. The first five pins are configurable as general pur-
pose I/O pins or LCD segment drivers. Pins RD5, RD6
and RD7 can be digital inputs, or LCD segment, or
common drivers.
TRISD controls the direction of pins RD0 through RD4
when PORTD is configured as a digital port.
Note 1: On a Power-on Reset, these pins are
configured as LCD segment drivers.
2: To configure the pins as a digital port, the
corresponding bits in the LCDSE register
must be cleared. Any bit set in the LCDSE
register overrides any bit settings in the
corresponding TRIS register.
EXAMPLE 4-4: INITIALIZING PORTD
BCF STATUS,RP0
BSF STATUS,RP1
BCF LCDSE, SE29
BCF LCDSE, SE0
BSF STATUS,RP0
BCF STATUS,RP1
MOVLW 0xE0
MOVWF TRISD
;Select Bank2
;
;Make RD<7:5> digital
;Make RD<4:0> digital
;Select Bank1
;
;Make RD<4:0> outputs
;Make RD<7:5> inputs
FIGURE 4-6:
LCD
Segment Data
PORTD <4:0> BLOCK
DIAGRAM
LCD Segment
Output Enable
Data
Bus
WR
Port
D
Q
CK
Data Latch
I/O pin
WR
TRIS
RD
TRIS
D
Q
CK
TRIS Latch
Schmitt
Trigger
Input
Buffer
LCDSE<n>
Q
D
ENEN
RD
Port
FIGURE 4-7:
LCD
Segment Data
LCD Segment
Output Enable
PORTD<7:5> BLOCK
DIAGRAM
LCD
Common Data
LCD Common
Output Enable
LCDSE<n>
Digital Input/
LCD Output pin
Data Bus
RD Port
Q
D
ENEN
Schmitt
Trigger
Input
Buffer
VDD
RD TRIS
DS39544A-page 34
Preliminary
2001 Microchip Technology Inc.