Contacts

A microcircuit designed to control electronic devices. What are microcontrollers - purpose, device, software. For processing, as a rule, three-address commands are used, which

Microcontroller - a chip designed to control electronic devices. A typical microcontroller combines the functions of a processor and peripheral devices, contains RAM and (or) ROM. Essentially, it is a single-chip computer capable of performing relatively simple tasks.

The advent of single-chip microcomputers is associated with the beginning of the era of mass application of computer automation in the field of management. Apparently, this circumstance defined the term “controller”.

Due to the decline in domestic production and the increased import of equipment, including computing equipment, the term “microcontroller” (MC) has replaced the previously used term “single-chip microcomputer” from use.

The first patent for a single-chip microcomputer was issued in 1971 to engineers M. Kochren and G. Boone, employees of the American Texas Instruments. It was they who proposed placing on one chip not only a processor, but also memory and I/O devices.

In 1976, the American company Intel released the i8048 microcontroller. In 1978, Motorola released its first microcontroller, the MC6801, which was instruction set compatible with the previously released microprocessor MC6800. 4 years later, in 1980, Intel released the following microcontroller: i8051. A successful set of peripheral devices, the ability to flexibly select external or internal program memory and acceptable price made this microcontroller a success in the market. From a technology point of view, the i8051 microcontroller was a very complex product for its time - 128 thousand transistors were used in the crystal, which was 4 times the number of transistors in the 16-bit i8086 microprocessor.

Today there are more than 200 modifications of microcontrollers compatible with the i8051, produced by two dozen companies, and a large number of other types of microcontrollers. Popular among developers are 8-bit PIC microcontrollers from Microchip Technology and AVR from Atmel, 16-bit MSP430 from TI, as well as 32-bit microcontrollers of ARM architecture, which is developed by ARM Limited and sells licenses to other companies for their production. Despite the popularity of the microcontrollers mentioned above in Russia, according to Gartner Group data from 2009, the world ranking in terms of sales volume looks different: Renesas Electronics takes first place by a wide margin, Freescale is second, and

A microprocessor system is a computing, instrumentation or control system in which the main information processing device is the microprocessor. A microprocessor system is built from a set of microprocessor large-scale integrated circuits (LSI).

Characteristic features of microprocessor information and control systems designed to automate technological processes: the presence of a limited set of clearly defined tasks, real-time operation, the presence of a developed system of external devices, high reliability requirements taking into account the long duration of continuous operation, difficult operating conditions; automatic mode operation or mode with the participation of the operator as an element of the system.

The use in a modern microcontroller of a sufficiently powerful computing device with wide possibilities, built on a single chip instead of a whole set, significantly reduces the size, power consumption and cost of devices built on its basis. Used in management various devices and their separate blocks:

IN computer technology: motherboards, controllers for hard and floppy disk drives, CD and DVD drives;

In electronics and various devices household appliances, in which it is used electronic systems management - washing machines, microwave ovens, dishwashers, telephones and modern appliances;

In cars: on-board computers, engine control systems, etc.;

In industry: industrial automation devices - from programmable relays and embedded systems to PLCs, machine control systems.

Currently, there is a huge range (more than 10,000) of various microcontrollers, differing in scope, parameters, and peripheral units built into the chip. More than a dozen manufacturers produce microcontrollers.

Microcontroller is a special chip designed to control various electronic devices. Microcontrollers first appeared in the same year as general-purpose microprocessors (1971).

Microcontroller developers came up with an ingenious idea - to combine the processor, memory, ROM and peripherals inside one package that looks like a regular microcircuit. Since then, the production of microcontrollers annually exceeds the production of processors many times, and the need for them has not decreased.

Microcontrollers are produced by dozens of companies, and they produce not only modern 32-bit microcontrollers, but also 16 and even 8-bit ones (like the i8051 and analogues). Within each family you can often find almost identical models, differing in CPU speed and memory capacity.

Microcontrollers, as a rule, do not work alone, but are soldered into a circuit, where, in addition to it, screens, keyboard inputs, various sensors etc.

