EasyManua.ls Logo

Microchip Technology dsPIC30F - Enabling the Module; How to Start Sampling; How to Stop Sampling and Start Conversions

Microchip Technology dsPIC30F
738 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
dsPIC30F Family Reference Manual
DS70065C-page 18-14 © 2004 Microchip Technology Inc.
18.9 Enabling the Module
When the ADON bit (ADCON1<15>) is ‘1’, the module is in Active mode and is fully powered and
functional.
When ADON is ‘0’, the module is disabled. The digital and analog portions of the circuit are
turned off for maximum current savings.
In order to return to the Active mode from the Off mode, the user must wait for the analog stages
to stabilize. For the stabilization time, refer to the “Electrical Characteristics” section of the device
data sheet.
18.10 How to Start Sampling
18.10.1 Manual
Setting the SAMP bit (ADCON1<1>) causes the A/D to begin sampling. One of several options
can be used to end sampling and complete the conversions. Sampling will not resume until the
SAMP bit is once again set. For an example, see Figure 18-3.
18.10.2 Automatic
Setting the ASAM bit (ADCON1<2>) causes the A/D to automatically begin sampling a channel
whenever a conversion is not active on that channel. One of several options can be used to end
sampling and complete the conversions. Sampling on a channel resumes after the conversion of
that channel completes. For an example, see Figure 18-4.
18.11 How to Stop Sampling and Start Conversions
The conversion trigger source will terminate sampling and start a selected sequence of
conversions. The SSRC<2:0> bits (ADCON1<7:5>) select the source of the conversion trigger.
18.11.1 Manual
When SSRC<2:0> = 000, the conversion trigger is under software control. Clearing the SAMP
bit (ADCON1<1>) starts the conversion sequence.
Figure 18-3 is an example where setting the SAMP bit initiates sampling and clearing the SAMP
bit, terminates sampling and starts conversion. The user software must time the setting and
clearing of the SAMP bit to ensure adequate sampling time of the input signal.
Figure 18-3: Converting 1 Channel, Manual Sample Start, Manual Conversion Start
Note: The available conversion trigger sources may vary depending on the dsPIC30F
device variant. Please refer to the specific device data sheet for the available
conversion trigger sources.
Note: The SSRC selection bits should not be changed when the A/D module is enabled.
If the user wishes to change the conversion trigger source, the A/D module should
be disabled first by clearing the ADON bit (ADCON1<15>).
ADCLK
SAMP
ADCBUF0
TSAMP TCONV
BCF ADCON1,SAMPBSF ADCON1,SAMP
Instruction Execution
DONE

Table of Contents

Other manuals for Microchip Technology dsPIC30F