9 years, 3 months ago.

MBed Pin Functionality Bizarre

I am having some very fundamental issues with the MBed and I don't understand why. I am using the NXP LPC1768. When I run example 1 the boards works fine. When I run example 2 the myled pin just stays stuck in high at 3V3. Note the only change between the two snippets is how I define the myled pin. Using the MBed pin names or using the micro pin names I found in the PinNames.h file. There is nothing attached to the MBed other than a usb cable and the oscilloscope I use to monitor the pin. Can anyone advise?

Example 1

#include "mbed.h"

DigitalOut myled(P0_1);

int main() {
    while(1) {
        myled = 1;
        wait(0.2);
        myled = 0;
        wait(0.2);
    }
}

Example 2

#include "mbed.h"

DigitalOut myled(p10);

int main() {
    while(1) {
        myled = 1;
        wait(0.2);
        myled = 0;
        wait(0.2);
    }
}

1 Answer

9 years, 3 months ago.

Well an easier one than your last one ;). They are not the same pins: http://developer.mbed.org/users/mbed_official/code/mbed-src/file/5c73c3744533/targets/hal/TARGET_NXP/TARGET_LPC176X/TARGET_MBED_LPC1768/PinNames.h

Specifically:

    p9 = P0_0,
    p10 = P0_1,

Accepted Answer

Hi Erik. that was a careless typo on my end when I was typing it up here..one should never code past midnight. I updated the code now...however now neither seems to work. Regardless of what I do the pins seem stuck in logic high.

posted by Fiipp Demenschonok 04 Feb 2015

I would guess you are measuring the wrong pin. At least thats what I have done before, sometimes it is not really clear which pin is p9 and which is p10.

So make sure that it is indeed p10 where you are measuring. And on a related note, then also make sure in your I2C problem you are measuring on correct pins and have pull ups on correct pins ;).

posted by Erik - 04 Feb 2015

Broken breadboard was the culprit.

posted by Fiipp Demenschonok 06 Feb 2015