參數(shù)資料
型號: PIC16F785
廠商: Microchip Technology Inc.
英文描述: 20-Pin Flash-Based 8-Bit CMOS Microcontroller with Two-Phase Asychronous Feedback PWM, Dual High-Speed Comparators and Dual Operational Amplifiers
中文描述: 20引腳基于閃存的8兩相異步反饋的PWM,雙高位CMOS微控制器的高速比較器和雙運算放大器
文件頁數(shù): 35/178頁
文件大小: 1620K
代理商: PIC16F785
2004 Microchip Technology Inc.
Preliminary
DS41249A-page 33
PIC16F785
4.0
I/O PORTS
There are seventeen general purpose I/O pins and one
input only pin available. Depending on which peripher-
als are enabled, some or all of the pins may not be
available as general purpose I/O. In general, when a
peripheral is enabled, the associated pin may not be
used as a general purpose I/O pin.
4.1
PORTA and TRISA Registers
PORTA is a 6-bit wide, bidirectional port. The
corresponding data direction register is TRISA
(Register 4-2). Setting a TRISA bit (=
1
) will make the
corresponding PORTA pin an input (i.e., put the
corresponding output driver in a High-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). The
exception is RA3, which is input only and its TRIS bit
will always read as ‘
1
’. Example 4-1 shows how to
initialize PORTA.
Reading the PORTA register (Register 4-1) 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; this value is modified and then writ-
ten to the port data latch. RA3 reads ‘
0
’ when
MCLRE =
1
.
The TRISA register controls the direction of the
PORTA 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. I/O pins configured as analog inputs always
read ‘
0
’.
When RA1 is configured as a voltage reference output,
the RA1 digital output driver will automatically be dis-
abled while not affecting the TRISA<1> value.
EXAMPLE 4-1:
BCF
BCF
CLRF
MOVLW
ANDWF
BSF
MOVLW
MOVWF
INITIALIZING PORTA
STATUS,RP0
;Bank 0
STATUS,RP1
;
PORTA
;Init PORTA
F8h
;Set RA<2:0> to
ANSEL0,f
; digital I/O
STATUS,RP0
;Bank 1
0Ch
;Set RA<3:2> as inputs
TRISA
; and set RA<5:4,1:0>
; as outputs
STATUS,RP0
;Bank 0
REGISTER 4-1:
PORTA — PORTA REGISTER (ADDRESS: 05h, 105h)
U-0
U-0
R/W-x
R/W-x
(1)
RA5
RA4
Note:
Additional information on I/O ports may be
found in the PICmicro
Mid-Range
Reference Manual (DS33023).
Note:
The ANSEL0 (91h) register must be initial-
ized to configure an analog channel as a
digital input. Pins configured as analog
inputs will read ‘
0
’.
BCF
R/W-x
RA3
R/W-x
(1)
RA2
R/W-x
(1)
RA1
R/W-x
(1)
RA0
bit 7
bit 0
bit 7-6:
bit 5-0:
Unimplemented
: Read as ‘
0
RA<5:0>
: PORTA I/O pin
1
= Port pin is >V
IH
0
= Port pin is <V
IL
Note 1:
Data latches are unknown after a POR, but each port bit reads ‘0’ when the corre-
sponding analog select bit is ‘1’ (see Register 12-1 on page 80).
Legend:
R = Readable bit
- n = Value at POR
W = Writable bit
‘1’ = Bit is set
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared
x = Bit is unknown
相關(guān)PDF資料
PDF描述
PIC16F818 18/20-Pin Enhanced FLASH Microcontrollers with nanoWatt Technology(18/20引腳,納瓦技術(shù)增強FLASH微控制器)
PIC16F819 18/20-Pin Enhanced FLASH Microcontrollers with nanoWatt Technology(18/20引腳,納瓦技術(shù)增強FLASH微控制器)
PIC16F83 8-Bit CMOS Flash/EEPROM Microcontollrs(每個I/O口有20mA吸收,25mA驅(qū)動,64字節(jié)數(shù)據(jù)EEPROM,2.0V的微控制器)
PIC16F84 18-pin Flash/EEPROM 8-Bit Microcontrollers
PIC16F85 18/20 Pin, 8-Bit CMOS FLASH Microcontroller with Comparators and A/D Product Brief
相關(guān)代理商/技術(shù)參數(shù)
參數(shù)描述
PIC16F785-E/ML 功能描述:8位微控制器 -MCU 3.5 KB 128 RAM 18I/O RoHS:否 制造商:Silicon Labs 核心:8051 處理器系列:C8051F39x 數(shù)據(jù)總線寬度:8 bit 最大時鐘頻率:50 MHz 程序存儲器大小:16 KB 數(shù)據(jù) RAM 大小:1 KB 片上 ADC:Yes 工作電源電壓:1.8 V to 3.6 V 工作溫度范圍:- 40 C to + 105 C 封裝 / 箱體:QFN-20 安裝風格:SMD/SMT
PIC16F785-E/P 功能描述:8位微控制器 -MCU 14KB 368 RAM 33 I/O RoHS:否 制造商:Silicon Labs 核心:8051 處理器系列:C8051F39x 數(shù)據(jù)總線寬度:8 bit 最大時鐘頻率:50 MHz 程序存儲器大小:16 KB 數(shù)據(jù) RAM 大小:1 KB 片上 ADC:Yes 工作電源電壓:1.8 V to 3.6 V 工作溫度范圍:- 40 C to + 105 C 封裝 / 箱體:QFN-20 安裝風格:SMD/SMT
PIC16F785-E/SO 功能描述:8位微控制器 -MCU 3.5KB FL 128R 18 I/O RoHS:否 制造商:Silicon Labs 核心:8051 處理器系列:C8051F39x 數(shù)據(jù)總線寬度:8 bit 最大時鐘頻率:50 MHz 程序存儲器大小:16 KB 數(shù)據(jù) RAM 大小:1 KB 片上 ADC:Yes 工作電源電壓:1.8 V to 3.6 V 工作溫度范圍:- 40 C to + 105 C 封裝 / 箱體:QFN-20 安裝風格:SMD/SMT
PIC16F785-E/SS 功能描述:8位微控制器 -MCU 3.5KB FL 128R 18 I/O RoHS:否 制造商:Silicon Labs 核心:8051 處理器系列:C8051F39x 數(shù)據(jù)總線寬度:8 bit 最大時鐘頻率:50 MHz 程序存儲器大小:16 KB 數(shù)據(jù) RAM 大小:1 KB 片上 ADC:Yes 工作電源電壓:1.8 V to 3.6 V 工作溫度范圍:- 40 C to + 105 C 封裝 / 箱體:QFN-20 安裝風格:SMD/SMT
PIC16F785-I/ML 功能描述:8位微控制器 -MCU 3.5 KB 128 RAM 18I/O RoHS:否 制造商:Silicon Labs 核心:8051 處理器系列:C8051F39x 數(shù)據(jù)總線寬度:8 bit 最大時鐘頻率:50 MHz 程序存儲器大小:16 KB 數(shù)據(jù) RAM 大小:1 KB 片上 ADC:Yes 工作電源電壓:1.8 V to 3.6 V 工作溫度范圍:- 40 C to + 105 C 封裝 / 箱體:QFN-20 安裝風格:SMD/SMT