Datasheet

2012 Microchip Technology Inc. DS30575A-page 219
PIC18F97J94 FAMILY
11.11 PORTK, LATK and TRISK
Registers
PORTK is an 8-bit wide, bidirectional port. The corre-
sponding Data Direction and Output Latch registers are
TRISK and LATK.
All pins on PORTK are implemented with Schmitt Trig-
ger input buffers. Each pin is individually configurable
as an input or output.
Each of the PORTK pins has a weak internal pull-up.
The pull-ups are provided to keep the inputs at a known
state for the external memory interface while powering
up. A single control bit can turn off all the pull-ups. This
is performed by clearing bit, RKPU (PADCFG<1>).
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.
EXAMPLE 11-10: INITIALIZING PORTK
Note: PORTK is available only on 100-pin
devices.
BANKSEL LATK ; select bank with LATK register
CLRF LATK ; Initialize LATK
; by clearing output
; data latches
BANKSEL TRISK ; Select bank with TRISK register
MOVLW 0CFh ; Value used to
; initialize data
; direction
MOVWF TRISK ; Set RH3:RH0 as inputs
; RH5:RH4 as outputs
; RH7:RH6 as inputs
TABLE 11-10: PORTK FUNCTIONS
Pin Name Function
TRIS
Setting
I/O I/O Type Description
RK0/SEG56 RK0 0 O DIG LATK<0> data output.
1 I ST PORTK<0> data input.
SEG56 0 O ANA LCD Segment 56 output; disables all other pin functions.
RK1/SEG57 RK1 0 O DIG LATK<1> data output.
1 I ST PORTK<1> data input.
SEG57 0 O ANA LCD Segment 57 output; disables all other pin functions.
RK2/SEG58 RK2 0 O DIG LATK<2> data output.
1 I ST PORTK<2> data input.
SEG58 0 O ANA LCD Segment 58 output; disables all other pin functions.
RK3/SEG59 RK3 0 O DIG LATK<3> data output.
1 I ST PORTK<3> data input.
SEG59 0 O ANA LCD Segment 59 output; disables all other pin functions.
RK4/SEG60 RK4 0 O DIG LATK<4> data output.
1 I ST PORTK<4> data input.
SEG60 0 O ANA LCD Segment 60 output; disables all other pin functions.
RK5/SEG61 RK5 0 O DIG LATK<5> data output.
1 I ST PORTK<5> data input.
SEG61 0 O ANA LCD Segment 61 output; disables all other pin functions.
RK6/SEG62 RK6 0 O DIG LATK<6> data output.
1 I ST PORTK<6> data input.
SEG62 0 O ANA LCD Segment 62 output; disables all other pin functions.
RK7/SEG63 RK7 0 O DIG LATK<7> data output.
1 I ST PORTK<7> data input.
SEG63 0 O ANA LCD Segment 63 output; disables all other pin functions.
Legend: O = Output, I = Input, ANA = Analog Signal, DIG = Digital Output, ST = Schmitt Trigger Buffer Input,
x = Don’t care (TRIS bit does not affect port direction or is overridden for this option).