pic32mx320f064h Microchip Technology Inc., pic32mx320f064h Datasheet - Page 440

no-image

pic32mx320f064h

Manufacturer Part Number
pic32mx320f064h
Description
64/100-pin General Purpose, 32-bit Flash Microcontrollers
Manufacturer
Microchip Technology Inc.
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
pic32mx320f064h-40I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064h-40I/PT
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
pic32mx320f064h-40V/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064h-80I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064h-80V/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064hT-40I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
PIC32MX FAMILY
22.4.5
The CLRASAM bit provides a method to terminate
auto-sample after the first sequence is completed. Set-
ting the CLRASAM and starting an auto-sample
sequence will cause the A/D converter to complete one
auto-sample sequence (the number of samples as
defined by SMPI<3:0> (AD1CON2<5:2>)). Hardware
will clear ASAM (AD1CON1<2>) and set the interrupt
flag. This will stop the sampling process to allow
inspection of the result buffer without results being
overwritten
sequence. The CLRASAM must be cleared by software
to disable this mode.
EXAMPLE 22-1:
22.4.8
Automatic acquisition control is enabled by setting the
ASAM (AD1CON1<2>) bit. Setting the ASAM bit ini-
tiates automatic acquisition, and clearing the SAMP
(AD1CON1<1>) bit terminates sampling and starts
conversion. After the conversion completes, the mod-
ule will automatically return to an acquisition state. The
SAMP bit is automatically set at the start of the acquisi-
tion interval. The user software must time the clearing
of the SAMP bit to ensure adequate acquisition time of
the input signal, understanding that the time between
clearing of the SAMP bit includes the conversion time
as well as the acquisition time. See Example 22-2 for a
code example.
DS61143A-page 438
Note:
}
{
AD1PCFG = 0xFFFB;
AD1CON1 = 0x0000;
AD1CHS = 0x00020000;
AD1CSSL = 0;
AD1CON3 = 0x0002;
AD1CON2 = 0;
AD1CON1SET = 0x8000;
while (1)
AD1CON1SET = 0x0002;
DelayNmSec(100);
AD1CON1CLR = 0x0002;
while (!(AD1CON1 & 0x0001));// conversion done?
ADCValue = ADC1BUF0;
TERMINATE CONVERSION
SEQUENCE AFTER AN INTERRUPT
Disabling interrupts or masking the ADC
interrupt has no effect on the operation
of the CLRASAM bit.
AUTOMATIC ACQUISITION
by
the
CONVERTING 1 CHANNEL, MANUAL SAMPLE START, MANUAL CONVERSION
START CODE
next
automatic
// PORTB = Digital; RB2 = analog
// SAMP bit = 0 ends sampling ...
// and starts converting
// Connect RB2/AN2 as CH0 input
// in this example RB2/AN2 is the input
// Manual Sample, Tad = internal 2 Tcy
// turn ADC ON
// repeat continuously
// start sampling ...
//
// start Converting
// yes then get ADC value
// repeat
conversion
Advance Information
for 100 mS
22.4.6
The following configuration examples show the ADC
operation in different sampling and buffering configura-
tions. In each example, setting the ASAM bit starts
automatic sampling. A conversion trigger ends sam-
pling and starts conversion.
22.4.7
When SSRC<2:0> = 000, the conversion trigger is
under software control. Clearing the SAMP bit
(AD1CON1<1>) starts the conversion sequence. See
Example 22-1 for sample code to manually control the
sampling of a single channel.
CONVERSION SEQUENCE
EXAMPLES
MANUAL CONVERSION CONTROL
..
© 2007 Microchip Technology Inc.

Related parts for pic32mx320f064h