Menu English Ukrainian russian Home

Free technical library for hobbyists and professionals Free technical library


ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING
Free library / Schemes of radio-electronic and electrical devices

STM32 microcontrollers and debug boards for them. Encyclopedia of radio electronics and electrical engineering

Free technical library

Encyclopedia of radio electronics and electrical engineering / Ham Radio Technologies

Comments on the article Comments on the article

For many years, radio amateurs have been using eight-bit microcontrollers from the PIC and AVR families. They are popular due to their low price, detailed documentation, ease of programming and ease of installation. However, quite often there are cases when the power of such a microcontroller is not enough to solve the task. The simplest example is a frequency meter or signal generator on a microcontroller, where the maximum measured or generated frequency directly depends on the speed of processing or outputting information.

In addition to speed, eight-bit microcontrollers have other limitations, for example, in many AVR models there is only one hardware serial port, which does not allow receiving information from an external device and simultaneously sending the results of its processing to the consumer. Not to mention such "banal" things as displaying information on a graphical indicator, which requires large resources, both speed and memory. After analyzing a number of such limitations, the author came up with the idea of ​​switching to microcontrollers of the STM32 family.

For example, consider two microcontrollers of the same price category - STM32F103C6 and ATmega328P.

Table 1

microcontroller type

ATmeqa328P

STM32F103C6

Processor size

8 32

Chassis

TQFP32 LQFP4E

Pin pitch, mm

0,8 0.5

Clock frequency, MHz

20 72

The amount of FLASH memory. KB

32 32

RAM size, KB

2 10

USART number

1 2

Number of 16-bit timers

1 2

Number of I/O lines

23 37

Estimated price, rub.

270 210

Their comparative parameters are given in table. 1. The comparison results are even somewhat surprising. A 32-bit microcontroller is not only more powerful than an eight-bit microcontroller in almost all respects, but it is also cheaper. Of course, soldering a microcontroller with a pin pitch of 0,5 mm at home is not so easy. Fortunately, in most cases this is not required - there are many varieties of debug boards with microcontrollers of the STM32 family on the market, sufficient for various applications. Let's consider them in more detail.

STM32F4-DISCOVERY

This board (it is shown in Fig. 1) is perhaps the most convenient for beginners to study STM microcontrollers. First, it has a large set of peripherals. In addition to the microcontroller, the board has a microelectromechanical accelerometer, a microphone, an audio DAC, two USB connectors, a button and four LEDs.

STM32 microcontrollers and debug boards for them
Fig. 1

The microcontroller outputs are brought to the contact pads for mounting pin connectors at the left and right edges of the board, which makes it easy to connect all the necessary external devices to them. The STM32F407VGT6 microcontroller installed on the board has very good parameters: 1 MB of FLASH memory, 192 KB of RAM and a clock frequency of 168 MHz.

And finally, the board is equipped with a built-in ST-LINK/V2 debugger, which can be used to debug programs not only on the microcontroller on the board, but also on microcontrollers of the same family that are on other boards. Switching to them is performed using a removable jumper and an SWD connector.

The price of the board is about 800 rubles, which can be considered quite acceptable.

STM32F103RBT6 Development Board

The next interesting option is a debug board with an STM32F103RBT6 microcontroller (Fig. 2).

STM32 microcontrollers and debug boards for them
Fig. 2

It is somewhat weaker than the one installed on the previous board - a clock speed of 72 MHz, 128 KB of FLASH memory and 20 KB of RAM, but the peripherals are very interesting. 320x240px 2.8' TFT touchscreen, built-in USB port for PC communication, SD memory card slot, 32768Hz clock quartz, real-time clock battery compartment and ST-LINK connector for debugging programs.

The price of this board is also about 800 rubles, but it should be noted that there is no built-in debugger on it. To download programs, you must either purchase a separate ST-LINK debugger, or use the STM32F4-DISCOVERY board discussed above instead

Maple Mini

The external similarity of this board (Fig. 3) with the well-known Arduino modules is striking. And this is no coincidence.

STM32 microcontrollers and debug boards for them
Fig. 3

The Maple Mini board was designed as a replacement for the Arduino Nano. The programming language and development environment for Arduino-installed microcontrollers of the AVR family have been adapted to the STM family. See http://leaflabs.com/docs/maple-q uickstart.html for more information on the Maple IDE programming language and development environment.

The development board has an STM32F103CBT6 microcontroller running at 72 MHz, with 128 KB of FLASH and 20 KB of RAM, which is undoubtedly more than in any Arduino module. And the greater plus is that the development environment has not changed much.

