Atmegas are and have been the go-to choice for most DIY enthusiasts and that's owed to the popularity of the Arduino boards featuring them. However, they're not among the most performant and there are some good alternatives. For those of you sharing my thoughts, this article proposes an open-source development board that should bring into the Arduino scene a valid contender, the STM32F030K6T6.
A side-by-side comparison with Atmega328p.
# | Characteristic | STM32F030K6T6 | ATmega328 |
---|---|---|---|
1 | Architecture | 32-bit RISC, Arm Cortex-M0 | 8-bit RISC, AVR |
2 | CPU clock [MHz] | 48 | 16 |
3 | Flash [KB] | 32 | 32 |
4 | RAM [KB] | 4 | 2 |
5 | ADC channels | 16 | 8 |
6 | ADC resolution [bits] | 12 | 10 |
7 | ADC sampling frequency [KHz] | 1000 | 10 / 15.38 max |
7 | PWM channels | 6 (16 bit) | 6 |
8 | SPI | 2 | 2 |
9 | I2C | 2 | 2 |
10 | USB | 0 | 0 |
11 | Package | LQFP 32 | LQFP 32 |
12 | EEPROM [bytes] | 0 | 1024 |
13 | Operating Voltage [V] | 3.3 | 3.3, 5 |
14 | Retailed [USD] | <1 | 2.5 |
Besides the limited operating voltage and that it has no EEPROM, the STM32F030K6T6 is a valid alternative for Atmega328. So, why isn't it catching up?
ST MCUs are generally programmed with ST specific IDEs/hardware and that poses a steep hill for those acquainted with Arduino. Worry not, this problem was solved with the addition of support for these chips in the STM32duino Arduino IDE library. Also, just like the STM32F103C8, this chip can be programmed using a FTDI232 USART device.
A real problem is that there aren't too many development boards hosting this chip. Most of them are developed with specific purposes in mind, such as the Astra.Avia. At the opposite extreme, this easyeda board and this baremetal model are mere SMD-THT pin adaptations. A truly generic board must have enough components to make the MCU kick plus the frequently used development features. So, besides the chip and the PCB, a reset button and a BOOT jumper are handy tools in the prototyping phase and therefore should be part of the design.
This is a breadboard friendly (2.54 mm pitch dual 15 pin header) board measuring 30x40 mm that includes a reset button and a BOOT selection jumper besides the actual MCU. It does have decoupling capacitors for power stability but no oscillator.
It is said, and the internet abounds of that information, that MCUs function badly or not at all without a crystal or ceramic oscillator. The truth is that the internal oscillator is sufficient for most purposes. It is also true that an external one will improve frequency stability but it is not always necessary. If USART communication is stable enough to permit flashing the chip without an oscillator, most developers will overlook that omission.
I invested more time on this design and built the first functional model. It turned out well despite my manufacturing skills. The MCU can be programmed using any 3.3V USART device via pins A9 and A10 while BOOT is set to 1. Switch it back to 0 and will run the written code on each restart. Here's a test LED blink Arduino sketch for it:
void setup() { // pinMode(PA14, OUTPUT); } void loop() { // digitalWrite(PA14, HIGH); delay(1000); digitalWrite(PA14, LOW); delay(1000); }
Note that the MCU's PA14 pin is marked as A14 on the board due to space constraints.
Although the real-estate permits it, this board does not contain a polarity protection diode nor a voltage regulator. It is developer's responsibility to feed it exactly 3.3V.
has this board for now and with this article I launch an open challenge for naming it. An open design should have collaboratively chosen name. Follow this project on Github.