What is a microcontroller? Definition of characteristics and architecture.


PIC

Microchip Technology opens our parade with the PIC series. These MKs differ from each other in their bit depth (8/16/32), set of peripherals and chip housing. Eight-bit options are divided into four families: baseline, mid-range, enhanced mid-range and PIC18. More detailed information is given in the table.

There are also 16-bit “peaks” - PIC24F and DsPIC30/33F. Well, 32-bit ones - PIC32MX. These strange combinations of letters and numbers are part of the chip's identifier. Same as car brands. For example, the widely used stone PIC16F628A is deciphered as follows: family PIC16F6 (Mid-range), and the rest of the name is a pointer to a specific stone. The MKs discussed below may contain even more information in their name.

Price and contents


Microcontroller PIC16F628A
These microcontrollers have an average price. For example, a PIC6F628 stone in Chipdip costs about 150 rubles, and a PIC18F2550 costs 620 rubles.

Cheaper copies include a minimum of peripherals. The previously mentioned PIC6F628 has the following characteristics: built-in clock generator for operation at 4 or 8 MHz; 18 pins, of which 16 are I/O, and 2 are power; to operate at higher frequencies, you can connect a quartz resonator; Flash memory with a capacity of 2048 words; 4 analog inputs; two 8-bit timers and one 16-bit; 224 bytes of RAM (most funny); 128 bytes EEPROM (this is software rewritable non-volatile memory, like a hard drive); UART interface.

Programming and Using the PIC

They program for microcontrollers, usually in assembler and C. There are many development environments: MPASM and MPLAB, MicroC, JALedit (JAL language, this is the first time I’ve heard about it).

As a rule, simple devices like a flasher or a timer are assembled on such MKs. These controllers had a monopoly in the post-Soviet space for a long time, and as a result, there are a huge number of Russian-language services and articles on the Internet dedicated to these MK models. When assembling a device, you often don’t even have to write the firmware, because it can easily be found on the Internet, even in several versions.

The second advantage is the built-in independent (from the clock generator) counters. Thanks to this fact, the family has established itself as the “brains” for frequency counters. I have a couple of these controllers in my workshop for a rainy day. The only downside is the high cost of the original programmers, called PICkit.


PICKIT3

There are many articles on the Internet on assembling worthy analogues of such programmers. But the whole point is that to build a programmer, what do you need? That's right, programmer. For this case, the Gromov programmer was developed. You don’t need almost anything to assemble it, and it works from the computer’s COM port. At the time of its development, the popularity of this MK series was high, and all PCs had COM ports. Nowadays all this is already a rarity, so you will have to overcome the entry threshold or fork out more money.

Tips for choosing microcontrollers

When developing a digital system, it is necessary to make the correct model of the microcontroller. The main goal is to select an inexpensive controller to reduce the total cost of the entire system. However, it is necessary that it meets the specifics of the system, reliability requirements, performance and conditions of use.

The main factors for selecting a microcontroller are:

  1. Ability to work with application systems. The possibility of implementing this system on a single-chip microcontroller, or on a specialized chip.
  2. The presence in the microcontroller of the required number of ports and contacts, since if there are not enough of them, it will not be able to complete the task, and if there are extra ports, the cost will be inflated.
  3. Availability of necessary peripheral devices: various converters, communication interfaces.
  4. The presence of other auxiliary devices that are unnecessary for work, which increases the cost.
  5. Providing the required performance: computing power that makes it possible to process system requests in a specific application programming language.
  6. Does the project budget have enough finances to use an expensive microcontroller? If it is not suitable for the price, then the remaining questions are meaningless, and the developer must look for another microcontroller.
  7. Reliability of the manufacturer.
  8. Information support.
  9. Availability. This factor includes the following points:
  • Is it currently in production?
  • Availability of developer support.
  • Availability of programming languages, in-circuit emulators, debugging tools and compilers.

AVR


