PIC16F887-E/P Microchip Technology Inc., PIC16F887-E/P Datasheet - Page 59

no-image

PIC16F887-E/P

Manufacturer Part Number
PIC16F887-E/P
Description
40 PIN, 14KB FLASH, 368 RAM, 36 I/O, PDIP
Manufacturer
Microchip Technology Inc.
Datasheet

Specifications of PIC16F887-E/P

A/d Inputs
14-Channel, 10-Bit
Comparators
2
Cpu Speed
5 MIPS
Eeprom Memory
256 Bytes
Frequency
20 MHz
Input Output
35
Interface
I2C/SPI/USART
Memory Type
Flash
Number Of Bits
8
Package Type
40-pin PDIP
Programmable Memory
14K Bytes
Ram Size
368 Bytes
Resistance, Drain To Source On
Bytes
Serial Interface
MSSP or EUSART
Speed
20 MHz
Timers
2-8-bit, 1-16-bit
Voltage, Range
2-5.5 V
Lead Free Status / Rohs Status
RoHS Compliant part Electrostatic Device

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC16F887-E/P
Manufacturer:
TI
Quantity:
12 000
Part Number:
PIC16F887-E/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
3.6
PORTD
corresponding
(Register 3-12). Setting a TRISD bit (= 1) will make the
corresponding PORTD pin an input (i.e., put the
corresponding output driver in a High-Impedance mode).
Clearing a TRISD bit (= 0) will make the corresponding
PORTD pin an output (i.e., enable the output driver and
put the contents of the output latch on the selected pin).
Example 3-5 shows how to initialize PORTD.
Reading the PORTD register (Register 3-11) 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 written
to the PORT data latch.
REGISTER 3-11:
REGISTER 3-12:
© 2008 Microchip Technology Inc.
bit 7
Legend:
R = Readable bit
-n = Value at POR
bit 7-0
bit 7
Legend:
R = Readable bit
-n = Value at POR
bit 7-0
Note 1: PORTD is available on PIC16F884/887
TRISD7
R/W-1
R/W-x
RD7
(1)
PORTD and TRISD Registers
is a 8-bit wide, bidirectional port. The
only.
data
RD<7:0>: PORTD General Purpose I/O Pin bit
1 = Port pin is > V
0 = Port pin is < V
TRISD<7:0>: PORTD Tri-State Control bit
1 = PORTD pin configured as an input (tri-stated)
0 = PORTD pin configured as an output
TRISD6
R/W-1
R/W-x
RD6
PORTD: PORTD REGISTER
TRISD: PORTD TRI-STATE REGISTER
direction
W = Writable bit
‘1’ = Bit is set
W = Writable bit
‘1’ = Bit is set
TRISD5
register
IH
IL
R/W-1
R/W-x
RD5
is
PIC16F882/883/884/886/887
TRISD
TRISD4
R/W-1
R/W-x
RD4
U = Unimplemented bit, read as ‘0’
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared
‘0’ = Bit is cleared
TRISD3
R/W-1
R/W-x
The TRISD register (Register 3-12) controls the PORTD
pin output drivers, even when they are being used as
analog inputs. The user should ensure the bits in the
TRISD register are maintained set when using them as
analog inputs. I/O pins configured as analog input always
read ‘0’.
EXAMPLE 3-5:
RD3
BANKSEL PORTD
CLRF
BANKSEL TRISD
MOVLW
MOVWF
PORTD
B‘00001100’
TRISD
TRISD2
R/W-x
R/W-1
RD2
INITIALIZING PORTD
;
;Init PORTD
;
;Set RD<3:2> as inputs
;and set RD<7:4,1:0>
;as outputs
x = Bit is unknown
x = Bit is unknown
TRISD1
R/W-x
R/W-1
RD1
DS41291E-page 57
TRISD0
R/W-1
R/W-x
RD0
bit 0
bit 0

Related parts for PIC16F887-E/P