MDBT42 reset button with 4 pin switch

Posted on
  • Using the MDBT42 bare module in a custom board, and I had a question about the proper wiring of the reset button (BTN1) in order to get the module to enter boot loader mode.

    We are using a button with four pins since it is a stock part at our PCB fabricator and makes for a significantly cheaper build.

    With the current schematic I am able to press the button and have the module reset as expected, but I am unable to get it to go into boot loader mode when applying power with the button pressed down for a split second.

    I feel like I may be missing something really obvious here, any ideas?

    1 Attachment

    • Screen Shot 2018-06-29 at 2.09.34 PM.png
  • The button connects (if pressed) VCC (3.3V) to Ground producing a short.

    If you want to pull a pin to ground you should always use a resistor e.g. 10k and not tie it directly,
    see:Ā­sistor for details.
    Note: The article describes pull-up, but the same principle applies to pull down.

  • I think there's a bit of confusion about the wiring of the 4 pinned switch? The two pins at the top of the symbol are just shorted together, and the two pins at the bottom are as well. When pressed, the switch shorts top to bottom.

    As @AntiCat says, when the button is pressed you're shorting 3.3v to GND, which is what is causing the reset. In normal use, that button doesn't actually reset the device (it's usable from your code), it just enters bootloader mode if you power the device on with the button held down.

    You don't need a pullup/pulldown resistor in this case though because Espruino uses the chip's internal resistor.

    So basically all you need to do is remove the connection from the button to GND (top left), and it should work fine. If you've got prototype PCBs with this on you should be able to just cut the trace with a knife.

  • @Gordon @AntiCat Thank you both so much!

    I was indeed a bit thrown off by the 4 pin switch and had originally grounded the OFF state based on feedback that it was needed to prevent a floating button state.

    Still learning this stuff and really appreciate your detailed explanation :)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

MDBT42 reset button with 4 pin switch

Posted by Avatar for Ignigena @Ignigena