The Flash button story

A project log for MagicShifter 3000

The MagicShifter 3000 is an open source hardware gadget for RGB lighting, gaming and POV (persistence of vision) applications.

overflooverflo 08/22/2016 at 21:140 Comments

I wanted to add one technical detail about the buttons on the MS 3000 and the way the ESP8266 bootloader works:

So there is this GPIO0 pin on the ESP that you have to pull down during bootup to activate the bootloader.

It just makes sense to place a button on GPIO0 because you need a way to controll the bootloader and since we only have so few pins on the ESP we also want to use it to interact with the user and call this button "B".

This create a nasty problem.

The user might accidentally press the "B" button while turning the MagicShifter on.
This will activate the bootloader and the MagicShifter awaits a new firmware.
For the user it looks like it has crashed :(
So we either hide the button from the user (and waste a pin :| ) or we find a solution to detect the bootloader state in hardware!

The ESP tells us that it's in bootloader state by emmitting a high frequency pwm on GPIO0.
We can easily detect this very reliably with a filter (it only cost 10 cents in production).
If (and only if) the bootloader state is activated we wire the second user button "A" to the Reset input via a FET controlled by the bootloader state signal from the filter.
As a side effect we get a status LED that shows the bootloader state for free.

When the shifter looks crashed the "dummy" user response would be to just press all buttons.
As soon as the user presses button A she triggers a reset.
This time chances are hight that "B" was not also accidentally pressed so it will boot up normally.