Software for microcontrollers may attract the attention of those who love to “chase bits”, since the memory in microcontrollers usually ranges from 2 to 128 KB. If less, then you have to write in assembler or Forte; if possible, then use special versions of BASIC, Pascal, but mostly C. Before the microcontroller is finally programmed, it is tested in emulators - software or hardware.

Here a question may arise: are microprocessor and microcontroller just different names for the same device, or are they still different things?

Microprocessor is central device any computer made using integrated technology. The name itself suggests that it is in it that computational processes take place. In order for it to become a computer, even if not a very modern and powerful one (remember the amateur designs of Radio-86 or Sinclair), it must be supplemented external devices. First of all, this is RAM and input/output ports.

The microcontroller contains a processor, RAM, program memory, and in addition a whole set of peripheral devices that turn the processor into a fully functional computer. According to the old terminology of Soviet times similar devices called Single-chip Microcomputers. But Soviet computing technology, as we know, has reached a dead end, and with it the OMEVM.

Foreign computing technology did not stand still, so OMEVMs began to be called controllers (from the English Control - to manage, control). Indeed, the controllers turned out to be very suitable for controlling various techniques, not even very complicated.

A MICROCONTROLLER is no longer a processor, but also not a computer.

The central processor found in every computer is the main computer. Although a computer is not designed solely for computing workloads, the processor is the main element in it. But not only the computer has a processor.

If you think about it and take a closer look, you will find that processors are used in most household appliances. Only they use not the same processors as in a computer, but microprocessors and even microcontrollers.

So what is a microcontroller and how does it differ from the processor itself, or are they completely different electronic components?

Large integrated circuits or highly integrated circuits are processors. Microprocessors are essentially the same processors, but because of the prefix “micro” their essence is determined that they are smaller than their “large” counterparts. In its historical time, a processor with its size could occupy more than one room; it’s fitting to call them, like extinct dinosaurs, macro-processors, in order to somehow streamline them in the modern concept of electronics.

A smaller and packaged processor takes up less space and can be placed in a more compact product; this is a microprocessor. But the processor itself is not capable of doing much other than transferring data between registers and performing some arithmetic and logical operations on them.

In order for the microprocessor to be able to send data to memory, this very memory must be present either on the chip itself, on which the processor element itself is located, or connected to an external random access memory made in the form of a separate crystal or module.

In addition to memory, the processor must interact with external devices - peripherals. Otherwise, what benefit can you expect from the work of the processor, mixing and moving data back and forth? The meaning comes when the processor interacts with I/O devices. For a computer, this is a keyboard, a mouse and display devices such as a display, optionally a printer and, for example, a scanner, again for entering information.

To control I/O devices, appropriate buffer circuits and elements are required. On their basis, interface so-called hardware is implemented. Methods of interaction with interface elements require the presence of I/O port circuits, address decoders and bus drivers with buffer circuits to increase the load capacity of the microprocessor.

The integration of the processor with all the necessary additional elements in order for this product to result in some kind of complete design leads to the formation of a microcontroller. A microcircuit or microcontroller chip implements a processor and interface circuits on a single chip.

A self-sufficient chip that contains almost everything so that it is enough to build a finished product is an example of a typical microcontroller. For example wrist Digital Watch or an alarm clock has a microcontroller inside that implements all the functions of such a device. Individual peripheral devices are connected directly to the pins of the microcontroller chip, or additional elements or microcircuits of low or medium integration are used together.

Microcontrollers are widely used in products that contain the entire system solely in one miniature chip, often called a microassembly. For example, a “chip” credit card contains a microcontroller inside in a plastic base. It also contains a microcontroller inside. And examples of the use and application of microcontrollers are so extensive in modern world, that it is easy to detect the presence of a controller in any more or less intelligent device, from a children's toy to a wireless headset for a cell phone.

See also on our website:

See also Maxim Selivanov’s educational video courses on this topic:

Kur for those who are already familiar with the basics of electronics and programming, who know basic electronic components, assemble simple circuits, knows how to hold a soldering iron and wants to move to a qualitatively new level, but constantly postpones this transition due to difficulties in mastering new material.

The course is also great for those who have only recently made their first attempts to learn microcontroller programming, but are already ready to give up because nothing works for them or works, but not the way they need (sound familiar?!).

