English
Language : 

PIC17C7XX_13 Datasheet, PDF (89/306 Pages) Microchip Technology – High-Performance 8-bit CMOS EPROM Microcontrollers with 10-bit A/D
PIC17C7XX
10.8 PORTH and DDRH Registers
(PIC17C76X only)
PORTH is an 8-bit wide, bi-directional port. The corre-
sponding data direction register is DDRH. A '1' in
DDRH configures the corresponding port pin as an
input. A '0' in the DDRH register configures the corre-
sponding port pin as an output. Reading PORTH reads
the status of the pins, whereas writing to PORTH will
write to the respective port latch.
The upper four bits of PORTH are multiplexed with
4 channels of the 10-bit A/D converter.
The remaining bits of PORTH are general purpose I/O.
Upon RESET, RH7:RH4 are automatically configured
as analog inputs and must be configured in software to
be a digital I/O.
EXAMPLE 10-8: INITIALIZING PORTH
MOVLB
MOVLW
MOVPF
CLRF
MOVLW
MOVWF
8
0x0E
ADCON1
PORTH, F
0x03
DDRH
; Select Bank 8
; Configure PORTH as
; digital
; Initialize PORTH data
; latches before
; the data direction
; register
; Value used to init
; data direction
; Set RH<1:0> as inputs
; RH<7:2> as outputs
FIGURE 10-17: BLOCK DIAGRAM OF RH7:RH4
Data Bus
DQ
VDD
WR PORTH
CK Q
P
Data Latch
DQ
N
WR DDRH
CK Q
VSS
DDRH Latch
I/O pin
RD DDRH
QD
EENN
ST
Input
Buffer
RD PORT
PCFG3:PCFG0
VAIN
To other pads
CHS3:CHS0
To other pads
Note: I/O pins have protection diodes to VDD and VSS.
 1998-2013 Microchip Technology Inc.
DS30289C-page 89