PIC17C42 Microchip Technology, PIC17C42 Datasheet - Page 53

no-image

PIC17C42

Manufacturer Part Number
PIC17C42
Description
High-Performance 8-Bit CMOS EPROM/ROM Microcontroller
Manufacturer
Microchip Technology
Datasheets

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC17C42-16/JW
Manufacturer:
AD
Quantity:
12
Part Number:
PIC17C42A-16/L
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC17C42A-16/PQ
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC17C42A-16/PQ
Manufacturer:
MICROCH
Quantity:
20 000
Part Number:
PIC17C42A-16/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC17C42A-16E/L
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC17C42A-16E/PQ
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC17C42A-25/P
Manufacturer:
MICROCLOCK
Quantity:
20 000
9.0
The PIC17C4X devices have five I/O ports, PORTA
through PORTE. PORTB through PORTE have a corre-
sponding Data Direction Register (DDR), which is used
to configure the port pins as inputs or outputs. These
five ports are made up of 33 I/O pins. Some of these
ports pins are multiplexed with alternate functions.
PORTC, PORTD, and PORTE are multiplexed with the
system bus. These pins are 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, these pins are
general purpose I/O.
PORTA and PORTB are multiplexed with the peripheral
features of the device. These peripheral features are:
• Timer modules
• Capture module
• PWM module
• USART/SCI module
• External Interrupt pin
When some of these peripheral modules are turned on,
the port pin will automatically configure to the alternate
function. The modules that do this are:
• PWM module
• USART/SCI module
When a pin is automatically configured as an output by
a peripheral module, the pins data direction (DDR) bit
is unknown. After disabling the peripheral module, the
user should re-initialize the DDR bit to the desired con-
figuration.
The other peripheral modules (which require an input)
must have their data direction bit configured appropri-
ately.
1996 Microchip Technology Inc.
Note:
I/O PORTS
A pin that is a peripheral input, can be con-
figured as an output (DDRx<y> is cleared).
The peripheral events will be determined
by the action output on the port pin.
This document was created with FrameMaker 4 0 4
9.1
PORTA is a 6-bit wide latch. PORTA does not have a
corresponding Data Direction Register (DDR).
Reading PORTA reads the status of the pins.
The RA1 pin is multiplexed with TMR0 clock input, and
RA4 and RA5 are multiplexed with the USART func-
tions. The control of RA4 and RA5 as outputs is auto-
matically configured by the USART module.
9.1.1
The RA2 and RA3 pins are open drain outputs. To use
the RA2 or the RA3 pin(s) as output(s), simply write to
the PORTA register the desired value. A '0' will cause
the pin to drive low, while a '1' will cause the pin to float
(hi-impedance). An external pull-up resistor should be
used to pull the pin high. Writes to PORTA will not affect
the other pins.
FIGURE 9-1:
Note:
Note: I/O pins have protection diodes to V
PORTA Register
USING RA2, RA3 AS OUTPUTS
When using the RA2 or RA3 pin(s) as out-
put(s), read-modify-write instructions (such
as BCF , BSF , BTG ) on PORTA are not rec-
ommended.
Such operations read the port pins, do the
desired operation, and then write this value
to the data latch. This may inadvertently
cause the RA2 or RA3 pins to switch from
input to output (or vice-versa).
It is recommended to use a shadow regis-
ter for PORTA. Do the bit operations on this
shadow register and then move it to
PORTA.
RA0 AND RA1 BLOCK
DIAGRAM
PIC17C4X
DS30412C-page 53
DD
RD_PORTA
DATA BUS
and V
(Q2)
SS
.

Related parts for PIC17C42