back to menue

back to CForth Low Power STM32G431/441, STM32F042

CForth Low Power for STM32F030K6

Here the latest result of my CForth Low Power project is presented separately. The intention for this project is to get a tool for control dynamic art installations powered by small solar panels or other "weak" power sources using the Forth programming language.

STM32F030K6 processors are quite easily available for low cost, but offer only 4kB SRAM. So this version is only useable for small projects (up to ca.50 user programmed code threads). Else all features are very similar to the STM32F042 version:
The basic system frequency is 921.6 kHz, derived from a 3.6864MHz or 14.7456MHz crystal oscillator. A by-product is a 48MHz version with features comparable with the standard STM32F042 CForth, but without USB. The chosen system frequencies allows standard RS-232 Baud Rates up to 115200. The RS-232 interface does not draw current except during data transfer. The RS-232 transmitter is extremely simplified, but has been tested with several standard RS-232 receivers.

Another critical aspect of supply current is the quality of the 3.3V regulator. For this reason, on the Veroboard compatible PCB design, a layout for MCP1702 (ca. 0.01mA ground pin current) is provided. LP2950 or LE33 regulators fit into the PCB layout: mounted ca.135 degrees counter clockwise with respect to the MCP1702 position. The middle pin of LP2059/LE33 is Ground instead of Vin at MCP1702.
The LED should be a very efficient blue or white type. To save current, a special CForth kernel operator "LED" is introduced to switch the LED off when not needed. With 10kOhm serial resistor, a blue LED uses about 0.1mA.

Below the line: The STM23F030 prototype uses ca.1.1mA (921kHz system freq. with 3.68MHz crystal) measured behind the voltage regulator and with LED OFF. (Ca.1.9mA at 3.68MHz system freq. and ca.1.6mA at 921kHz system freq. with 14.74MHz crystal.)

LowPower Hardware with STM32F030K6 processor:

F042 TSSOP Veroboard photo Veroboard assembly for STM32L031, STM32F042, STM32F030 (32pin LQFP on DIL32 breakout board. Pinheads instead of IC socket).

Typical features of CForth LowPower Firmware for STM32F030:

The set of Kernel Operators and their features is almost the same as the standard CForth version, with lower execution speed of course.
The User Thread code storage for STM32F030 is derived from the compact code for STM32F042 processors. In contrast to the straight 32bit code for STM32G431, it is compacted to 8bit format, which increases the maximum User Forth code volume up to 3 times at the price of slightly slower code runtime (details see CForth Operating Manual, p1,2).

The most essential differences against standard CForth:

A detailled CForth Operating Manual Standard version (PDF file), and
a DIY Construction Manual Low Power version (HTML file) is provided here.

A good tool for Forth source code upload is my DTerm Windows terminal software. It is surely not the best terminal emulator, but has been developed over the years for best fitness with my actual projects.

Downloads:
The subsequently downloadable material is copyrighted (c)2020-24 by Wolfgang Schemmert.
Assembly of the devices, programming and use of the software is permitted for free by everybody for any purpose ("freeware"). For commercial use, restrictions of third-party software contributors (Segger GmbH, STM) must be respected.
All information is based on best knowledge, but "as is" and without any warranty. Any responsibility is excluded. Use for dangerous, life-threatening and medical applications is forbidden.

Firmware "CForth-LP-F030-3m6pwm2.hex" for 32pin LQFP Veroboard compatible PCB. CPU Clock = 921.6kHz/3.6864MHz switchable. Uses 3.6864MHz crystal. Code for PWM2.
(09 April 2024 - bugfix and minor improvements)

Firmware "CForth-LP-F030-3m6motor.hex" for 32pin LQFP Veroboard compatible PCB. CPU Clock = 921.6kHz/3.6864MHz switchable. Uses 3.6864MHz crystal. Code for stepper motor.
(09 April 2024 - bugfix and minor improvements)

Firmware "CForth-LP-F030-14pwm2.hex" for 32pin LQFP Veroboard compatible PCB. CPU Clock = 921.6kHz/14.7456MHz switchable. Uses 14.7456MHz crystal. Code for PWM2.
(09 April 2024 - bugfix and minor improvements)

Firmware "CForth-LP-F030-14motor.hex" for 32pin LQFP Veroboard compatible PCB. CPU Clock = 921.6kHz/14.7456MHz switchable. Uses 14.7456MHz crystal. Code for stepper motor.
(09 April 2024 - bugfix and minor improvements)

Firmware "CForth-LP-F030-48pwm2.hex" for 32pin LQFP Veroboard compatible PCB. Code for PWM2.
Designed for the same hardware as described here and the same firmware features but equiped with an 8.0MHz crystal and uses the processor built-in PLL to work with 48MHz/3MHz AHB and APB frequency.
CPU Clock = 48.00MHz/3.00MHz switchable. Default = 48MHz.
Provides more Flash and some more I/O features than the standard version.
(09 April 2024 - bugfix and minor improvements)

Firmware "CForth-LP-F030-48motor.hex" for 32pin LQFP Veroboard compatible PCB. Code for stepper motor, else general description as above
(09 April 2024 - bugfix and minor improvements)

Source code "CForth-LP-F030-v5.zip"
(state 09 April 2024). This source code is provided as complete "Segger Embedded Studio" project (ZIP file, 410kB).
Parts published by Segger GmbH are under license of Segger&|Rowley, parts published by STM are under license of STM, parts programmed by me are provided under GNU GPL3 license.

These projects are programmed directly on register level, no external libraries (except "cmsis", startup code and Segger system code), no external drivers or HAL are used.


back to CForth Low Power STM32G431/441, STM32F042

back to menue


* State of information April 2024.
* Right of technical modifications reserved. Provided 'as is' - without any warranty. Any responsibility is excluded.
* This description is for information only. No product specifications are assured in juridical sense.
* Trademarks and product names cited in this text are property of their respective owners.