PIC16F887-I/PT Microchip Technology Inc., PIC16F887-I/PT Datasheet - Page 105

no-image

PIC16F887-I/PT

Manufacturer Part Number
PIC16F887-I/PT
Description
MCU, 8-Bit, 8KW Flash, 368 RAM, 36 I/O, TQFP-44
Manufacturer
Microchip Technology Inc.
Datasheet

Specifications of PIC16F887-I/PT

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
44-pin TFQP
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-I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC16F887-I/PT
Manufacturer:
Microchip
Quantity:
600
Part Number:
PIC16F887-I/PT
0
Company:
Part Number:
PIC16F887-I/PT
Quantity:
1 600
Company:
Part Number:
PIC16F887-I/PT
Quantity:
6 400
Company:
Part Number:
PIC16F887-I/PT
Quantity:
3 200
9.2.6
This is an example procedure for using the ADC to
perform an Analog-to-Digital conversion:
1.
2.
3.
4.
5.
6.
7.
8.
© 2007 Microchip Technology Inc.
Note 1: The global interrupt can be disabled if the
Configure Port:
• Disable pin output driver (See TRIS register)
• Configure pin as analog
Configure the ADC module:
• Select ADC conversion clock
• Configure voltage reference
• Select ADC input channel
• Select result format
• Turn on ADC module
Configure ADC interrupt (optional):
• Clear ADC interrupt flag
• Enable ADC interrupt
• Enable peripheral interrupt
• Enable global interrupt
Wait the required acquisition time
Start conversion by setting the GO/DONE bit.
Wait for ADC conversion to complete by one of
the following:
• Polling the GO/DONE bit
• Waiting for the ADC interrupt (interrupts
Read ADC Result
Clear the ADC interrupt flag (required if interrupt
is enabled).
enabled)
2: See
A/D CONVERSION PROCEDURE
user is attempting to wake-up from Sleep
and resume in-line code execution.
Requirements”.
Section 9.3
(1)
“A/D
(2)
.
Acquisition
PIC16F882/883/884/886/887
Preliminary
EXAMPLE 9-1:
;This code block configures the ADC
;for polling, Vdd and Vss as reference, Frc
clock and AN0 input.
;
;Conversion start & polling for completion
; are included.
;
BANKSEL
MOVLW
MOVWF
BANKSEL
BSF
BANKSEL
BSF
BANKSEL
MOVLW
MOVWF
CALL
BSF
BTFSC
GOTO
BANKSEL
MOVF
MOVWF
BANKSEL
MOVF
MOVWF
ADCON1
B’10000000’ ;right justify
ADCON1
TRISA
TRISA,0
ANSEL
ANSEL,0
ADCON0
B’11000001’ ;ADC Frc clock,
ADCON0
SampleTime
ADCON0,GO
ADCON0,GO
$-1
ADRESH
ADRESH,W
RESULTHI
ADRESL
ADRESL,W
RESULTLO
A/D CONVERSION
;
;Vdd and Vss as Vref
;
;Set RA0 to input
;
;Set RA0 to analog
;
;AN0, On
;Acquisiton delay
;Start conversion
;Is conversion done?
;No, test again
;
;Read upper 2 bits
;store in GPR space
;
;Read lower 8 bits
;Store in GPR space
DS41291D-page 103

Related parts for PIC16F887-I/PT