Atmel logo
AVR microcontrollers are manufactured by Atmel. If you didn’t know, these are the same controllers from which Arduino is assembled. Atmel was once an independent company, but later it was bought by the previously mentioned Microchip, which continues to produce these MKs. They are divided into three families: tinyAVR (ATtinyxxx), megaAVR (ATmegaxxx), XMEGA AVR (ATxmegaxxx).

TinyAVR has the following characteristics:

  • Flash memory up to 16 KB;
  • RAM up to 512 bytes;
  • ROM up to 512 bytes;
  • number of input/output pins (legs) 4–18;
  • a small set of peripherals.

MegaAVR:

  • FLASH up to 256 KB;
  • RAM up to 16 KB;
  • ROM up to 4 KB;
  • number of I/O pins 23–86;
  • extended instruction system (assembler) and peripherals.

Well, XMEGA AVR:

  • FLASH up to 384 KB;
  • RAM up to 32 KB;
  • ROM up to 4 KB;
  • four-channel DMA controller (for fast work with memory and I/O);
  • “innovative” event processing system.

As with PIC, AVR models contain valuable information in the name. For example: ATMega328PU - megaAVR family, 32 KB Flash, 8-bit, P - speaks of a modification (about the same as the modernized Makarov pistol - PMM).


Decoding the name of the chip

Price and filling

These microcontrollers, like PICs, have an average cost. For example, the previously mentioned ATmega328P stone in Chipdip costs 160 rubles, and ATxmega128A1 costs 590 rubles.

TinyAVR is cheaper and simpler than its older brothers. Some characteristics of the ATmega328P: maximum operating frequency of 20 MHz (I heard, however, that under cooling they were overclocked even more); 23 I/O pins; Flash memory 32 KB; 8 analog inputs; two 8-bit timers and one 16-bit; 6 PWM channels; 2 KB RAM; 1 KB EEPROM; interfaces UART, SPI, I2C.

Programming and using the AVR

Thanks to the proliferation of Arduino prototyping boards, both here and abroad, these MKs have a low barrier to entry. Programmed in assembler, C, C++; You can use graphic code generators like Scratch (see Scratchduino). For work there is Atmel Studio, IAR AVR, WinAVR. Well, and Arduino IDE, where would we be without it? Personally, I use a combination of Geany and avrdude. There are a wide variety of programmers for firmware: both cheap and more expensive. For these purposes, I bought an inexpensive copy of USBasp for about 1.5 dollars (there are a lot of options on Aliexpress). You can also use Arduino UNO as a programmer.

There is a lot of information about these controllers on the Internet: just look at the AlexGyver channel! And thanks to Arduino, there are a lot of educational kits for every taste. In general, a low barrier to entry is a significant advantage of these controllers.

By the way, if you order from China, then taking a board with a chip will be cheaper than taking the chip separately.

ARM

You've probably heard about the ARM company and its products. However, this company does not produce the microcontrollers themselves, but only the architecture. The license for it is purchased by the end producers and used as they wish. Who hasn't released them! But the most widely used microcontrollers are chips from STMicroelectronics.


STMicroelectronics logo

They are divided into two families: STM32 and STM8. As the names suggest, such chips come in 8- and 32-bit versions. And each family is divided into series, of which there are quite a lot.

STM8

What can you say about them? This is a functional analogue of AVR, only cheaper. There are three series: STM8L with ultra-low power consumption, STM8S for industrial equipment and STM8A, called “highly reliable”. All peripherals are the same as AVRs, but have a built-in clock generator. The only advantages I can highlight are low power consumption and low price. Please note that the STM8 architecture is not ARM, but its own. It is very similar to ARM and uses the same firmware interface as STM32. The compiler is also used for them, and when it works, you simply indicate which architecture to compile the code for.

STM32

Simply put, it is the big brother of STM8. Its characteristics are much higher and vary widely depending on the series. They can be programmed in almost anything, even JavaScript, although I would not recommend it.

Firmware and programming

The STM32 is flashed using the Single Wire Interface Module (SWIM) interface developed by ST. MKs of this series also have a Serial Wire Debugging (SWD) interface. I haven’t used it, but most STM guides have a description of how to configure it.

