PIC12F683-I/SN Microchip Technology Inc., PIC12F683-I/SN Datasheet - Page 66

no-image

PIC12F683-I/SN

Manufacturer Part Number
PIC12F683-I/SN
Description
8 PIN, 3.5 KB FLASH, 128 RAM, 6 I/O
Manufacturer
Microchip Technology Inc.
Datasheet

Specifications of PIC12F683-I/SN

A/d Inputs
4-Channel, 10-Bit
Comparators
1
Cpu Speed
5 MIPS
Eeprom Memory
256 Bytes
Input Output
5
Memory Type
Flash
Number Of Bits
8
Package Type
8-pin SOIC-N
Programmable Memory
3.5K Bytes
Ram Size
128 Bytes
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:
PIC12F683-I/SN
Manufacturer:
FREESCALE
Quantity:
2 119
Part Number:
PIC12F683-I/SN
Manufacturer:
Microchip Technology
Quantity:
46 465
Part Number:
PIC12F683-I/SN
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC12F683-I/SN
0
PIC12F683
9.2.4
The ADC module can operate during Sleep. This
requires the ADC clock source to be set to the F
option. When the F
ADC waits one additional instruction before starting the
conversion. This allows the SLEEP instruction to be
executed, which can reduce system noise during the
conversion. If the ADC interrupt is enabled, the device
will wake-up from Sleep when the conversion
completes. If the ADC interrupt is disabled, the ADC
module is turned off after the conversion completes,
although the ADON bit remains set.
When the ADC clock source is something other than
F
sion to be aborted and the ADC module is turned off,
although the ADON bit remains set.
9.2.5
The CCP Special Event Trigger allows periodic ADC
measurements without software intervention. When
this trigger occurs, the GO/DONE bit is set by hardware
and the Timer1 counter resets to zero.
Using the Special Event Trigger does not assure proper
ADC timing. It is the user’s responsibility to ensure that
the ADC timing requirements are met.
See Section 11.0 “Capture/Compare/PWM (CCP)
Module” for more information.
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.
DS41211C-page 64
RC
, a SLEEP instruction causes the present conver-
Configure GPIO 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
enabled)
ADC OPERATION DURING SLEEP
SPECIAL EVENT TRIGGER
A/D CONVERSION PROCEDURE
RC
clock source is selected, the
(1)
(2)
.
RC
8.
EXAMPLE 9-1:
9.2.7
The following registers are used to control the
operation of the ADC.
;This code block configures the ADC
;for polling, Vdd reference, Frc clock
;and GP0 input.
;
;Conversion start & polling for completion
; are included.
;
BANKSEL
BSF
BANKSEL
MOVLW
IORWF
BANKSEL
MOVLW
MOVWF
CALL
BSF
BTFSC
GOTO
BANKSEL
MOVF
MOVWF
BANKSEL
MOVF
MOVWF
Note 1: The global interrupt can be disabled if the
Clear the ADC interrupt flag (required if interrupt
is enabled).
2: See
ADC REGISTER DEFINITIONS
user is attempting to wake-up from Sleep
and resume in-line code execution.
Requirements”.
TRISIO
TRISIO,0
ANSEL
B’01110001’
ANSEL
ADCON0
B’10000001’
ADCON0
SampleTime
ADCON0,GO
ADCON0,GO
$-1
ADRESH
ADRESH,W
RESULTHI
ADRESL
ADRESL,W
RESULTLO
Section 9.3
A/D CONVERSION
© 2006 Microchip Technology Inc.
;
;Set GP0 to input
;
;ADC Frc clock,
; and GP0 as analog
;
;Right justify,
;Vdd Vref, 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
“A/D
Acquisition

Related parts for PIC12F683-I/SN