PIC12F609-H/MD MICROCHIP [Microchip Technology], PIC12F609-H/MD Datasheet - Page 83
PIC12F609-H/MD
Manufacturer Part Number
PIC12F609-H/MD
Description
8-Pin, Flash-Based 8-Bit CMOS Microcontrollers
Manufacturer
MICROCHIP [Microchip Technology]
Datasheet
1.PIC12F609-HMD.pdf
(212 pages)
- Current page: 83 of 212
- Download datasheet (2Mb)
10.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.
2010 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 Section 10.3 “A/D Acquisition
A/D CONVERSION PROCEDURE
user is attempting to wake-up from Sleep
and resume in-line code execution.
Requirements”.
(1)
PIC12F609/615/617/12HV609/615
(2)
.
EXAMPLE 10-1:
;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
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
A/D CONVERSION
;
;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
DS41302D-page 83
Related parts for PIC12F609-H/MD
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
Part Number:
Description:
IC PIC MCU FLASH 1KX14 8SOIC
Manufacturer:
Microchip Technology
Datasheet:
Part Number:
Description:
1.75KB Flash, 64B RAM, 6 I/O, 8MHz Internal Oscillator 8 DFN 4x4mm TUBE
Manufacturer:
Microchip Technology
Datasheet:
Part Number:
Description:
8-Pin Flash-Based, 8-Bit CMOS Microcontrollers
Manufacturer:
MICROCHIP [Microchip Technology]
Datasheet:
Part Number:
Description:
IC PIC MCU FLASH 1KX14 8MSOP
Manufacturer:
Microchip Technology
Datasheet:
Part Number:
Description:
IC PIC MCU FLASH 1KX14 8DIP
Manufacturer:
Microchip Technology
Datasheet:
Part Number:
Description:
IC PIC MCU FLASH 1KX14 8-DFN
Manufacturer:
Microchip Technology
Datasheet:
Part Number:
Description:
1.75KB Flash, 64B RAM, 6 I/O, 8MHz Internal Oscillator 8 PDIP .300in TUBE
Manufacturer:
Microchip Technology
Datasheet:
Part Number:
Description:
1.75KB Flash, 64B RAM, 6 I/O, 8MHz Internal Oscillator 8 SOIC 3.90mm (.150") TUB
Manufacturer:
Microchip Technology
Datasheet:
Part Number:
Description:
1.75KB Flash, 64B RAM, 6 I/O, 8MHz Internal Oscillator 8 DFN 3x3mm TUBE
Manufacturer:
Microchip Technology
Datasheet:
Part Number:
Description:
1.75KB Flash, 64B RAM, 6 I/O, 8MHz Internal Oscillator 8 MSOP 3x3mm TUBE
Manufacturer:
Microchip Technology
Datasheet:
Part Number:
Description:
1.75KB Flash, 64B RAM, 6 I/O, 8MHz Internal Oscillator 8 DFN 4x4mm TUBE
Manufacturer:
Microchip Technology
Datasheet:
Part Number:
Description:
7 KB Flash, 256 Bytes RAM, 32 MHz Int. Osc, 6 I/0, Enhanced Mid Range Core 8 PDI
Manufacturer:
Microchip Technology
Datasheet:
Part Number:
Description:
7 KB Flash, 256 Bytes RAM, 32 MHz Int. Osc, 6 I/0, Enhanced Mid Range Core, Nano
Manufacturer:
Microchip Technology
Datasheet:
Part Number:
Description:
7 KB Flash, 256 Bytes RAM, 32 MHz Int. Osc, 6 I/0, Enhanced Mid Range Core 8 DFN
Manufacturer:
Microchip Technology
Part Number:
Description:
7 KB Flash, 256 Bytes RAM, 32 MHz Int. Osc, 6 I/0, Enhanced Mid Range Core 8 SOI
Manufacturer:
Microchip Technology