Mbed not working...

09 Feb 2014

Hey everyone,

I face some troubles using my Mbed, but I hadn't encounter this problem before. When I try to put a binary on the device (the simplest one like the Hello World with blinking leds), the status led blink and the program is saved.

But when I reset the Mbed (pressing the reset button), the program doesn't start. I have tried to format the card and save different programs but without success.

My problem is that I have difficulties to understand what happens because, sometimes (rarely), the program finaly starts (with blinking leds)... At least, it means that the card can work... but why randomly ?

Thanks... Simon

09 Feb 2014

Is anything else connected to mbed? Maybe resetpin is pulled low? Is your powersupply OK. Perhaps the USB cable is bad and leads to errors.

09 Feb 2014

Random errors like that are almost always either a poor connector or power supply problem (often both!).

09 Feb 2014

I see you have an LPC1768, which is nice since it stores the binaries. If you store a binary, unplug it, plug it in again, and then check the mbed drive: Does it have the binary you stored? In the correct size? If no, I wouldn't be surprised if it is the USB cable.

14 Feb 2014

Just yesterday, im facing a more complex same sort of problem like mbed not working! I have 2 1768s out of which one was untouched and the code that was proven to work(I had like 10 binaries) still the code doesn't work as it used to work previously!

I'm Driving LEDs the ws2801 led strips which were working all fine from the last 15 days all is fine too: a. I checked the pins they are all right Im using the p11 and p12 , I checked them with a multimeter and also the putting an LED over them the blink code works on the LEDs meaing that the GPIOs are all fine!

Then checked the strips ,its all fine, I check them with some code for the ws2801 proven to work for Arduino and it works there too!

WHY NOT THE mbed?

ohh and its not the long cable issue either as the binaries are landing all fine as the size is the same and also the blinky binaries proove that the code is running fine on the mbed

AND ALSO I have a colleague in USA who has the entirely same setup he reported the same code working and also gave me the video! but why isnt it working here? The connections are quadruple checked I mean there arent many connections! just the plain Data and clock lines!

Is it something changed over the course of yesterday ,I mean some sort of compiler update? OR perhaps some CMSIS tinkering?

13 Feb 2014

@Nishant Sood: ask your US colleague to mail you his binary and see if that works. Then get his source and recompile to see if it works.. Could it be a powerproblem that causes mbed supply to drop when you try to drive all these LEDs?

13 Feb 2014

Hi Wim,

Yes Hes sleeping I have already asked him to mail me the binary!

Not the power problem the strip I have tested is 160/320(2 joined) and like that also I have 6 full rolls of the ws2801 led strip so not all should be problematic plus I have tested the same wiht the ATmega it works there!

The US colleague is compiling the code what I have so getting his source won't be any helpful, hes actually able to workout the same code, so at that Time I though that definitely it has to be a hardware problem but as I tested with atmega is works there meaning no hardware issue, checked the mbed pins over and over still all Fucked! up what a ridiculous shit is happening to me!

13 Feb 2014

Hi

Is your mbed upgraded with the CMIS-DAP loader? In that case I noticed that pressing the flash button no longer seems to work (and you can only program it using an IDE with a CMIS-DAP enabled debugger).

regards wvdv

13 Feb 2014

Hi Win Van,

Well I didn't upgrade my mbed with CMISIS loaders! Its just the plain one that comes and is activated with the standard regime, I don't think I ever did that sort of stuff! Is it needed now with the compiler? How to go about it?

13 Feb 2014

If you have 320 LEDs a power problem doesn't seem to be that unlikely.

How do you power it? Does your mbed have a seperate power supply from your LEDs? For example via USB, while LEDs use whatever power supply they use? Is the ground properly connected between your LEDs and your mbed?

13 Feb 2014

ERIK,

Thanks for Chipping in.

Well the LED strips are powered from the external supply while the mbed is powered through the usual usb link , the grounds of the led strips connected to the GND of mbed and to the 5v WHOOPING 12 amps power supply which isn't a less amount of current at all! for these 320 leds.

13 Feb 2014

You didn't mix up the data wires? Do you have a scope or logic analyser to check the data is being sent?

13 Feb 2014

I have one concern though and that is as we know that the ws2801s max clocking is at 25Mhz but I have been successfully fucking! them with 100Mhz of clock of the mbed for like 15 days can it be:

a) That the data line of the ws2801 got its intake registers overwhelmed with that sort of data and got fucked up alltogether(the same kind of stuff that happens to SPI MISO line! ). b) BUT.. if a) is correct then how those fucked up registers are still working with the 8-bitter ATmega all fine? c) Or any other stuff arising due to the clocking!

