The Electronics

The Maple Mini is essentially a one-to-one breakout for the STM32F103CBT6, which is a 48-pin variant of the STM32F103. Its features are summed up in this eloquent diagram :

It’s a Chinese module, you’re not going to find much documentation because there probably isn’t any. All part of keeping costs as low as possible, I guess. That means there’s no schematic.

However, this Chinese module is based on a well-documented design and retains all its functionality. That means we can use the original’s schematic and some observation skills to understand how the Chinese Maple Mini works.

First, let’s start with a pin map :

Perhaps the key reason I like this module is that is really a breakout : all of the MCU’s pins are brought to pin headers. Yes, there are 40 pins on the module while the MCU has 48 pins, so there seems to be a few missing, but the losses are acceptable :

  •         Two pins are connected internally to an 8 MHz crystal, the main clock source for the MCU.
  •         PB1 is connected internally to an LED. If you’ve ever microcontrolled, you know how useful it is to have an LED already wired to an I/O pin. If not, keep reading : we’ll use it soon enough.
  •         PB9 is connected internally to a discrete transistor circuit. The role if that circuit is to let the MCU “fake” a USB disconnection. We’ll talk about this when we use the MCU’s USB.
  •         BOOT0 and PB8 are tied together. BOOT0 is only used when the MCU is reset, to determine how the MCU boots.
  •         And of course, the MCU has several supply and ground pins that are tied together on the board.

Let’s go through the original Maple Mini schematic and spot the differences with the Chinese version :

1.1.        MCU

Nothing to report, here. In terms of layout, the bypass capacitors on VCC are mounted on top of the module rather than at the bottom. The RESET circuit is exactly what you’d expect. Because it uses a normally-open button it can drive and be driven by external electronics. The user button has a pull-down, meaning you’ll be reading a zero by default and a one when the button is pressed.

Make note of the crystal’s 8 MHz frequency : this value will need to be entered into the device configuration software. The STM32F103 also contains a low-frequency oscillator used by its real-time clock (RTC). This would normally require a separate 32.768 KHz crystal but none is present on the module. It’s good news if your application doesn’t require an RTC, because it means you get two more I/O pins. If you do need an RTC, you can always connect a suitable crystal to those pins.

1.2.        Power Supply

The original Maple Mini did things “by the book”. Specifically, here, it used two separate LDO regulators to produce two separate 3.3 V rails : one for digital logic and one for the analogic parts of the MCU (the ADC). The Chinese replaced this design with a single, larger LDO that feeds both rails.

This does make the module cheaper. It also means there are cases where the accuracy of analog voltage measurements with the ADC will suffer. This can be mitigated by not performing ADC operations at the same time as high-speed digital I/O operations. If it can’t be avoided, remember that this module is really meant to be used only for prototyping. You’re supposed to design your own circuit board eventually, at which time you’ll be free to implement any and all signal integrity improvements your heart desires (…or your spec requires).

The original module’s LDO’s can deliver 250 mA each. The Chinese module uses an AMS1117-3.3 which can deliver 1 A. So there’s a silver lining : you can easily power additional electronics off the 3.3 V produced by this module.

Maximum input voltage is 15 V, and the module is not designed to allow heat dissipation through the circuit board’s copper. That means you really shouldn’t expect to draw 1 A out of this module if you feed it 15 V, but if you feed it 5 V you should be fine.

For reference, 15 V means a LiPo 3S battery will work just fine but not 4S battery.

1.3.        Power Supply Protection

There are two ways to power the module :

  •         Through its pin headers, via the pin marked “VIN” (near the buttons)
  •         Through its USB connector

As you can see on the previous schematic, there’s a Schottky diode to protect the USB 5 V input. This ensures that your prototype can’t feed power into a computer via a USB cable.

There is, however, nothing to protect the VIN pin.

The reasoning is that you may want to prototype a USB-powered device with this module. In that case, you may also want to use the 5 V from the USB host to power additional electronics.

If that’s your plan, remember that USB devices are not supposed to draw more than 500 mA from a USB port, in total. This includes whatever the MCU itself is going to use. Unless you’re certain of your electronics and its behavior as a load, I strongly recommend you avoid using USB to power your prototypes.

If you intend to power your prototype from a separate source, like a big battery or a mains power supply, and you will also be using USB, then you will need to add your own Schottky diode between your supply and the module’s VIN pin. This is to ensure that a PC can’t feed power to your power supply if you plug in a USB cable.

A good choice of protection diode would be 1N5822 (pass-through packages) or SS34 (SMD packages). Those diodes will only cause a 0.5 V drop, and that’s actually very important : the Maple Mini’s LDO has, itself, a drop-out voltage of up to 1.3 V depending how load. That means it needs at least 4.6 V to produce 3.3 V, and if you add that Schottky diode you’ll end-up with a minimum of 5.1 V to power the MCU.

1.4.        USB Connector

The Chinese module uses a simplified version of this design, but the effect is the same. To keep a long story short, its main purpose is to force D+, which will cause a USB host to act as if the MCU had been disconnected (hence the name of the DISC signal). When the DISC signal is released, D+ returns to normal, simulating the insertion of a USB plug. This will trigger the USB host into enumerating the MCU.

In other words, this whole mess of transistors and resistors is here to make your life more comfortable by eliminating repeated “un-re-pluggings” of the USB cable. It’s especially useful when using a USB bootloader to develop code that uses the USB.

1.5.        Bottom Line

The Maple Mini is essentially a breakout for the STM32F103CBT6; it gives you access to almost all the pins of that microcontroller. It is not intended for applications where ADC performance is critical. It is not intended for applications which require a real-time clock. In both cases, it’s still a good base on which to build a first prototype.

It is very suitable for developing USB devices, although you’ll be limited to USB 1.1 (12 Mbps)