⬆️ ⬇️

Microcontrollers of AVR, MSP430, STM32 families and my subjective impressions

Microcontrollers of AVR, MSP430, STM32 families and my subjective impressions



Hello, inhabitants of Habr. In this article I want to share my impressions about the programming experience of microcontroller families AVR, MSP430, STM32.



Introduction


When I was a student, I was engaged in application programming in Delphi and did not know grief, but I didn’t know happiness either. So far I have not visited me in the fourth year of the course “Microprocessor Controllers”. Well, gone, gone.



AVR Microcontroller Family


The subject “Microprocessor Controllers” was just dedicated to programming microcontrollers using the example of the Atmel AVR family of Atmega. Laboratory work on this subject consisted of programming debug boards with Atmega16 in an assembler of this family in the AVR Studio 4.18 software environment.



The program was debugged using a simulator and was stitched into the microcontroller by means of an LPT programmer on the logic built into the debug board via the ponyprog2000 program. During these labs, I got acquainted with the magic world of microcontrollers, which included “flashing the LED”, processing the button press, setting the hardware timer for operation and processing the interrupts generated by it, setting up the UART and transmitting data on it, etc.

')

A wonderful new world has opened up to me. But then it all went down a bit until the next course, where the programming of the same boards took place, but not in assembler, but in Pascal in the E-LAB environment. About this environment, few people know, but in vain. Indeed, long before any arduino there, this environment included many libraries for easy-to-use external devices. Do not believe?



See for yourself here . Here you have for E-LAB and JTAG-debuggers.

But at the time of writing the lab, JTAG debugging was not available. Therefore, we used the built-in simulator in E-LAB. As then, the E-LAB libraries allow you to create projects with a RTOS operating on the principle of Round-robin.

The latest versions of E-LAB also support cooperative multitasking.

In principle, I began my acquaintance with microcontrollers and, in particular, the AVR family, from these two cycles of laboratory work. What can be said now?

AVR is the most popular microcontroller family in the world, I think.

Arduino-mania only reinforced it. These easy-to-use microcontrollers are still the best solution for the first acquaintance. They allow you to gain experience in creating simple applications using SPI, I2C, UART interfaces, and allow you to understand the operation of I / O ports and interrupt subsystems. In fact, this family can learn the basics and make small and medium projects. In the latest versions of AVR Studio, you can do projects in C.



And if you take the soldering iron in hand, you can provide yourself with a programmer and a JTAG debugger .

Have a desire to start? There are a lot of things here too.

Branded debugging boards and programmers from Atmel are extremely expensive.

The main drawback of AVR is a weak computational core without auxiliary mathematical blocks, and eight-bit aggravates the situation. Those. complex mathematical calculations can take a long time. The microcontroller may not have time to process the collected or received information. I did the last project for Atmega16 on C in the IAR Embedded Workbench for Atmel AVR development environment.



MSP430 Microcontroller Family


After the AVR family, the microcontroller world has already revealed some of its secrets to me.

And then came the new subject, which was also devoted to programming microcontrollers, but this was already a family of Texas Instruments' MSP430, namely the msp430f169 microcontroller on a debugging board with a ziff-panel and minimal strapping.

Development of the program for it and debugging took place in the IAR Embedded Workbench for MSP430 environment using the JTAG debugger MSP-FET430UIF.

First of all, in this family, I liked examples of programs for working with inner peripherals from the manufacturer. Well, it takes my replanting for JTAG and IAR. Once you have tried JTAG debugging, you don’t want to go back to development with just programming. After all, under JTAG debugging, you can see in steps what is happening in the registers in memory and where the code is being executed now, set breakpoints. From now on, I got hooked on IAR. After all, this is a cross-platform compiler released for many microcontroller families. It’s worth remembering the interface once and every time, when switching to a new microcontroller family, it is not necessary to relearn. Is this not a miracle? But delays.



Minus only in the cost of the full version. In general, on this family, I began my work as a microcontroller programmer. And a bunch of C language (essentially cross-platform assembler), IAR cross-platform development environment and JTAG debugging have always been with me.



The MSP430 family, unlike the AVR, is 16-bit and more productive due to the use of an integrated hardware multiplier.

The ability to use low power modes provides an increase in battery life when used in mobile portable devices. And the MSP430F5419 and MSP430F5438 microcontrollers with which I worked, at a frequency of 25 MHz, are pulled tight to the ARM. So they are such powerful middling. If you have a proprietary JTAG debugger, IAR for MSP-430, a normal debugging board, then it’s a pleasure to work with them.



STM32 Microcontroller Family


Last I met the STM32 family of STMicroelectronics.

The ARM architecture itself is the door to many families.

Since for many of these microcontrollers from different companies, only one J-Link JTAG or its clone is required. And also if the IAR Embedded Workbench for ARM development environment is available, then the doors are open .

A plus in the direction of the STM32 family is the presence of a library of built-in peripherals, which allows you to quickly write your custom libraries with minimal effort, as well as 32-bit core, unlike AVR and MSP430. The line of STM32 microcontrollers includes many variants of their internal filling with integrated peripherals, and the cost also varies. For example, the STM32L152VBT6 microcontroller on the Cortex-M3 core, like the MSP430 microcontrollers, is aimed at low power consumption and operates at 32 MHz.



The other STM32F107VCT6 microcontroller also on the Cortex-M3 core is suitable for most tasks imposed on this class of devices and has a frequency of 72 MHz. Here it is immediately obvious that the Cortex-M3 core microcontrollers are much more suitable for “heavy” mathematics and processing than the MSP430 and AVR. I worked with the "heavyweight" of this STM32F407VGT6 family on the Cortex-M4 core, whose frequency reaches 168 MHz. "Big Brother" was ideally suited for solving complex mathematical problems. In addition, it has a hardware floating point FPU. For the STM32 family, the DISCOVERY line of cards has been developed, which allows you to get a card with an integrated ST-Link JTAG debugger, and you can use it to program your own design boards.



The result of their marketing policy allows you to join the development of microcontrollers with minimal cost, while having branded boards and JTAG debuggers from the manufacturer.



Conclusion


In conclusion. That all considered families have their advantages. Warm memories are associated with everyone.

Source: https://habr.com/ru/post/219803/



All Articles