Separately, we note that despite the miniature size, Maple Mini provides a very diverse peripheral: 34 I / O lines, two SPI interface channels and two I2C, three serial ports. This allows you to successfully apply it in various amateur developments. Due to its small size, Maple Mini can be built directly into the device under development.

The original Maple Mini board can be purchased for $35 on the original Maple Mini website. Another $5 will cost shipping. A copy of the board made in China will cost half as much.

Software

There are several options for development environments that can be used to prepare programs for microcontrollers of the STM32 family:

- commercial IAR Embedded Workbench, AtollicTrueSTUDIO, Keil, etc. These full-featured products are quite expensive, with a license price of 1000 euros, but there are also free demo versions with a limitation on the amount of the program being developed, they are quite enough for most simple projects;

- free Eclipse with ARM-GCC compiler requires non-trivial compiler setup before use. The only plus today is the ability to work not only in Windows, but also in Linux;

- free CooCox IDE (CoIDE) based on the same Eclipse editor. Performs loading and debugging of programs via ST-LINK. Unlike the previous version, CoIDE does not require any special settings and works immediately after installation. This option is the most convenient and should be used.

Let's use CooCox IDE to create an example program for the STM32F4-DISCOVERY board that implements the classic for the first program for any microcontroller blinking LEDs. There are four LEDs on the STM32F4-DIS-COVERY board, they are connected to the PD12-PD15 pins of the microcontroller. Let's make them flash alternately.

Step 1. We launch the CoIDE development environment, create a project. From the dropdown list shown in Fig. 4, select the STM32F407VG microcontroller.

STM32 microcontrollers and debug boards for them
Fig. 4

Step 2. As shown in fig. 5, select the components that will be used in the project. The main ones are GPIO (input-output), C Library (basic C language functions) and M4 Core (processor core functions). When one or another component is activated, CoIDE automatically copies the necessary files to the project folder, which is very convenient.

STM32 microcontrollers and debug boards for them
Fig. 5

Step 3. Entering program text. It is quite short and is shown in Table. 2.

As you can see, everything is simple and obvious. Those who wrote programs for AVR microcontrollers will surely see familiar constructions - initialization of ports indicating the direction (input or output), the main loop in which the necessary actions are performed. In general, the syntax of the program is fully consistent with the C language, the literature on which is more than enough. There are also a lot of articles on programming for STM32 on the Internet. Many examples come with the development board and can be used as samples too.

After entering the text of the program by pressing the on-screen button "Download to flash", it is loaded into the microcontroller. The LEDs on the board start flashing. Separately, it is worth noting the debugging capabilities - a breakpoint can be set anywhere in the program, you can run the program step by step, viewing the values ​​of variables.

Of course, this example is not perfect. For example, to control the blinking of LEDs, you can use timer interrupts, which frees up the main program loop for other tasks. Those who wish can deal with this on their own.

Conclusion

In general, after the first acquaintance, the microcontrollers of the STM32 family left a very pleasant impression. Everything turned out to be not so difficult, and the convenience of the development environment, the debugging process and a large number of standard functions even somehow reminded me of the transition from Ms DOS to Windows - the general points seem to be the same, but everything is much more convenient and functional.

But the main disadvantage of this family for amateur development is still too small a step of conclusions. Designing and soldering a board with a lead pitch of 0,5 mm at home is a very non-trivial task. But at current prices, debug boards with already mounted microcontrollers are quite accessible to every radio amateur.

Is it worth redoing everything to STM and 32-bit architecture? Of course not. There are tasks for which ATtiny is enough. But, for example, to analyze the spectrum in a homemade SDR receiver or to receive and transmit large amounts of information over a network, it is much more efficient to immediately use a powerful microcontroller so as not to run into a lack of memory or performance when improving the device.

Author: D. Elyuseev

See other articles Section Ham Radio Technologies.

Read and write useful comments on this article.

<< Back

Latest news of science and technology, new electronics:

Artificial leather for touch emulation 15.04.2024

In a modern technology world where distance is becoming increasingly commonplace, maintaining connection and a sense of closeness is important. Recent developments in artificial skin by German scientists from Saarland University represent a new era in virtual interactions. German researchers from Saarland University have developed ultra-thin films that can transmit the sensation of touch over a distance. This cutting-edge technology provides new opportunities for virtual communication, especially for those who find themselves far from their loved ones. The ultra-thin films developed by the researchers, just 50 micrometers thick, can be integrated into textiles and worn like a second skin. These films act as sensors that recognize tactile signals from mom or dad, and as actuators that transmit these movements to the baby. Parents' touch to the fabric activates sensors that react to pressure and deform the ultra-thin film. This ... >>