The course will also be useful for those who are already assembling simple (or maybe not so simple) circuits on microcontrollers, but do not understand well the essence of how a microcontroller works and how it interacts with external devices.

The course is dedicated to teaching microcontroller programming in C language. A distinctive feature of the course is learning the language at a very deep level. Training takes place using the example of AVR microcontrollers. But, in principle, it is also suitable for those who use other microcontrollers.

The course is designed for trained students. That is, the course does not cover the basic fundamentals of computer science and electronics and microcontrollers. But, in order to master the course, you will need minimal knowledge of programming AVR microcontrollers in any language. Knowledge of electronics is desirable, but not required.

The course is ideal for those who have just started learning programming. AVR microcontrollers in the C language and wants to deepen his knowledge. It is also good for those who have a little knowledge of programming microcontrollers in other languages. And further suitable for ordinary programmers who want to deepen their knowledge of the C language.

This course is for those who do not want to limit their development to simple or ready-made examples. The course is perfect for those who are interested in creating interesting devices with a full understanding of how they work. The course is well suited for those who are already familiar with programming microcontrollers in the C language and for those who have been programming them for a long time.

The course material is primarily focused on practical use. The following topics are covered: radio frequency identification, audio reproduction, wireless data exchange, working with color TFT displays, touch screen, work with file system FAT SD cards.

Working with I/O ports of the MC9S12C128 microcontroller

Goal of the work: The purpose of this laboratory work is to gain practical skills in working with microcontroller input/output ports.

Required equipment:

1. APS12DT56 board

2. NI ELVIS II+ platform

3. Platform PBMCUSLK

4. Personal computer

General information about microcontrollers

Microcontroller (English Micro Controller Unit, MCU) is a microcircuit designed to control electronic devices. A typical microcontroller combines the functions of a processor and peripheral devices on one chip, and contains RAM and (or) ROM. Essentially, it is a single-chip computer capable of performing simple tasks.

The use in a modern microcontroller of a sufficiently powerful computing device with wide capabilities, built on a single chip instead of a whole set, significantly reduces the size, power consumption and cost of devices built on its basis. Used to control various devices and their individual units:

· In computer technology: motherboards, controllers for hard and floppy drives, CDs and DVDs;

· Electronics and a variety of household appliances that use electronic control systems - washing machines, microwave ovens, dishwashers, telephones and modern appliances;

In industry:

· Industrial automation devices - from programmable relays and embedded systems to PLC;

· Machine control systems;

While 8-bit general-purpose processors have been completely replaced by higher-end models, 8-bit microcontrollers continue to be widely used. This is because there are a large number of applications in which high performance is not required, but low cost is important. At the same time, there are microcontrollers that have greater computing capabilities, such as digital signal processors.

Microcontroller MC9S12C128

In this laboratory workshop you will study in detail the single-chip 16-bit microcontroller of the HCS12 family: MC9S12C128.

Basic specifications this MK:

· 16-bit HCS12 processor core.

· Supply voltage 2.97..5.5 V. In the laboratory layout it is 5 V.

· Developed timing system. The microcontroller can be clocked either from external sources, and from internal ones. The laboratory bench uses an element belonging to the first type: a quartz resonator. The frequency of the clock signal it generates is 4 MHz. In this case, the frequency of the internal bus of the microcontroller BUS f is halved and equal to 2 MHz. Its maximum value for this microcontroller model is 20 MHz;

· Residential program memory (ROM). Its volume is 128K = 131072 cells (128 KB). The memory is made according to flash technologies with EEPROM emulation, the number of write/erase cycles is at least 100,000.

· Resident data memory (RAM). The volume is 4 KB.

· Total number microcontroller pins – 40. Housing type – QFP (Quad Flat Package).

The microcontroller chip contains the following peripheral modules:

· I/O ports. A total of 9 ports are available, their more detailed description is given in table. 2.1.;

· Timer module TIM with 16-bit time base counter and eight IC/OC/PWM channels.

· Built-in analog-to-digital converter ATD. The number of digitization channels is 8, the bit depth is 10 bits.

· Serial interfaces: synchronous SPI and asynchronous SCI, as well as a CAN module with speeds up to 1 Mbit/s.

I/O ports

