7
\$\begingroup\$

While trying to get the ADC of the dsPICF3013 working (I am getting only zeros back), I have studied the datasheet and the (I will call it) ADC reference for the dsPIC30F family. Previously I only worked with the ADC of the PIC16F, so now I have to face a lot of more options.

The ADC is configured to use \$AV_{DD}\$ as the positive voltage reference and \$AV_{SS}\$ as the negative voltage reference. The ADCON2.VCFG<2:0> configuration bits are set to 000 (see page 18-6 of the ADC reference). As I understand it the \$V_{REF-}\$ and \$V_{REF+}\$ pins are now available for general use (although I did not find it documented explicitly).

But taking a look at Table 16-1 and Figure 16-2 on page 116 in the datasheet, it looks like the \$V_{REF-}\$ and \$V_{REF+}\$ pins always have to be connected. Especially the diagram in Table 16-1 confuses me (I marked it red. Shouldn't I be able to connect it to \$AV_{SS}\$?).

Table and figure

The first part of my question: Do I always have to connect the \$V_{REF-}\$ and/or \$V_{REF+}\$ pins or can they be turned into general purpose pins?

The second part of my question refers to the ADCHS.CH0NA configuration bit on page 18-8 in the ADC reference. Here I can set the negative input (=negative voltage reference?) to the ADC: AN1 or \$V_{REF-}\$. AN1 is obviously a pin. But what about \$V_{REF-}\$? They map both to the same physical pin. Does \$V_{REF-}\$ in this case refer to the settings of the ADCON2.VCFG<2:0> configuration bits or to the actual pin (that wouldn't make sense at all)?

I ask this second question, because in table Table 16-1 I mentioned above they (\$V_{REF-}\$ as negative voltage reference vs actual pin name) are not the same.

\$\endgroup\$
  • 1
    \$\begingroup\$ I havn't looked at that datasheet in particular, but If you are using AVdd and AVss as the A/D references, then you shouldn't have to drive the Vref pins to a particular value. In fact, they should be configurable as digitial pins then. \$\endgroup\$ – Olin Lathrop Apr 23 '12 at 13:54
  • \$\begingroup\$ @Olin Lathrop - that was my first guess (with my limited experience with PIC 8-bit micros). But then I stumbled over the part in the datasheet that I have now marked red in my question. \$\endgroup\$ – PetPaulsen Apr 23 '12 at 14:29
  • 2
    \$\begingroup\$ the diagram you attached is a simplified diagram of the ADC system. check figure 18-1 on the adc reference, and you will see the VREF+/- always has to be connected, but this connection can be internal or external. with your configuration, the connection should be made internally, meaning the actual physical VREF pins are disconnected from the internal reference circuitry, while VSS and VDD are connected. So i don't think VREF connection is your problem, maybe your sampling rate or signal levels might be off somehow. \$\endgroup\$ – TiOLUWA Apr 23 '12 at 16:43
  • \$\begingroup\$ @TiOLUWA - Outch ... I realy missed that figure. It clearly shows that the negative input can be connected to \$AV_{SS}\$. You should make your comment an answer to get some reward. \$\endgroup\$ – PetPaulsen Apr 23 '12 at 17:09
  • \$\begingroup\$ Make sure your reference V and signal ground are clean too by doing a monotonic ramp test. I once did this and found an expensive Burr Brown 12bit ADC had dead codes near binary block transitions and had to replace them... SO many people assume 4000:1 is easy to achieve for s/n ratio in both signal and Vref. FWIW \$\endgroup\$ – Sunnyskyguy EE75 Apr 24 '12 at 3:17
1
\$\begingroup\$

Your assumption is correct. They do not need to be connected. The red circled part is confusing from their end... The Vref- they refer to is the internal Vref- rail: either from the Vref- pin or from the Avss, depenging on your configuration. Using the Avss as the Vref- would also unlock AN1 as a normal analog (or digital) I/O.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.