Wierd Mbed probe on DigitalOut [faulty mbed?]

18 Jun 2012

I'm new to mbed so I could be overlooking something basic here! I traced some wierd problem with IR sensors down to something that looks like my mbed ain't working as it should.

Test code:

#include "mbed.h"
Serial pc(USBTX, USBRX); // tx, rx
DigitalOut irEmitter(p22);
DigitalOut myled(LED1);
int main() {
    pc.baud(9600);  
    while (1) {
        irEmitter.write(1);
        myled = 1;
        wait(0.01);
        irEmitter.write(0);
        myled = 0;
        wait(0.5);
    }
}

I stuck pin 22 on a logic analyzer (afaik a dirty one with Arduino)and I see that pin 22 (irEmitter) misses "beats" now and then. I don't get a nice and regular pattern I should get but see some holes there where pin 22 doesn't get activated! Theres nothing connected to mbed for this test, just a probe on pin 22. And yes, the led blinks as it should, no gaps there it beats as expected.

Here's a screenshot of the logic analyzer output for pin 22: http://i50.tinypic.com/264q1s2.png

As you can see it misses some beats, it does not look like there's a pattern to missed beats either. Tried pin 21 with the same results. Did I get a faulty mbed or am I missing something BIG?

19 Jun 2012

Ok, confirmed, I don't have a faulty mbed, I have a crapy logic analyzer.