PIC16F913/914/916/917/946
EXAMPLE 3-6:
INITIALIZING PORTF
3.8
PORTF and TRISF Registers
BANKSELPORTF
;
PORTF is an 8-bit port with Schmitt Trigger input buff-
ers. RF<7:0> are individually configured as inputs or
outputs, depending on the state of the port direction.
The port bits are also multiplexed with LCD segment
functions. PORTF is available on the PIC16F946 only.
CLRF
PORTF
;Init PORTF
;
;Set RF<7:0> as inputs
;
BANKSELTRISF
MOVLW
MOVWF
0FFh
TRISF
REGISTER 3-14: PORTF: PORTF REGISTER(1)
R/W-x
RF7
R/W-x
RF6
R/W-x
RF5
R/W-x
RF4
R/W-x
RF3
R/W-x
RF2
R/W-x
RF1
R/W-x
RF0
bit 7
bit 0
Legend:
R = Readable bit
-n = Value at POR
W = Writable bit
‘1’ = Bit is set
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared x = Bit is unknown
bit 7-0
RF<7:0>: PORTF I/O Pin bits
1= Port pin is >VIH min.
0= Port pin is <VIL max.
Note 1: PIC16F946 only.
REGISTER 3-15: TRISF: PORTF TRI-STATE REGISTER(1)
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
TRISF7
TRISF6
TRISF5
TRISF4
TRISF3
TRISF2
TRISF1
TRISF0
bit 7
bit 0
Legend:
R = Readable bit
-n = Value at POR
W = Writable bit
‘1’ = Bit is set
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared x = Bit is unknown
bit 7-0
TRISF<7:0>: PORTF Tri-State Control bits
1= PORTF pin configured as an input (tri-stated)
0= PORTF pin configured as an output
Note 1: PIC16F946 only.
© 2007 Microchip Technology Inc.
DS41250F-page 81