Search code examples
roboticsbbc-microbit

Microbit doesn't run flashed program when seated in Max:bot


My son bought a Max:bot DIY Programmable Robot Kit, which uses a BBC Microbit.

Max:bot

You can see above where the Microbit slots in.

What works ...

To set the scene of our problem, we'll set aside the Max:bot for a moment and just consider the Microbit in isolation ...

Using Microsoft MakeCode, we can code a simple program to drive the LEDs on the Microbit. With the Microbit unseated from the Max:bot, and connected to a Mac over USB, we can successfully flash the Microbit with our program. As the USB cable provides power for the Microbit, the program begins running, and illuminates the LEDs as expected. If we press the Microbit reset button, the program runs from the beginning as expected.

Furthermore, if we remove the USB cable (removing the power source), and then re-cable the USB cable (providing power once more), the Microbit immediately runs the program. This shows to us we have successfully written the program to the Microbit's flash memory as it is persistent across power on/off cycles.

I note that when we power the Microbit via the USB cable, a yellow LED on the rear of the Microbit near the USB port is illuminated.

What the problem is ...

Let's now bring the Max:bot back into the fold ...

The Max:bot has a battery pack and (it would seem) provides power to the Microbit independently of the USB cable.

If we do not have the USB cable plugged into the Microbit, and we seat the Microbit in the Max:bot connector, and we turn on the Max:bot, then the Microbit appears to power on but does not run the program stored in its flash.

The Microbit instead initialises with this sequence shown on its LEDs.

boot

I note that when powered via the Max:bot, the aforementioned yellow LED on the rear of the Microbit near the USB port does not turn on.

The question is then, why doesn't the Microbit run the flashed program when it is seated in and powered by the Max:bot.

A final observation ...

The following sequence does run the program:

  • have the Max:bot powered off
  • cable the USB to the Mac (Microbit powers on, loads program from flash)
  • turn on the Max:bot
  • uncable the USB

The question then is why is the USB required to be connected for the Microbit to boot from flash? (Because it's not practical to do so when you've got a program that actually drives the bot around).


Solution

  • From the images you have shared of the LEDs on the micro:bit when it is in the Max:bit it appears to be entering "Bluetooth Pairing Mode". This mode is entered when holding down buttons A and B on the front of your micro:bit while powering on the device. The signal for those buttons are also available on the edge connector.

    My assumption here is that Max:bit is using P5 and P11 and so it appears to the micro:bit that button A and button B are being held down when Max:bit is powered.

    Looking at the assembly guide it would appear that there are some LED strips that might be the culprit for this.

    enter image description here