Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Unable to read some PIC32 ADC channels

Status
Not open for further replies.

SUPER COPTER

New Member
Hi, i'm using a PIC32 development board "Pinguino-OTG":
pic32-pinguino-otg-1.jpg

The microcontroller used in the board is a pic32mx440f256h.

I've tried several types of configuration codes and read functions. No matter what, i can't read the AN11 port (of the pic) which is connected to the AN6 pinheader on the board.

I've already cheched the pic32 datasheet and didn´t find anything that could help.
Also cheched the errata document, and it says something about using the ICSP2 port for programming, which seems to be the one used in my board.
Here is the Pinguino schematic if it is any use.

I first checked disabling JTAG, which shares the same pins than the ADC 10 and 11 channels. it seemed to solve the problem for channel 10, but no luck with channel 11...

Currently i'm troubleshooting with a multitester and before trying any readings from ADC or anything started with a simple code, setting the port direction to output (TRISB=0x0000), then setting the whole port as digital (AD1PCFG=0xFFFF) and sending individual output bits (LATB)...

The voltages for the outputs change as espected for AN0-3 of the board (AN1-4 of the pic), AN4 and 5 of the board show 3,3v. I assume this is because of the I2C port which i'm using and shares pins (still wired cause i didn't initialize I2C in the current project)...

The AN10 and 11 pins show the wierdest behaviour: AN10 shows 0v and AN11 shows 3,3v no matter what i do. As i said before at the beginning i thought it would have something to do with JTAD, but still no luck after disabling it.


I don´t even know if this has something to do with my problem. But i assume that not being able to swith the pins (AN10, AN11) in "digital mode" may have something to do with my problems in analog mode.

Im using Mplab8 and C32 compiler. Also loaded plib, but i've tried writing the raw registers.
 
I did confirm on the schematic and on their layout A6 and A7 connect to nothing else. The first thing I saw was that AN11 shares TDO, so thought it might be a JTAG issue, but you said you disabled that. Did you check with a multimeter or a lens if there were any solder bridges or shorts? A7 (RB11) pin is right beside one of the I2C pins which is pulled high.

I have not used PIC32's, so my help is limited on this.

Yes, A4 and A5 are attached to the I2C pullups, so they are useless as ADC lines unless those are removed and will always show 3.3V.
 
I've never used any 32 series, but generally on PIC's (and anything else) it's down to a configuration issue - and the pins are been configured as 'something else'.
 
thank you for your help. problem solved. the analog input was, as Ian said, gone south... changed the board for a new one. everything works fine now.
thanks!
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top