English
Language : 

PIC18F87J11_12 Datasheet, PDF (155/466 Pages) Microchip Technology – 64/80-Pin, High-Performance, 1-Mbit Flash Microcontrollers
PIC18F87J11 FAMILY
11.7 PORTF, LATF and TRISF Registers
PORTF is a 7-bit wide, bidirectional port. Only Pin 7 of
PORTF has no analog input; it is the only pin that can
tolerate voltages up to 5.5V.
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.
RF1 through RF6 may also be used as analog input
channels for the A/D Converter. All pins may be used as
comparator inputs or outputs by setting the appropriate
bits in the CMCON register. To use RF<6:3> as digital
inputs, it is also necessary to turn off the comparators.
Note 1: On device Resets, the RF<6:1> pins are
configured as analog inputs and are read
as ‘0’.
2: To configure PORTF as digital I/O, set the
corresponding bits in the ANCON0 and
ANCON1 registers.
When Configuration bit, PMPMX = 0, PORTF is
multiplexed with the Parallel Master Port data. This
multiplexing is available only in 80-pin devices.
EXAMPLE 11-7: INITIALIZING PORTF
CLRF PORTF
; Initialize PORTF by
; clearing output
; data latches
CLRF LATF
; Alternate method to
; clear output latches
BSF WDTCON,ADSHR ; Enable write/read to
; the shared SFR
MOVLW C0h
; make RF1:RF2 digital
MOVWF ANCON0
;
MOVLW 0Fh
; make RF<6:3> digital
MOVWF ANCON1
;
BCF WDTCON,ADSHR ; Disable write/read to
; the shared SFR
MOVLW CEh
;
MOVWF TRISF
; Set RF5:RF4 as outputs,
; RF<7:6>,<3:1> as inputs
 2007-2012 Microchip Technology Inc.
DS39778E-page 155