|
PIC16F946 Datasheet, PDF (49/274 Pages) Microchip Technology – 64-Pin Flash-Based, 8-Bit CMOS Microcontrollers with LCD Driver and nanoWatt Technology | |||
|
◁ |
PIC16F946
3.4 PORTC and TRISC Registers
PORTC is an 8-bit bidirectional port. PORTC is
multiplexed with several peripheral functions. PORTC
pins have Schmitt Trigger input buffers.
All PORTC pins have latch bits (PORTC register).
They, when written, will modify the contents of the
PORTC latch; thus, modifying the value driven out on
a pin if the corresponding TRISC bit is configured for
output.
Note:
Analog lines that carry LCD signals
(i.e., SEGx, VLCDy, where x and y are
segment and LCD bias voltage identifiers)
are shown as direct connections to the
device pins. The signals are outputs from
the LCD module and may be tri-stated,
depending on the configuration of the LCD
module.
EXAMPLE 3-3: INITIALIZING PORTC
BCF
BCF
CLRF
BSF
BCF
MOVLW
MOVWF
BCF
BSF
CLRF
BCF
BCF
STATUS,RP0 ;Bank 0
STATUS,RP1 ;
PORTC
;Init PORTC
STATUS,RP0 ;Bank 1
STATUS,RP1 ;
FFh
;Set RC<7:0> as inputs
TRISC
;
STATUS,RP0 ;Bank 2
STATUS,RP1 ;
LCDCON
;Disable VLCD<3:1>
;inputs on RC<2:0>
STATUS,RP0 ;Bank 0
STATUS,RP1 ;
REGISTER 3-7:
PORTC â PORTC REGISTER (ADDRESS: 07h)
R/W-x R/W-x R/W-x R/W-x R/W-x
RC7
RC6
RC5
RC4
RC3
bit 7
R/W-x
RC2
R/W-x
RC1
R/W-x
RC0
bit 0
bit 7-0
RC<7:0>: PORTC I/O Pin bits
1 = Port pin is >VIH
0 = Port pin is <VIL
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
REGISTER 3-8:
TRISC â PORTC TRI-STATE REGISTER (ADDRESS: 87h)
R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1
TRISC7 TRISC6 TRISC5 TRISC4 TRISC3 TRISC2
bit 7
R/W-1
TRISC1
R/W-1
TRISC0
bit 0
bit 7-0
TRISC<7:0>: PORTC Tri-State Control bits
1 = PORTC pin configured as an input (tri-stated)
0 = PORTC pin configured as an output
Note: TRISC<7:6> always reads â1â in XT, HS and LP OSC modes.
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
© 2005 Microchip Technology Inc.
Preliminary
DS41265A-page 47
|
▷ |