Jump to content
  • 0

AtoD not reading in values


btb4198

Question

ok I am been trying to learn why my AtoD is not reading the right values and then I learned that if I do not plug anything to it, I get the same values as if I did . so something is very wrong.

I am using the uC32 board and I am connect to pin A1 right ? with is pin 15 on the board right ? Please see the attach pic ?

 

so why is it not picking it up?

IMG_1516.JPG

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

Hi btb4198,

How are you initializing the ADC? By default the ADC is disabled, so you wouldn't get any values from any of the channels. I presume you're still working with MPLABX, so I would recommend following the style of initialization sequence as done here through the OpenADC10 function. The 5 parameters that set register values have their registers detailed starting on page 6 of this Microchip document.

Also, make sure that the voltage range you are applying to the ADC on the uC32 is between 0 and 3.3V (since that is all the ADC capable pins are designed to handle)and that both the uC32 and whatever device you are measuring from share the same ground.

Let me know if you have any more questions.

Thanks,
JColvin

Link to comment
Share on other sites

Hi btb4198,

All of the A/D pins on the PIC32 are not 5V tolerant, so as Microchip (and other manufactures) phrase it "applying the higher voltage may cause permanent damage to the device", which essentially equates to frying components within the ADC. The rated voltages are provided on page 179 of the PIC32 family datasheet for the ADC.

The PIC32 itself should be powered at 3.3V for the same reasons (pg 151 of the datasheet). 

However, if you are using external power and powering the uC32 through the 5V regulator, you can use an external power supply rated between 7 and 15V (although the higher voltages may cause the automatic thermal shutdown to trigger if you are drawing too much current). If you are not using the 5V regulator (i.e. bypassing it by switching jumper JP2 to BYP), you may use an external power supply rated between 4 and 6V before exceeding the rating on the 3.3V regulator. Naturally, you would need to supply 5V if you wanted the 5V rail to be at 5V.

Let me know if you have any more questions.

Thanks,
JColvin

Link to comment
Share on other sites

Hi btb4198,

I'm not sure if there is an easy way to tell if the ADC on the PIC32 was fried (at least for the uC32). I would think (I don't know for certain) that it would be just the one channel that would get damaged though.

I don't have any MPLAB X code available (and am not very experienced programming in that environment), so what I would do is set up a voltage divider between 3.3V and 0V to measure a known voltage and see if what the microcontroller reports matches what your calculations (or multimeter) says the voltage is. 

Let me know if you have any more questions.

Thanks,
JColvin

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...