參數(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ù): 42/178頁
文件大小: 1620K
代理商: PIC16F785
PIC16F785
DS41249A-page 40
Preliminary
2004 Microchip Technology Inc.
4.3
PORTB and TRISB Registers
PORTB is a 4-bit wide, bidirectional port. The
corresponding data direction register is TRISB
(Register 4-6). Setting a TRISB bit (=
1
) will make the
corresponding PORTB pin an input (i.e., put the
corresponding output driver in a High-impedance
mode). Clearing a TRISB bit (=
0
) will make the
corresponding PORTB pin an output (i.e., put the
contents of the output latch on the selected pin).
Example 4-2 shows how to initialize PORTB.
Reading the PORTB register (Register 4-5) 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.
Pin RB6 is an open drain output. All other PORTB pins
have full CMOS output drivers.
The TRISB register controls the direction of the
PORTB pins, even when they are being used as
analog inputs. The user must ensure the bits in the
TRISB register are maintained set when using them as
analog inputs. I/O pins configured as analog input
always read ‘
0
’.
EXAMPLE 4-2:
BCF
BCF
CLRF
BSF
BCF
BCF
MOVLW
MOVWF
INITIALIZING PORTB
;Bank 0
;
;Init PORTB
;Bank 1
;digital I/O - RB4
;digital I/O - RB5
;Set RB<5:4> as inputs
;and set RB<7:6>
;as outputs
;Bank 0
REGISTER 4-5:
PORTB — PORTB REGISTER (ADDRESS: 06h, 106h)
R/W-x
R/W-x
R/W-x
(1)
R/W-x
(1)
RB7
RB6
RB5
REGISTER 4-6:
TRISB — PORTB TRISTATE REGISTER (ADDRESS: 86h, 186h)
R/W-1
R/W-1
R/W-1
R/W-1
TRISB7
TRISB6
TRISB5
TRISB4
Note:
The ANSEL1 (93h) register must be initial-
ized to configure an analog channel as a
digital input. Pins configured as analog
inputs will read ‘
0
’.
STATUS,RP0
STATUS,RP1
PORTB
STATUS,RP0
ANSEL1,2
ANSEL1,3
30h
TRISB
BCF
STATUS,RP0
U-0
U-0
U-0
U-0
RB4
bit 7
bit 0
bit 7-4:
RB<7:4>:
PORTB General Purpose I/O Pin bits
1
= Port pin is > V
IH
0
= Port pin is < V
IL
Unimplemented: Read as “
0
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-2 on page 80).
Legend:
R = Readable bit
W = Writable bit
- n = Value at POR
‘1’ = Bit is set
bit 3-0:
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared
x = Bit is unknown
U-0
U-0
U-0
U-0
bit 7
bit 0
bit 7-4:
TRISB<7:4>:
PORTB Tri-State Control bits
1
= PORTB pin configured as an input (tri-stated)
0
= PORTB pin configured as an output
Unimplemented: Read as “
0
Legend:
R = Readable bit
- n = Value at POR
bit 3-0
W = Writable bit
‘1’ = Bit is set
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared
x = Bit is unknown
相關PDF資料
PDF描述
PIC16F818 18/20-Pin Enhanced FLASH Microcontrollers with nanoWatt Technology(18/20引腳,納瓦技術增強FLASH微控制器)
PIC16F819 18/20-Pin Enhanced FLASH Microcontrollers with nanoWatt Technology(18/20引腳,納瓦技術增強FLASH微控制器)
PIC16F83 8-Bit CMOS Flash/EEPROM Microcontollrs(每個I/O口有20mA吸收,25mA驅動,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
相關代理商/技術參數(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