English
Language : 

PIC16F636T-I Datasheet, PDF (59/234 Pages) Microchip Technology – 8/14-Pin, Flash-Based 8-Bit CMOS Microcontrollers with nanoWatt Technology
PIC12F635/PIC16F636/639
4.3 PORTC
PORTC is a general purpose I/O port consisting of 6
bidirectional pins. The pins can be configured for either
digital I/O or analog input to comparator. For specific
information about individual functions, refer to the
appropriate section in this data sheet.
Note:
The CMCON0 register must be initialized
to configure an analog channel as a digital
input. Pins configured as analog inputs will
read ‘0’.
REGISTER 4-6: PORTC: PORTC REGISTER
U-0
—
bit 7
U-0
R/W-x
R/W-x
—
RC5
RC4
EXAMPLE 4-3:
BANKSEL PORTC
CLRF PORTC
MOVLW 07h
MOVWF CMCON0
BANKSEL TRISC
MOVLW 0Ch
MOVWF TRISC
INITIALIZING PORTC
;
;Init PORTC
;Set RC<4,1:0> to
;digital I/O
;
;Set RC<3:2> as inputs
;and set RC<5:4,1:0>
;as outputs
R/W-x
RC3
R/W-x
RC2
R/W-0
RC1
R/W-0
RC0
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-6
bit 5-0
Unimplemented: Read as ‘0’
RC<5:0>: PORTC General Purpose I/O Pin bits
1 = Port pin is > VIH
0 = Port pin is < VIL
REGISTER 4-7: TRISC: PORTC TRI-STATE REGISTER
U-0
—
bit 7
U-0
R/W-1
R/W-1
R-1
—
TRISC5
TRISC4
TRISC3
R/W-1
TRISC2
R/W-1
TRISC1
R/W-1
TRISC0
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-6
bit 5-0
Unimplemented: Read as ‘0’
TRISC<5:0>: PORTC Tri-State Control bits
1 = PORTC pin configured as an input (tri-stated)
0 = PORTC pin configured as an output
© 2007 Microchip Technology Inc.
DS41232D-page 57