You can also write firmware to the STM via USB. The fact is that many controllers in this series have hardware support for USB. Thanks to this, STM can emulate different devices - for example, a flash drive. If you upload special firmware, you can update the firmware simply via USB.

There are a variety of programmers for STM32 - from very cool to simple USB whistles. For example, I took ST-LINK; on Aliexpress it cost about $1.6. Its advantage is that it can flash any STM controller.


Programmer ST-LINK

It is also worth mentioning the STM Nucleo boards. Here is one of them.


STM32 Nucleo board

It's kind of like an Arduino from the STM world. It’s a little expensive, like the original Arduino, but it’s an excellent thing for a beginner. If you have the money, it's worth taking. Here it is worth mentioning Amperka with their Iskra and a set for beginners. Also quite a worthy choice for the first time.


Iskra JS board

For programming, you can use the Embedded Workbench, uVision and TrueStudio environments. Thanks to the work of craftsmen, the native Arduino IDE for many can be used for the same purposes. There is also an online IDE - mbed studio.

Price

A batch of five boards with strapping and STM8 will cost about $4.5. The BluePill board with STM32F103 now costs $1.6. NUCLEO-F072RB board - $16.4. I won’t give links - on Aliexpress all this can be easily searched for using the query “stm32”.

What is a microcontroller?

A microcontroller is an integrated circuit (IC) device used to control other parts of an electronic system, typically through a microprocessor device, memory, and several peripheral devices. These devices are optimized for embedded applications that require both processing capabilities and flexible, fast interaction with digital, analog or electromechanical components.

The most common way to refer to this category of integrated circuits is "microcontroller", but the abbreviation "MCU" is also used interchangeably, as it stands for "microcontroller unit". You'll also sometimes see "µC" (where the Greek letter mu replaces the prefix "micro").

"Microcontroller" is a well-chosen name because it highlights the defining characteristics of this product category. The prefix "micro" implies small size, and the term "controller" here implies advanced ability to perform control functions. As stated above, this functionality is the result of combining a digital processor and digital memory with additional hardware that is designed specifically to help the microcontroller communicate with other components.

Microcontrollers and microprocessors

People sometimes use the term "microprocessor" when referring to a microcontroller, but the two devices are not necessarily identical. Both microprocessors and microcontrollers operate as small, highly integrated computing systems, but they can serve different purposes.

The term "processor" is used to identify a system that consists of a central processing unit and (optionally) some memory. A microprocessor is a device that implements all the functionality of a processor in a single integrated circuit. Microcontrollers, by comparison, place more emphasis on additional hardware modules that allow the device to control the system rather than simply execute instructions and store data.

Below is a diagram that illustrates this concept.


Diagram explaining the difference between the terms "microcontroller" and "microprocessor"

In general, using the terms "microprocessor" and "microcontroller" interchangeably is not a big problem when we speak informally and try not to repeat the same word over and over again. However, in the context of a technical discussion, it is important to maintain the distinction between the two concepts.

Microcontrollers and Digital Signal Processors (DSP)

A digital signal processor (or DSP) is a microprocessor optimized for complex computing tasks such as digital filtering, real-time signal analysis, and data compression. A very complex microcontroller may be able to replace a digital signal processor, but it is still considered a microcontroller if a significant portion of its internal circuitry is dedicated to controlling, monitoring, and communicating with the surrounding system.

ESP


ESP32
And finally, a few words about ESP. I have not worked with these MKs and know little about them. These are 32-bit stones with a Wi-Fi module on board. They use the xtensa architecture. They assemble smart houses and other interesting things (see sidebar below). You can again program in the Arduino IDE. The famous ESP8266, repeatedly mentioned on the pages of our website, belongs to this family. It also includes ESP32, the older brother of ESP8266.

Rating
( 1 rating, average 4 out of 5 )
Did you like the article? Share with friends:
For any suggestions regarding the site: [email protected]
Для любых предложений по сайту: [email protected]