All AnalogIn pins dead on one mbed

21 Nov 2010 . Edited: 21 Nov 2010

Hello,

I tried to run an old program I wrote to test an IR captor using an AnalogIn pin. The program hangs while trying to read the pin. As this looked rather strange, I took another mbed and replaced the first one on the breadboard. After reloading the program on the second mbed, everythnig worked perfectly.

After several tests on the first mbed, all AnalogIn pin (15 to 20) do not work at all. As far as I know all other pins seem to work as I had a LCD screen hooked and some serial too.

Any idea on how I could investigate further and correct this ?

Thanks in advance

 

Stephane

21 Nov 2010

Hi , how do you know they are dead??

Can you blink an LED with those pins ,also try using the AnalogOut p18 to see if it works.

If I'm not mistaken those pins can tolerate up to 3.3. V . Depending on your setup you may have fried them I guess.

21 Nov 2010 . Edited: 21 Nov 2010

attach a potentiometer to 3.3v and ground, read using an analog in.

this code outputs to teraterm, and should allow you to see if the system is working.

#include "mbed.h"

Serial pc(USBTX, USBRX); // tx, rx
AnalogIn IRRF(p18);

int main() {
pc.printf("Hello World!");
while (1) {

pc.printf("%x \n", IRRF.read_u16());
wait(0.1);

}
}

vary the potentiometer, and see if the output looks correct.

21 Nov 2010

I do not know how they fried... Is it one of the kid's mbed. They never connected anything on it yet as they are still playing with internal leds and learning C programming. It was plugged on CoolComponents board so only USB link was used.

I tried AnalogOut on p18 and it is dead too.

DigitalOuts on p15-p20 work well.

21 Nov 2010 . Edited: 21 Nov 2010

Hello Christopher,

I tried your code and the mbed stops running after "Hello World!" as all the tests I did. The IRRF.read_u16() is the stop point.

Thanks for the help.

21 Nov 2010 . Edited: 21 Nov 2010

if you put the read into a variable, and then printf the variable, do you get the same result?

 

as far as I can tell, the ADC is stuffed. unless there is a problem in the stuff connected to the mbed. but if a different mbed works...

email the support@mbed.org on of the guys might have an idea. else just don't use the analog functionality.

21 Nov 2010

Yes, same result. I will dedicate this mbed to cooling my desk as I do not need ADC.