All MCUs of the HCS12 family have a certain number of data input/output lines. Lines are combined into 8 bits parallel ports data: Port A, Port B, Port E, With rare exceptions, all I/O lines are bidirectional. The transmission direction of I/O lines is configured by software by writing a control word to the transmission direction register of the corresponding port. It is possible to change the transfer direction during program execution by reprogramming these registers. The reset signal sets all bidirectional lines to input mode. It should be especially emphasized that the transmission direction of each line can be chosen arbitrarily by the designer, regardless of other lines belonging to the same I/O port. The only exceptions are unidirectional transmission lines, which are initially specialized for input or output.

Some I/O lines have a so-called alternative function, i.e. provide communication between the built-in peripheral modules of the MK and the “outside world”. Thus, the lines of the PORT AD port are used to connect the measured voltages to the built-in ADC, the lines of the PORT S port serve as inputs and outputs of serial exchange controllers. If the corresponding peripheral module of the MK is not used, then its pins can be used as regular I/O lines.

If the port lines are bidirectional, then two types of registers are provided to service such a port:

PORTx - port x data register, where x is the name of the I/O port;

DDRx - port x transmit direction register.

For example, PORT A is served by the PORTA and DDRA registers, and PORT B ​​is served by the PORTB and DDRB registers.

If the port has circuitry with a software-connected “pull-up” resistor (R pullup), then an additional port input resistance register is provided to service such a port.

Below is a snippet of code that configures PORT B ​​for data output and then writes the number $62 to the port. In order for all lines of PORT B ​​to become output lines, it is necessary to write the code $FF to the DDRB transmit direction register.

/* MAIN PROGRAM: */

/*included files*/

#include

#include"derivative.h"

