English
Language : 

PIC17C7XX_13 Datasheet, PDF (78/306 Pages) Microchip Technology – High-Performance 8-bit CMOS EPROM Microcontrollers with 10-bit A/D
PIC17C7XX
10.3 PORTC and DDRC Registers
PORTC is an 8-bit bi-directional port. The correspond-
ing data direction register is DDRC. A '1' in DDRC con-
figures the corresponding port pin as an input. A '0' in
the DDRC register configures the corresponding port
pin as an output. Reading PORTC reads the status of
the pins, whereas writing to PORTC will write to the port
latch. PORTC is multiplexed with the system bus.
When operating as the system bus, PORTC is the low
order byte of the address/data bus (AD7:AD0). The tim-
ing for the system bus is shown in the Electrical Speci-
fications section.
Note:
This port is configured as the system bus
when the device’s configuration bits are
selected to Microprocessor or Extended
Microcontroller modes. In the two other
microcontroller modes, this port is a
general purpose I/O.
Example 10-3 shows an instruction sequence to initial-
ize PORTC. The Bank Select Register (BSR) must be
selected to Bank 1 for the port to be initialized. The fol-
lowing example uses the MOVLB instruction to load the
BSR register for bank selection.
EXAMPLE 10-3: INITIALIZING PORTC
MOVLB
CLRF
MOVLW
MOVWF
1
PORTC, F
0xCF
DDRC
; Select Bank 1
; Initialize PORTC data
; latches before setting
; the data direction reg
; Value used to initialize
; data direction
; Set RC<3:0> as inputs
; RC<5:4> as outputs
; RC<7:6> as inputs
FIGURE 10-9:
BLOCK DIAGRAM OF RC7:RC0 PORT PINS
TTL
Input
Buffer
0 Port
Data
1
Q
D
CK
Q
D
CK
RS
Note: I/O pins have protection diodes to VDD and VSS.
To D_Bus  IR
INSTRUCTION READ
Data Bus
RD_PORTC
WR_PORTC
RD_DDRC
WR_DDRC
EX_EN
DATA/ADDR_OUT
DRV_SYS
System Bus
Control
DS30289C-page 78
 1998-2013 Microchip Technology Inc.