But if clocking is a reason ,you people don't think that it may have happened on the very first time!? (I'm just been digging deep into every aspect so now scrutinizing every minute detail that may have gone haywire!)

13 Feb 2014

You didn't mix up the data wires?

No there are just 2 wires one for Data RED and other for clock that is WHITE shouldn't be a problem, even if it is mixed one can check it all at all times by running mbed on both type of connections with like RED at a spot and WHITE at b spot to have the thing working! if its just wire swapping gone wrong.

Yes I have a oscilloscope, I'll have to see to it but as I check the health of the pins with multimeter and leds that its working dont you think its enough?

ALSO I have tried using the logic level conversion(3.3v to 5v and vice versa) but that didnt have any effect either.

13 Feb 2014

The mbed runs at 96MHz, but your SPI doesn't. Its max is 48MHz. If it can handle 25MHz only I certainly wouldn't put it on 48MHz, but it should not be able to result in permanent damage.

13 Feb 2014

Regarding scope: something is preventing the LEDs from turning on. The pins apparantly work, but options then are that either the mbed doesn't send correct data or the LEDs don't receive correct data. So checking if something is sent is nice.

Btw it isn't that it sends data to turn off all LEDs?

13 Feb 2014

Erik,

I did the PLL thing to change the clock of the mbed to 100Mhz(also tried various low levels around 40Mhz) , I used the CMSIS routines to do that and 3 to 4 days I used it with the changed clock.

routine to set the clock:

void pllfeed()
{
    __disable_irq();
    LPC_SC->PLL0FEED=0x000000aa;
    LPC_SC->PLL0FEED=0x00000055;
    __enable_irq();
}

void setpll()
{
// the MBED crystal oscillator is 12 MHz
// main oscillator frequency 300 MHz: M = (300 x N) / (2 x 12)
    int n=2;
    int m=25;
// processor clock 100 MHz = 300 MHz / D
    int d=7;
// disconnect
    LPC_SC->PLL0CON=0x00000001;
    pllfeed();
// disable
    LPC_SC->PLL0CON=0x00000000;
    pllfeed();
// set new PLL values
    LPC_SC->PLL0CFG=((n-1)<<16)|(m-1);
    pllfeed();
// enable
    LPC_SC->PLL0CON=0x00000001;
    pllfeed();
// set cpu clock divider
    LPC_SC->CCLKCFG=d-1;
// wait for lock
    while (LPC_SC->PLL0STAT&0x04000000==0);
// connect
    LPC_SC->PLL0CON=0x00000003;
    pllfeed();
}

ALSO I'm not using any SPI hardware of the mbed to do what I need! actually i'm using the straightforward bit banging 2 wire communication from the mbed to strip so it technically is receiving a 100Mhz signal or whatever frequency signal as per the clocking of the LPC1768.

Okay try with oscilloscope! .

13 Feb 2014

Don't worry, there is no way you bitbang at 100MHz output frequency, that will be significantly slower than 25MHz in the end ;).

13 Feb 2014

"Don't worry"

Erik, man............I'm running out of options then lets see what the signal says!

13 Feb 2014

Erik,

Nothing on the scope!

13 Feb 2014

Try it without the LEDs connected, and else recheck your program again (if the correct bin is on it). Try other pins and check those with scope, etc ;)

13 Feb 2014

Erik,

The Binary from my colleague in the USA works like charm! I'm happy for the fact thatits not because of my fault!

13 Feb 2014

With same code? Then I guess it is a different version of the mbed lib, at least that is only thing I can think of, but it shouldn't matter.

13 Feb 2014

Yes with the very same fucking code it works just that he compiled in the USA and I at my place he compiled at the same time.he sent me the binary today.

How should I check for the changed mbed library. I didn't changed it! How to revert back in such a case?

13 Feb 2014

So are there any specific areas where I should look for like the revisions? Or any other place? Or perhaps make a new project and add The same code? I think this may work! What do you say?

13 Feb 2014

If you click on the mbed lib in your code, there is at the right side na update button if there is a newer version. But as I said, I really don't know why a different mbed version would matter in this case.

14 Feb 2014

Erik,

Its still now working?

I'm even using the same USB cable to drop that working binary from US and my binary compiled here.

14 Feb 2014

Is it or isn't it working? For sure you really must be compiling different than those in the US if that works. Are you compiling for the correct target?

14 Feb 2014

It is working very fine as it should! with the binary compiled in the US

But not working when I compile the very same code here in my browser, and I have 2 browsers chrome and firefox ,tried with the same account from both many times.

Then also tried making a new account and working out the same code but still the same!

14 Feb 2014

Yes I'm compiling right for the LPC 1768