PIC16CR58A Microchip Technology, PIC16CR58A Datasheet - Page 25

no-image

PIC16CR58A

Manufacturer Part Number
PIC16CR58A
Description
ROM-Based 8-Bit CMOS Microcontroller Series
Manufacturer
Microchip Technology
Datasheets

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC16CR58A-04/P042
Manufacturer:
MOTOROLA
Quantity:
80
5.0
As with any other register, the I/O registers can be
written and read under program control. However, read
instructions (e.g., MOVF PORTB,W) always read the I/O
pins independent of the pin’s input/output modes. On
RESET, all I/O ports are defined as input (inputs are at
hi-impedance) since the I/O control registers (TRISA,
TRISB, TRISC) are all set.
5.1
PORTA is a 4-bit I/O register. Only the low order 4 bits
are used (RA3:RA0). Bits 7-4 are unimplemented and
read as '0's.
5.2
PORTB is an 8-bit I/O register (PORTB<7:0>).
5.3
PORTC is an 8-bit I/O register for PIC16C55s,
PIC16C57s and PIC16CR57s.
PORTC is a general purpose register for PIC16C52,
PIC16C54s, PIC16CR54s, PIC16C56s, PIC16C58s
and PIC16CR58s.
5.4
The output driver control registers are loaded with the
contents of the W register by executing the TRIS f
instruction. A '1' from a TRIS register bit puts the
corresponding output driver in a hi-impedance mode.
A '0' puts the contents of the output data latch on the
selected pins, enabling the output buffer.
The TRIS registers are “write-only” and are set (output
drivers disabled) upon RESET.
TABLE 5-1:
N/A
05h
06h
07h
Legend: Shaded boxes = unimplemented, read as ‘0’,
Note:
Address
1998 Microchip Technology Inc.
I/O PORTS
PORTA
PORTB
PORTC
TRIS Registers
– = unimplemented, read as '0', x = unknown, u = unchanged
A read of the ports reads the pins, not the
output data latches. That is, if an output
driver on a pin is enabled and driven high,
but the external system is holding it low, a
read of the port will indicate that the pin is
low.
TRIS
PORTA
PORTB
PORTC
Name
SUMMARY OF PORT REGISTERS
I/O control registers (TRISA, TRISB, TRISC)
Bit 7
RC7
RB7
Bit 6
RC6
RB6
Bit 5
RB5
RC5
Preliminary
Bit 4
RB4
RC4
Bit 3
RC3
RA3
RB3
5.5
The equivalent circuit for an I/O port pin is shown in
Figure 5-1. All ports may be used for both input and
output operation. For input operations these ports are
non-latching. Any input must be present until read by
an input instruction (e.g., MOVF
outputs are latched and remain unchanged until the
output latch is rewritten. To use a port pin as output,
the corresponding direction control bit (in TRISA,
TRISB) must be cleared (= 0). For use as an input, the
corresponding TRIS bit must be set. Any I/O pin can
be programmed individually as input or output.
FIGURE 5-1:
Note 1: I/O pins have protection diodes to V
Data
Bus
WR
Port
W
Reg
TRIS ‘f’
Bit 2
RA2
RB2
RC2
I/O Interfacing
D
D
CK
CK
Bit 1
RA1
RB1
RC1
Reset
TRIS
Latch
Data
Latch
EQUIVALENT CIRCUIT
FOR A SINGLE I/O PIN
Q
Q
Q
Q
Bit 0
RC0
RA0
RB0
RD Port
PIC16C5X
1111 1111
---- xxxx
xxxx xxxx
xxxx xxxx
Power-On
Value on
Reset
PORTB,
DS30453B-page 25
V
V
P
N
DD
SS
DD
1111 1111
---- uuuu
uuuu uuuu
uuuu uuuu
WDT Reset
MCLR and
and V
Value on
W). The
I/O
pin
SS
.
(1)

Related parts for PIC16CR58A