EasyManua.ls Logo

Microchip Technology dsPIC30F - Page 413

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...
© 2004 Microchip Technology Inc. DS70064C-page 17-37
Section 17. 10-bit A/D Converter
10-bit A/D
Converter
17
17.15.4 Example: Using Dual 8-Word Buffers
Figure 17-17 and Table 17-5 demonstrate using dual 8-word buffers and alternating the buffer fill.
Setting the BUFM bit enables dual 8-word buffers. The BUFM setting does not affect other
operational parameters. First, the conversion sequence starts filling the buffer at ADCBUF0
(buffer location 0x0). After the first interrupt occurs, the buffer begins to fill at ADCBUF8 (buffer
location 0x8). The BUFS status bit is set and cleared alternately after each interrupt. In this
example, all four channels are sampled simultaneously, and an interrupt occurs after every
sample.
Figure 17-17: Converting Four Inputs, One Time/Interrupt Using Dual 8-Word Buffers
ADCLK
SAMP
ADCBUF0
BSET ADCON1,#ASAM
Instruction Execution
ADCBUF1
ADCBUF2
ADCBUF3
Input to CH0
AN3
TSAMP
ADIF
AN0
AN1
AN2
Input to CH1
Input to CH2
Input to CH3
ADCBUF8
ADCBUF9
ADCBUFA
ADCBUFB
AN3
TSAMP
AN0
AN1
AN2
AN3
TSAMP
AN0
AN1
AN2
BCLR IFS0,#ADIF BCLR IFS0,#ADIF
BUFS
Conversion
Trigger
T
CONVTCONVTCONVTCONV TCONVTCONVTCONVTCONV TCONVTCONVTCONVTCONV

Table of Contents

Other manuals for Microchip Technology dsPIC30F