Microcontrollers - what is it?

Nowadays, microcontrollers can be found in almost every instance of household appliances and electronics. For example, if a microwave oven has an LED or LCD screen and a keyboard, then it is necessarily equipped with a special control chip.

Variety of applications

All modern cars contain at least one microcontroller and can be equipped with several for the engine, anti-lock braking system, cruise control, etc. Any device with a remote control will almost certainly have a microcontroller control. TVs, players and high-quality stereo systems fall into this category. Digital compact and SLR cameras, cell phones, camcorders, answering machines, laser printers, landlines with the ability to identify the caller and memory for 20 numbers, multifunction refrigerators, dishwashers and washing machines, dryers. In principle, any home appliance or device that interacts with the user has a built-in microcontroller.

microcontrollers this

What it is?

The microcontroller is a computer. All computers, whether personal or large mainframes, share some common features. They have a central processing unit (CPU) that runs programs by loading instructions from some kind of data store. On a PC, for example, it's a hard drive. The computer is also equipped with random access memory (RAM). Special means must be provided for communication with the outside world. On a PC, the keyboard and mouse are input devices, and the monitor and printer are used to output it. A hard disk combines both of these features, since it works with both input and output data.

microcontroller control

CPU

The type of processor used in the microcontroller depends on the specific application. Options are available from simple 4-, 8- or 16-bit to more complex 32- or 64-bit. As far as memory is concerned, RAM, flash memory, EPROM or EEPROM can be used. As a rule, microcontrollers are designed to be used without additional computing components, since they are designed with a sufficient amount of internal memory, and also have contacts for general input-output operations to directly interact with sensors and other components.

The CPU architecture can be either Harvard or von Neumann, offering various methods for exchanging information between the processor and memory. In the first case, the data and command buses are separated, which allows their simultaneous transmission. In von Neumann architecture , the general is used for this.

microcontroller operation

Programming

Microcontroller processors can be based on the extended (CISC) or reduced instruction set (RISC). CISC usually includes about 80 instructions (RISC - about 30), as well as a larger number of addressing modes - 12-24 compared to 3-5 in RISC. Although the extended instruction set is easier to implement and uses memory more efficiently, its performance is lower due to the larger number of clock cycles required to execute them. RISC processors pay more attention to software and are more productive.

Initially, the language of microcontrollers was assembler. Today, C is a popular option.

If you have the appropriate cable, software and PC, it’s easy to program the microcontroller yourself. It is necessary to connect the controller with a cable to the parallel port of the computer, start the application and download the set of commands.

microcontrollers for beginners

Defining characteristics

How to distinguish a computer from a microcontroller? If the first is a general-purpose device that can run thousands of different programs, then the second is specialized, focused on one application. There are a number of other characteristics that distinguish microcontrollers. For novice users, this will not be a problem - it is enough to establish that the chip has most of the qualities listed below so that it can be safely assigned to this category.

  • Microcontrollers are elements of some other device (often household appliances) to control its functions or work. They are also called built-in controllers.
  • The device is designed to perform one task and run one specific program stored in ROM, which usually does not change.

microcontroller language

  • Microcontrollers are low-power chips. Their power when powered by a battery is about 50 mW. A desktop computer is almost always plugged in and consumes 50 watts or more.
  • The microcontroller is characterized by the presence of a special input unit and often (but not always) a small LED or LCD display for output. It receives input from the device that it controls, sending signals to its various components. For example, the TV microcontroller receives signals from the remote control and displays the output on the TV screen. It controls the channel selector, speakers, and some image settings, such as contrast and brightness. The automobile engine controller receives input signals from oxygen and detonation sensors, regulates the creation of the fuel mixture and synchronizes the operation of the spark plugs. In the microwave, it receives keyboard input, displays the output on the LCD and controls the on and off relay of the microwave generator.
  • Microcontrollers are often small and inexpensive devices. Components are selected in such a way as to minimize the size and reduce the cost of production as much as possible.
  • Often, but not always, the microcontroller operates under adverse conditions. For example, a car engine control device must operate at extreme temperatures, at which a conventional computer cannot function at all. In the north, the car microcontroller should operate at a temperature of -34 Β° C, and in the south - at 49 Β° C. In the engine compartment, temperatures can reach 65–80 Β° C. On the other hand, the microcontroller built into the Blu-ray player should not be particularly durable at all.

microcontroller connection

CPU Requirements

The processors used in microcontrollers can vary greatly. For example, cell phones used the Z-80 8-bit microprocessor, developed in the 1970s and originally used in home computers. The Garmin GPS was equipped with a low-power version of Intel 80386, which was also originally installed on desktop PCs.

Most household appliances, such as microwaves, are undemanding to processors, but their price is an important factor. In these cases, manufacturers turn to specialized microcontrollers designed from low-cost, small and low-power CPUs. Motorola 6811 and Intel 8051 are good examples of such chips. A series of popular Microchip PICs are also available. By today's standards, these processors are incredibly minimalistic, but they are extremely cheap and often can fully satisfy the needs of the designer.

do-it-yourself microcontroller

Profitability

A typical microcontroller is a chip with 1000 bytes of ROM, 20 bytes of RAM, and 8 I / O pins. When released in large batches, their cost is low. Of course, it is impossible to run Microsoft Word on such a chip - this will require at least 30 MB of RAM and a processor that executes millions of operations per second. But to control the microwave, this is not necessary. The microcontroller performs one specific task, and low cost and power consumption are its main advantages.

How does it work?

Despite the great variety of microcontrollers and even more programs for them, having learned how to handle one of them, you can get to know everyone. A typical work scenario is as follows:

  • When the power is off, the device does not manifest itself in any way.
  • Connecting the microcontroller to an energy source launches the control system logic block, which disables all other circuits except the quartz crystal.
  • When the voltage reaches its maximum, the frequency of the generator stabilizes. The registers are filled with bits reflecting the state of all microcontroller circuits. All contacts are configured as inputs. Electronics starts to work according to the rhythmic sequence of clock pulses.
  • The command counter is reset to zero. The instruction at this address is sent to the command decoder, which recognizes it, after which it is immediately executed.
  • The value of the instruction counter is increased by 1, and the whole process is repeated at a speed of a million operations per second.


All Articles