EasyManua.ls Logo

Microchip Technology dsPIC30F - Reading the A;D Result Buffer

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
DS70064C-page 17-46 © 2004 Microchip Technology Inc.
17.17 Reading the A/D Result Buffer
The RAM is 10-bits wide, but the data is automatically formatted to one of four selectable formats
when a read from the buffer is performed. The FORM<1:0> bits (ADCON1<9:8>) select the
format. The formatting hardware provides a 16-bit result on the data bus for all of the data
formats. Figure 17-22 shows the data output formats that can be selected using the FORM<1:0>
control bits.
Figure 17-22: A/D Output Data Formats
Figure 17-23: Numerical Equivalents of Various Result Codes
RAM Contents: d09 d08 d07 d06 d05 d04 d03 d02 d01 d00
Read to Bus:
Integer 0 0 0 0 0 0 d09 d08 d07 d06 d05 d04 d03 d02 d01 d00
Signed Integer d09
d09 d09 d09 d09 d09 d09 d08 d07 d06 d05 d04 d03 d02 d01 d00
Fractional (1.15) d09 d08 d07 d06 d05 d04 d03 d02 d01 d00 0 0 0 0 0 0
Signed Fractional (1.15) d09
d08 d07 d06 d05 d04 d03 d02 d01 d00 0 0 0 0 0 0
VIN/VREF
10-bit
Output Code
16-bit Integer Format
16-bit Signed
Integer Format
16-bit Fractional Format
16-bit Signed
Fractional Format
1023/1024 11 1111 1111 0000 0011 1111 1111
= 1023
0000 0001 1111 1111
= 511
1111 1111 1100 0000
= 0.999
0111 1111 1100 0000
= 0.499
1022/1024 11 1111 1110 0000 0011 1111 1110
= 1022
0000 0001 1111 1110
= 5 10
1111 1111 1000 0000
= 0.998
0111 1111 1000 0000
= 0.498
•••
513/1024 10 0000 0001 0000 0010 0000 0001
= 513
0000 0000 0000 0001
= 1
1000 0000 0100 0000
= 0.501
0 000 0000 0100 0000
= 0.001
512/1024 10 0000 0000 0000 0010 0000 0000
= 512
0000 0000 0000 0000
= 0
1000 0000 0000 0000
= 0.500
0000 0000 0000 0000
= 0.000
511/1024 01 1111 1111 0000 0001 1111 1111
= 511
1111 1111 1111 1111
= -1
0111 1111 1100 0000
= .499
1111 1111 1100 0000
= -0.001
•••
1/1024 00 0000 0001 0000 0000 0000 0001
= 1
1111 1110 0000 0001
= -511
0000 0000 0100 0000
= 0.001
1000 0000 0100 0000
= -0.499
0/1024 00 0000 0000 0000 0000 0000 0000
= 0
1111 1110 0000 0000
= -512
0000 0000 0000 0000
= 0.000
1000 0000 0000 0000
= -0.500

Table of Contents

Other manuals for Microchip Technology dsPIC30F