PIC16F871 Datasheet

  • PIC16F871

  • 28/40-Pin, 8-Bit CMOS FLASH Microcontrollers

  • 1755.40KB

  • 172页

  • Microchip   Microchip

扫码查看芯片数据手册

上传产品规格书

PDF预览

PIC16F870/871
3.0
I/O PORTS
FIGURE 3-1:
Data
Bus
Some pins for these I/O ports are multiplexed with an
alternate function for the peripheral features on the
device. In general, when a peripheral is enabled, that
pin may not be used as a general purpose I/O pin.
Additional information on I/O ports may be found in the
PICmicro鈩?/div>
Mid-Range
Reference
Manual,
(DS33023).
BLOCK DIAGRAM OF
RA3:RA0 AND RA5 PINS
Q
V
DD
D
WR
Port
CK
Q
P
Data Latch
3.1
PORTA and the TRISA Register
WR
TRIS
D
Q
N
I/O pin
(1)
PORTA is a 6-bit wide bi-directional port. The corre-
sponding data direction register is TRISA. Setting a
TRISA bit (=1) will make the corresponding PORTA pin
an input (i.e., put the corresponding output driver in a
hi-impedance mode). Clearing a TRISA bit (=0) will
make the corresponding PORTA pin an output (i.e., put
the contents of the output latch on the selected pin).
Reading the PORTA Register reads the status of the
pins, whereas writing to it will write to the port latch. All
write operations are read-modify-write operations.
Therefore, a write to a port implies that the port pins are
read, the value is modified and then written to the port
data latch.
Pin RA4 is multiplexed with the Timer0 module clock
input to become the RA4/T0CKI pin. The RA4/T0CKI
pin is a Schmitt Trigger input and an open drain output.
All other PORTA pins have TTL input levels and full
CMOS output drivers.
Other PORTA pins are multiplexed with analog inputs
and analog V
REF
input. The operation of each pin is
selected by clearing/setting the control bits in the
ADCON1 Register (A/D Control Register1).
Note:
On a Power-on Reset, these pins are con-
figured as analog inputs and read as '0'.
CK
Q
TRIS Latch
V
SS
Analog
Input
Mode
RD TRIS
TTL
Input
Buffer
D
Q
EN
RD PORT
To A/D Converter
Note 1:
I/O pins have protection diodes to V
DD
and V
SS
.
FIGURE 3-2:
Data
Bus
WR
PORT
BLOCK DIAGRAM OF RA4/
T0CKI PIN
D
Q
Q
N
The TRISA Register controls the direction of the RA
pins, even when they are being used as analog inputs.
The user must ensure the bits in the TRISA Register
are maintained set when using them as analog inputs.
CK
I/O pin
(1)
Data Latch
D
Q
Q
V
SS
Schmitt
Trigger
Input
Buffer
EXAMPLE 3-1:
BCF
BCF
CLRF
INITIALIZING PORTA
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
Bank0
Initialize PORTA by
clearing output
data latches
Select Bank 1
Configure all pins
as digital inputs
Value used to
initialize data
direction
Set RA<3:0> as inputs
RA<5:4> as outputs
TRISA<7:6> are always
read as 鈥?鈥?
STATUS, RP0
STATUS, RP1
PORTA
WR
TRIS
CK
TRIS Latch
BSF
MOVLW
MOVWF
MOVLW
STATUS, RP0
0x06
ADCON1
0xCF
RD TRIS
Q
D
EN
EN
RD PORT
MOVWF
TRISA
TMR0 clock input
Note 1:
I/O pin has protection diodes to V
SS
only.
1999 Microchip Technology Inc.
Preliminary
DS30569A-page 27

PIC16F871相关型号PDF文件下载

  • 型号
    版本
    描述
    厂商
    下载
  • 英文版
    8-Pin FLASH-Based 8-Bit CMOS Microcontrollers
    MICROCHIP
  • 英文版
    8-Pin, 8-Bit CMOS Microcontroller with EEPROM Data Memory
    MICROCHIP ...
  • 英文版
    8-Pin, 8-Bit CMOS Microcontroller with A/D Converter and EEP...
    MICROCHIP ...
  • 英文版
    8-Pin, 8-Bit CMOS Microcontrollers
    MICROCHIP ...
  • 英文版
    EPROM Memory Programming Specification
    MICROCHIP ...
  • 英文版
    8-Pin FLASH-Based 8-Bit CMOS Microcontrollers
    MICROCHIP ...
  • 英文版
    Microcontroller
    MICROCHIP
  • 英文版
    Microcontroller 
    Microchip
  • 英文版
    Microcontroller
    ETC
  • 英文版
    EPROM-Based 8-Bit CMOS Microcontroller
    MICROCHIP
  • 英文版
    8-Pin, 8-Bit CMOS Microcontrollers
    MICROCHIP
  • 英文版
    8-Pin, 8-Bit CMOS Microcontrollers
    MICROCHIP ...
  • 英文版
    ETC
  • 英文版
    EPROM Memory Programming Specification
    MICROCHIP
  • 英文版
    EPROM Memory Programming Specification
    MICROCHIP ...
  • 英文版
    28-Pin Programmable Mixed Signal Controller
    Microchip
  • 英文版
    EPROM Memory Programming Specification
    Microchip
  • 英文版
    Microcontroller
    ETC
  • 英文版
    Microcontroller
    ETC
  • 英文版
    EPROM/ROM-Based 8-Bit CMOS Microcontroller Series
    MICROCHIP

扫码下载APP,
一键连接广大的电子世界。

在线人工客服

买家服务:
卖家服务:

0571-85317607

客服在线时间周一至周五
9:00-17:30

关注官方微信号,
第一时间获取资讯。

建议反馈

联系人:

联系方式:

按住滑块,拖拽到最右边
>>
感谢您向阿库提出的宝贵意见,您的参与是维库提升服务的动力!意见一经采纳,将有感恩红包奉上哦!