void main(void) (

unsigned char DDRB_INIT = 0xFF;

DDRB = DDRT_INIT; //set PORT B ​​to output

Microcontroller memory organization
I/O ports
Timers-counters
Interrupts
Analog-to-digital converter
Communication Interfaces
  • Universal synchronous-asynchronous USART transceiver

Video course on programming STM32 microcontrollers

Microprocessor is a software-controlled device that processes and manages digital information. The microprocessor is implemented as a large-scale integrated circuit (LSI) or ultra-large-scale integrated circuit (VLSI). The microprocessor acts as a processor in digital systems for various purposes.

The main feature of the microprocessor is the ability to program the operating logic.

Microcontroller (MCU)– a microcircuit designed to control electronic devices. A typical microcontroller combines the functions of a processor and peripheral devices, and may contain RAM and ROM. Essentially, it is a single-chip computer capable of performing simple tasks. Using a single chip, instead of a whole set, as is the case with conventional processors used in personal computers, significantly reduces the size, power consumption and cost of devices built on the basis of microcontrollers.

Microprocessor system (MPS) is a functionally complete product consisting of one or more devices, mainly microprocessor-based: a microprocessor and/or a microcontroller.

Microprocessor device (MPU) is a functionally and structurally complete product, consisting of several microcircuits, which include a microprocessor; it is designed to perform a specific set of functions: receiving, processing, transmitting, converting information and managing.

Main advantages of microprocessor systems compared to digital systems based on “hard logic”.

  • Multifunctionality: large quantity functions can be implemented on one element base.
  • Flexibility: the ability to correct and modify the microprocessor program to implement different operating modes of the system.
  • Compactness: miniature dimensions of microcircuits and a reduction in their number compared to implementation on “hard logic” make it possible to reduce the dimensions of devices.
  • Increased noise immunity: fewer connecting wires improve device reliability.
  • Performance: possibility of using higher operating frequencies and more complex algorithms information processing.
  • Information protection: the ability to protect the microprocessor program from being read allows you to protect the copyright of developers.

Although the microprocessor is a universal tool for digital information processing, certain areas of application require the implementation of certain specific options for their structure and architecture. Therefore, according to their functionality, two classes are distinguished: general-purpose microprocessors and specialized microprocessors. Among specialized microprocessors, the most widely used are microcontrollers designed to perform control functions for various objects, and digital signal processors (DSP - Digital Signal Processor), which are focused on implementing procedures that provide the necessary conversion of analog signals presented in digital form.

A partial list of peripherals that may be present in microcontrollers includes:

  • various input/output interfaces such as UART, I²C, SPI, CAN, USB, ETHERNET;
  • analog-to-digital and digital-to-analog converters;
  • comparators;
  • pulse width modulators;
  • timers-counters;
  • clock generator;
  • display and keyboard controllers;
  • arrays of built-in flash memory.

The idea of ​​placing a microprocessor and peripheral devices on one chip belongs to engineers M. Cochran and G. Boone, employees of Texas Instruments. The first microcontroller was the 4-bit TMS1000 from Texas Instruments, which contained RAM (32 bytes), ROM (1 kbyte), clock, and I/O support. Released in 1972, it had a new feature at that time - adding new instructions.

In 1976 (5 years after the creation of the first microprocessor), the first Intel microcontroller was born, named 8048. In addition to the central processor, the chip contained 1 kilobyte of program memory, 64 bytes of data memory, two eight-bit timers, a clock generator and 27 lines input/output ports. Microcontrollers of the 8048 family were used in Magnavox Odyssey game consoles, in the keyboards of the first IBM PC and in a number of other devices.

Today, among the major manufacturers of microcontrollers, Atmel, Microchip, ST Microelectronics, Texas Instruments, Freescale Semiconductor, NXP, etc. should be mentioned.

Microprocessor system(MPS) is a functionally complete product consisting of one or more devices, mainly microprocessor-based: a microprocessor or a microcontroller.

Microprocessor(MP) is a software-controlled device (“processor”) that performs arithmetic, logical operations, the process of digital information processing and control, on one large integrated circuit (LSI) or a set of several specialized chips.

Microcontroller(MK) is a microcircuit designed to control electronic devices. combines the functions of a processor and various peripheral devices on one chip, and contains RAM or ROM. Essentially, it is a single-chip computer capable of performing simple tasks.

microprocessor device(MPU), is a functionally and structurally complete product, consisting of several microcircuits, which include a microprocessor; it is designed to perform a specific set of functions: receiving, processing, transmitting, converting information and managing.

Based on their functionality, microprocessors are divided into general-purpose microprocessors and specialized microprocessors. The latter are divided into microcontrollers and digital signal processors (DSP). MCUs are available in 8-, 16- and 32-bit, and DSPs are available in fixed-point (16- and 24-bit) and floating-point (32-bit). A characteristic feature of the structure of microcontrollers is the placement of internal memory and a large set of peripheral devices on the same chip with the central processor.

Architecture processor is the complex of its hardware and software provided to the user. This general concept includes a set of software-accessible registers and executive (operating) devices, a system of basic commands and addressing methods, the volume and structure of addressable memory, types and methods of interrupt processing.

CISC– the architecture is implemented in many types of microprocessors that execute a large set of multi-format instructions using numerous addressing methods. RISC– the architecture is distinguished by the use of a limited set of commands of a fixed format. VLIW– this architecture appeared in the 1990s. Its peculiarity is the use of very long commands (up to 128 bits or more), the individual fields of which contain codes that enable the execution of various operations.

Princeton architecture(Von Neumann), characterized by the use of shared RAM for storing programs, data, and also for organizing a stack. To access this memory, a common system bus is used, through which both commands and data enter the processor. The presence of shared memory allows you to quickly redistribute its volume to store separate arrays of commands, data and stack implementation, depending on the tasks being solved. Harvard- physical separation of command memory (programs) and data memory. Its original version also used a separate stack. Each memory is connected to the processor by a separate bus, which allows simultaneous reading and writing of data while executing the current command to fetch and decode the next command. higher performance than using Princeton architecture.

Design of programs. a program is designed that satisfies the requirements of the problem statement. After the task as a whole has been set, the program design stage is performed, which is traditionally associated with drawing up a block diagram of the program, however, at the program development stage it is useful to use the following design methods:

Modular programming is a method in which long programs are broken down into shorter programs (modules).

Top-down programming is a method in which the problem being developed is divided into several generalized tasks, which are then detailed further. This process continues from top to bottom until the resulting subtasks are formulated in such a way that they can be simply implemented on a computer. Structured programming is a method in which programs are written according to specially developed rules (they use only certain types of program statements) and each program block has only one input and one output.

Did you like the article? Share it