Let's start with a Blue Pill Dec 2016
If you search for “stm32f103c8t6 board” on eBay, you will get lots of hits for what is essentially a single product, to be called the “Blue Pill” from now on:
The price of these boards is absolutely incredible, you could get 10 of these for the same price as an official Arduino Uno. At these prices, which are lower than the official price quoted for the µC chip alone, it’s really tempting to permanently include one in every project.
The “Blue Pill” name, by the way, appears to have originated in the STM32duino forum.
As you can see, the board is very nicely labeled. All the pin names are clearly visible and correspond to the pin names in the STM32 datasheets for this chip. Some notes:
- “G” is ground, and it’s available on 3 different pins
- “3.3” is 3.3V, i.e. the output of the on-board linear regulator (on two pins)
- “R” is RESET, “VB” can be connected to a 3V battery to keep the RTC running
- “PC13” is connected to an on-board LED, which turns on when set to “0”
- the mini-USB jack is connected to the USB interface built into the µC
- the two yellow jumpers control the startup boot settings, default is as shown
- 4 pins on the right are for SWD programming (a bit like ATmega’s “ISP” mode)
There’s an 8 MHz crystal on-board (it starts up using the internal RC oscillator, but can switch over to the crystal on the fly), as well as a 32 KHz crystal to drive the internal Real Time Clock. On the bottom side, there’s a small 5V => 3.3V regulator and some resistors and capacitors:
On to the microcontroller itself, which is labeled “STM32F103C8T6”:
- STM = the vendor, STMicroelectronics
- 32 = 32-bit, i.e. ARM series
- F103 = model, “F1” also indicates that this is an ARM Cortex M3
- C = 48-pins
- 8 = flash memory size is 64 KB
- T = package type is LQFP
- 6 = temperature range -40..+85 °C
Rumour has it that these chips actually have 128K flash inside, but they are labeled as 64K and they do report 64K when queried. Maybe the flash failed QA testing, or maybe it’s as harmless as someone having made a mistake with the laser-etched label on the outside - who knows?
There is 20 KB RAM, a huge amount compared to ATmega’s and other 8-bit AVR’s.
As for the rest of this chip’s hardware, there’s a good summary on the datasheet front page:
More details for this model can be found on page 10, in the 2nd column (STM32F103Cx):
The home page for this microcontroller is on the STM site. The datasheet is called DS5319 (PDF), and if you really want to know everything there is to know about this chip, you’ll also need to download the RM0008 Reference Manual (1137 pages!) and the ES096 Errata Sheet.
The 12-bit ADC for up to 1 Msps and USB, CAN, DMA… there really are a lot of quite advanced features in this little fingernail-sized package. And all that for just a few bucks…