Digital Outputs pulse on at startup

13 Apr 2013

Has anyone observed this behaviour - at startup or straight after reset, any pins attached to a DigitalOut object will pulse on for a short time, even if the object is not referenced anywhere in the program. This is really undesirable for some equipment/devices attached to those output pins.

Any ideas on how to avoid this from happening?

regards, Adrian.

13 Apr 2013

Haven't noticed myself, but what kind of pulse length are you talking about? At start up all pins are digital inputs, either with pull-up or pull-down, I forgot which one is default (I would expect pull-up, but not 100% sure, could also be high-Z). So if you define them as digital outputs with value 0, it will be 1 at start up and as soon as they are set as outputs they will go to zero. I think the only thing you can do about that is add external pull-downs in this case which make sure they stay at zerountil they are defines as digital outputs.

14 Apr 2013

The pulse duration is around 360msec straight after power on. I have tried a fairly strong external pull-down of 2k7 and no other external circuit connected and still get a voltage of 1.5V. With a 8k2 pull-down the voltage is considerably higher.

Test Digital Outputs - main.cpp

DigitalOut myled(LED1);
DigitalOut      Relays[2] = {(p5), (p6)};

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

It seems there is a strong pull-up or the output is actively being driven.

regards, Adrian.

20 Jan 2014

I have the same problem.

21 Jan 2014

Hi

We had the problem too.

It's seems to caused by the mBed hardware to come up with I/O set to 1 outputs (without a chance to set a default value). Normally you would expect I/O to be tri-state or input with you can pull with a resistor. This is very unusual for I/O ports and CPU's.

The only way around it was to invert all outputs driving external hardware. So in out code the 1 output remains (and is inverted to be a 0 for the attached hardware) after our code starts. So no workaround, just cope with this quirk in the design of your hardware.

It also seems to be related to the (USB) power being applied so we also had to add a powered hub to keep the mBed powered when the PC is not attached.

regards wvd_vegt

21 Jan 2014

LPC pins are initially always a rather weak pull-up. Thats just the way the microcontrollers are designed (there is something to say for it, but it also has downsides). But there are multiple things that can be a problem, so you (Sven/Dario) should describe which one is specifically for you. The standard pull-up should be possible to counteract with an external pull-down, the internal one is around 50kOhm.