Petgugu Global cat litter 15.04.2024

Taking care of pets can often be a challenge, especially when it comes to keeping your home clean. A new interesting solution from the Petgugu Global startup has been presented, which will make life easier for cat owners and help them keep their home perfectly clean and tidy. Startup Petgugu Global has unveiled a unique cat toilet that can automatically flush feces, keeping your home clean and fresh. This innovative device is equipped with various smart sensors that monitor your pet's toilet activity and activate to automatically clean after use. The device connects to the sewer system and ensures efficient waste removal without the need for intervention from the owner. Additionally, the toilet has a large flushable storage capacity, making it ideal for multi-cat households. The Petgugu cat litter bowl is designed for use with water-soluble litters and offers a range of additional ... >>

The attractiveness of caring men 14.04.2024

The stereotype that women prefer "bad boys" has long been widespread. However, recent research conducted by British scientists from Monash University offers a new perspective on this issue. They looked at how women responded to men's emotional responsibility and willingness to help others. The study's findings could change our understanding of what makes men attractive to women. A study conducted by scientists from Monash University leads to new findings about men's attractiveness to women. In the experiment, women were shown photographs of men with brief stories about their behavior in various situations, including their reaction to an encounter with a homeless person. Some of the men ignored the homeless man, while others helped him, such as buying him food. A study found that men who showed empathy and kindness were more attractive to women compared to men who showed empathy and kindness. ... >>

Random news from the Archive

Energy storage in red-hot graphite bricks 03.07.2021

Building solar and wind power plants is now cheaper than building coal ones, but it is still difficult to ensure a continuous cycle of operation of stations using renewable sources. Two American companies have proposed storing energy by heating bricks made of conductive materials to thousands of degrees Celsius. At night and in calm weather, hot bricks will participate in the generation of electricity and this is cheaper than using batteries.

Established in 2018, Antora Energy recommends the use of graphite thermal storage bricks. Actually, the industry already produces such graphite blocks in huge volumes in the form of electrodes for steelmaking and chemical enterprises. In this regard, you do not need to invent anything. To accumulate energy, an excess electric current is passed through the graphite bricks in the block and they heat up to 1500 ° C. The secret lies in how to turn heat back into electricity.

To generate electricity from stored heat, Antora Energy developers proposed a thermophotovoltaic method. Photo sensors operating in the infrared range capture thermal radiation from bricks and convert it into electricity. Thanks to the new semiconductor materials III-V groups of the periodic table, which replaced the classical semiconductors, the efficiency of the installation reaches 30%, which is very, very good. Using heat in this way keeps the efficiency high over the entire temperature range of the heat storage, whereas a steam turbine in a similar arrangement would get worse and worse as the unit cools.

The density of energy storage in graphite blocks is comparable to that for lithium-ion batteries and is several hundred kilowatt-hours per cubic meter, which is hundreds of times higher than hydrostorage or gravitational storage. Ideally, developers aim to reduce the cost of renewable energy storage to below the cost of electricity generated by natural gas power plants. This mark is at the level of $10/kWh.

Lithium batteries cost $140/kWh to operate and are expected to drop to $20/kWh after 2030. Thermal storage units will be cheaper to operate much sooner. The Antora Energy pilot plant is due to be built in 2022. The money was allocated by the state and private investors.

Other interesting news:

▪ Samsung steps up its work in the digital camera market

▪ Toshiba Efficient Thin Film Organic Photovoltaic Module

▪ Vegetarianism could save millions of lives

▪ Reservoir bombarded with balloons

▪ This gum was chewed 5000 years ago

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ section of the site Winged words, phraseological units. Selection of articles

▪ article by Edmund Husserl. Famous aphorisms

▪ article How is wax obtained? Detailed answer

▪ Capsicum article. Legends, cultivation, methods of application

▪ article Simple metronome. Encyclopedia of radio electronics and electrical engineering

▪ article Standards for testing electrical equipment and devices for electrical installations of consumers. Semiconductor converters and devices. Encyclopedia of radio electronics and electrical engineering

Leave your comment on this article:

Name:


Email (optional):


A comment:





All languages ​​of this page

Home page | Library | Articles | Website map | Site Reviews

www.diagram.com.ua

www.diagram.com.ua
2000-2024