English
Language : 

PIC18F87K90 Datasheet, PDF (170/566 Pages) Microchip Technology – 64/80-Pin, High-Performance Microcontrollers with LCD Driver and nanoWatt XLP Technology
PIC18F87K90 FAMILY
11.7 PORTF, LATF and TRISF Registers
PORTF is a 7-bit wide, bidirectional port. The
corresponding Data Direction and Output Latch registers
are TRISF and LATF. All pins on PORTF are
implemented with Schmitt Trigger input buffers. Each pin
is individually configurable as an input or output.
PORTF is multiplexed with analog peripheral functions,
as well as LCD segments. Pins, RF1 through RF6, may
be used as comparator inputs or outputs by setting the
appropriate bits in the CMCON register. To use
RF<7:1> as digital inputs, it is also necessary to turn off
the comparators.
Note 1: On device Resets, pins, RF<7:1>, are
configured as analog inputs and are read
as ‘0’.
2: To configure PORTF as a digital I/O, turn
off the comparators and clear ANCON1
and ANCON2 to digital.
PORTF is also multiplexed with LCD segment drives
controlled by bits in the LCDSE2 and LCDSE3
registers. I/O port functions are only available when the
segments are disabled.
EXAMPLE 11-6: INITIALIZING PORTF
CLRF PORTF
CLRF LATF
BANKSEL ANCON1
MOVLW 01Fh
MOVWF ANCON1
MOVLW 0F0h
MOVWF ANCON2
MOVLW 0CEh
MOVWF TRISF
; Initialize PORTF by
; clearing output
; data latches
; Alternate method
; to clear output
; data latches
; Make AN6, AN7 and AN5 digital
;
; Make AN8, AN9, AN10 and AN11
digital
; Set PORTF as digital I/O
; Value used to
; initialize data
; direction
; Set RF3:RF1 as inputs
; RF5:RF4 as outputs
; RF7:RF6 as inputs
DS39957B-page 170
Preliminary
 2010 Microchip Technology Inc.