The situation when users of printing office equipment have to solve the problem of how to reset a cartridge is quite common. You can cope with it using several ways, and absolutely independently. But before we begin solving the problem of how to reset the cartridge chip, it should be said that the chip on the printer is designed to record information related to the resource of consumables and printed pages.

When office equipment signals the need to replace the ink container, keep in mind that this does not mean that there is actually no ink left in it. It’s just that the chipped cartridge has reached a certain limit of printed pages. And on them, in turn, there could only be 5-6 lines of text. It turns out that the ink level of the printer and MFP is calculated programmatically and, as a rule, there is no information about how much ink is actually left in the container. It is for this reason that the question often arises of how to reset the chip on the cartridge in order to use up all the ink that is in its container.

Of course, instead of resetting the cartridge and resetting the counter, you can simply ignore the warnings from your office equipment that the consumable capacity is almost empty. But this is only relevant if your printer or multifunction device does not automatically block the printing process when such messages appear. To cope with the task of how to reset the cartridge and thus unblock the printer, you should resort to the methods described below.

How to use the programmer?

To answer the question of how to reset the printer, you need to use a special programmer. Please note that resetting the printer will be carried out as successfully as possible if for this purpose you use the programmer that is designed specifically for your model of printing office equipment.

The chip programmer can work with a large number of chips from various printers. It is easy to use (often such software has an automatic programming function), has a full USB interface, manual and automatic CRUM power control, as well as ergonomics.

Thus, in order to reset the counter, you just need to select the desired model using such universal software and wait for the procedure to complete. Often, universal programmers have a very convenient scanning function. With her help. You can find out which device this or that chip belongs to. It should also be added that such a chip programmer does not need the Internet.

So, if to solve a problem like “how to reset the counter” you purchased a programmer that matches your printer, then first carefully read the instructions for use. There you can find out about all the recommendations that relate to the operation of the device.

  • Before resetting the counter, be sure to disassemble your toner/ink cartridge and then remove the chip from it. Despite the fact that each model of printing office equipment has its own characteristics of counter zeroing, in general the process is almost identical on most models.
  • To reset the counter, insert the chip into the connector of a previously purchased programmer, which, in turn, must be connected to the port of a personal computer.
  • Download the chip software to help solve the problem of how to flash the cartridge.
  • Having opened the software designed for chips of consumables of printing office equipment, reset all information related to the use of consumables. It would be a good idea to first download the firmware reset scheme from thematic web resources.
  • Save the entire result of the work done, then carefully remove the chip from the device and refill the toner or ink container.
  • At the end, all you have to do is insert the consumable with the reset counter back into the printing device and test its operation by printing a test page.

But you need to understand that such a programmer costs quite a lot of money - its price is comparable to the cost of a new printing device, so for a home printer, the best option is to replace the chip. Printer chips are inexpensive, and they are very easy to change.

Self-reset

Another way to reset the cartridge counter in order to bypass the print lock function and refill consumables is to use a manual approach. For this purpose, follow these steps:

  • First of all, remove the consumables from the office equipment.
  • Click on the “Cancel” button in the service menu of the printing device while holding down “OK”. After a few seconds, you can release both buttons.
  • Find an item in the menu called “Resets Menu”, then click on “OK”.
  • Now you should select "Partial Reset". Your device will then turn off.
  • Turn on your printer or multifunction device, select your region and language, and then follow all the instructions that the printing device offers you.
  • Check the ink level; if this parameter is not 100 percent, then repeat the previously listed steps again. However, instead of the “Partial Reset” item, you need to click on “Semi Full Reset”.
  • Alternatively, you can try holding down the Reset/Stop button on the printing device itself for about ten seconds. Thanks to this action, the ink level in the consumable will simply no longer be monitored by the printer. But this approach has one drawback. The fact is that after such an operation you will have to monitor the ink level in each cartridge yourself.

Please note that the steps described above are only suitable for some printer models. Most devices require cartridge firmware. To find out how to make it specifically for your printer model, use the search by device model in the side menu.

What to do if you couldn’t reset the chip?

But if you are unable to unchip the printer or MFP consumables, then there is only one way out of this situation, which is to replace the chip. But you must definitely take into account that the chip will have to be replaced every time you refill a consumable. In general, finding suitable chips for cartridges of various printer models is not a problem today, because... The modern market for office equipment and its components is overflowing with a huge number of offers.

Another way to solve this problem is to reflash the office equipment itself. To do this, you will have to familiarize yourself with the relevant materials on our website or use the services of specialists from any reliable service center.

Microcircuits for various purposes are used as part of modern electronics. A huge variety of such components is complemented by memory chips. This type of radio components (among electronics engineers and the people) is often simply called chips. The main purpose of memory chips is to store certain information with the ability to enter (write), change (overwrite) or completely delete (erase) by software. The general interest in memory chips is understandable. For masters who know how to program memory chips, wide opportunities open up in the field of repair and configuration of modern electronic devices.

A memory chip is an electronic component, the internal structure of which is capable of storing (remembering) entered programs, any data, or both at the same time.

Essentially, the information loaded into the chip is a series of commands consisting of a set of microprocessor computing units.

It should be noted: memory chips are always an integral addition to microprocessors - control chips. In turn, the microprocessor is the basis of the electronics of any modern technology.

A set of electronic components on the board of a modern electronic device. Somewhere among this mass of radio components there is a component capable of storing information.

Thus, the microprocessor controls, and the memory chip stores the information needed by the microprocessor.

Programs or data are stored on a memory chip as a series of numbers - zeros and ones (bits). One bit can be represented by a logical zero (0) or a logical one (1).

In a single form, bit processing seems complex. Therefore, the bits are combined into groups. Sixteen bits make up a group of “words”, eight bits make up a byte - a “part of a word”, four bits - a “piece of a word”.

The most commonly used software term for chips is byte. This is a set of eight bits that can take from 2 to 8 numeric variations, giving a total of 256 different values.

To represent a byte, a hexadecimal number system is used, which provides for the use of 16 values ​​from two groups:

  1. Digital (from 0 to 9).
  2. Symbolic (from A to F).

Therefore, combinations of two hexadecimal characters also contain 256 values ​​(from 00h to FFh). The trailing "h" character indicates hexadecimal numbers.

Organization of memory chips

For 8-bit memory chips (the most common type), the bits are combined into bytes (8 bits) and stored at a specific "address".

The assigned address allows access to bytes. The eight access address bits are output through eight data ports.


Organizing the structure of a storage device. At first glance, the algorithm is complex and incomprehensible. But if you want to understand, understanding comes quickly

Failure of a key is a very rare phenomenon if we consider the so-called tablets, and very likely if we are talking about a contactless RFID system built on cards triggered from a long distance.

If for some reason the entrance door, the gate of a private house or the lock at work no longer unlocks, the question often arises: how to reprogram the key to the intercom? For the average user, this process does not mean complex intervention and participation in programming a personal identification device.

Features of programming intercom keys

To understand why programming individual intercom keys only involves recording a new identifier and linking it to the subscriber on the device installed in the door, it is worth paying special attention to the mechanics of operation and the internal structure of the usual tablets and cards.

All keys are built on a one-time device circuit. If a failure or physical violation of the internal structure occurs, the personal identifier is simply thrown away or destroyed. Neither repair nor reprogramming without the use of special industrial devices is provided.

RFID

Small keychains and cards are already familiar to many people. For such a key to operate, it does not need to be leaned against the reading pad. You just need to bring it a certain distance.

The keys are ranked according to their operating range:

  1. with an identification zone of 100-150 mm, common format, Proximity type;
  2. with a detection range of up to 1 m, Vicinity type.

Despite such differences in range, all identifiers work according to a simple scheme.

An intercom using keys of this class has a low-intensity electromagnetic field radiation unit in the contact area. Inside an RFID card or key fob there is a simple circuit; it includes an inductive oscillating circuit, a miniature transmitting antenna and a chip that generates a signal.

When the key is brought into the radiation zone, energy is generated and the internal electrical circuit is activated. The card or key fob transmits a radio frequency signal, the intercom recognizes the identifier and unlocks the door if it is registered in its memory.

There is simply no simple way to reprogram an RFID-class intercom key for most types of products. The identifier is formed by a factory-sprayed chip, the number of unique combinations (cards and key fobs) is huge, changes to the code are not provided.

The key can deteriorate either due to mechanical kinks or breaks (as a result, damage to the chip or transmitting antenna grid occurs), or due to exposure to strong electromagnetic radiation, comparable in strength to a microwave oven.

Touch-Memory

Touch-Memory is the contact tablet most people are familiar with. There is also a microchip inside this key.

However, the identifier is transmitted via a single-channel electrical circuit. When the key is applied to the contact pad, the data reading circuit is closed in the intercom.

A unique code stitched into the tablet is transmitted and checked against one of those stored in the device’s memory. If identification is successful, the door will unlock.

A Touch-Memory tablet can be damaged by exposure to strong static voltage by applying the tablet to electrified clothing. This is quite difficult to do, since the pulse must pass between certain points of the contact pad, but this is the most common cause of breakdowns.

The tablet with the chip is very durable, it is difficult to damage it mechanically, the key is that, in addition to exposure to static, it can be burned in the microwave. Touch-Memory tolerates any other influences, including the most powerful neodymium magnets, without consequences.

The way to program access keys for an intercom of this class is to use a special programmer. It is used to make clones of tablets, as well as universal master keys for a series of intercoms.

Touch-Memory is divided into classes. They depend not on the internal structure and principles of operation, but on the manufacturers, each of whom creates an internal circuit with certain characteristics and a methodology for generating a unique code.

The following types of Touch-Memory are widely used:

  • with markings starting with DS (Dallas), used in a huge number of models Vizit, Eltis, C2000 and others;
  • marked DC, as well as Cifral KP-1 - Touch-Memory data is intended only for Cifral intercoms;
  • K series, widely used in Metacom access control systems and other intercoms.

Similarly, there are classes and RFID formats, for example, the oldest HID, the popular EM-Marin, and also used in Mifare cards triggered from a long distance. Therefore, before figuring out how to program a personal key for an intercom from an entrance door, you first need to purchase a Touch-Memory or RFID compatible format.

Do-it-yourself intercom key programming

The method for encoding a personal key for an intercom from work, home or friends' entrance consists only of recording the data of the corresponding personal identifier into the memory of the device controlling the door. To do this yourself, you need to access the service functions from the front panel keypad.

The technicians who install the intercom are required to reprogram and change the factory master codes and other service information of the device.

If this is done, the methods for registering your key in the intercom using standard access combinations will not work. However, a huge number of devices on the door respond to factory codes and allow you to activate service functions.

Algorithm of actions

The easiest way is to find out how to encode the key for the intercom from the entrance door from a service company. Some of them provide such data.

But there is a set of standard actions for intercoms of common brands.

  1. Rainmann, Raikman - press call, enter 987654, after the beep - 123456. If the invitation P appears on the display - press 2, apply the tablet, press #,<номер квартиры>, #. Recording into memory is done with the * button;
  2. — dial #-999, after the invitation sound, dial code 1234 (for some series - 6767, 0000, 12345, 9999, 3535). After this, press 3, after a pause - the apartment number, apply the key, press #, *. If the factory code (1234 and others) is not accepted, the intercom will emit a two-tone signal;
  3. , - hold the call button until there is a reaction (sound, invitation on the display), enter 1234, then the apartment number, call. In response to the invitation to place the key, exit the menu by pressing the * button.

The most modern versions of the Cifral intercom use fairly complex code sets. The method for encoding the key to the intercom from the entrance door looks like this: call, 41, call, 14102, 70543.

Then you should wait for the invitation to appear on the screen, press 5, enter the apartment number, after the inscription on the Touch display, attach the key. A sound signal indicates recording into memory.

Conclusion

You can record any of the purchased keys, which are mistakenly called blanks, into the intercom memory. In reality, it is a working mechanism with its own unique code. It only needs to be registered at the entrance device.

A variety of key application techniques are available. The same one can be used on several intercoms of the same brand, provided that registration has been made on each one. The main thing is that the Touch-Memory tablet or RFID card or key fob must have a format compatible with the device on the door.

Video: How to duplicate an intercom key



Soldering another chip onto another board or cutting a track on the board for the tenth time to make the next (but not the last) changes to a new device, you begin to think: “Shouldn’t I quit this tedious task?!” Your new device does not turn out the way you would like, but you are already tired of changing the circuit and redoing everything on the board.
Flipping through electronics magazines, you increasingly come across the words: processor, microcontroller, firmware, programming. But these words have no specific meaning for you. You've heard somewhere, and maybe even held in your hands something that you even think about with awe... microcontrollers! Something that reduces the size of devices, giving them capabilities unattainable to you... No, you, as an electronics engineer, understand the general ideas of how these devices work, but their practical use in your products is out of the question! You have already tried several times to master microcontrollers, you even purchased a couple of books from the “... for dummies” series and downloaded several popular tutorials from the Internet. Some time passed, and everything stopped at the most interesting point: the diagrams shown in the books were clear to you, but the methods for creating a program remained a mystery to you. Typing a few characters in English (or some other language) in the program specified in the book is not a problem for you. But the ESSENCE and METHODS of using these mysterious symbols, the sequence of which in the book was called a program, are not clear. You blamed yourself for being stupid and put the idea of ​​mastering microcontrollers aside. And why? You already do a great job: you have many, many chips on which you develop your devices... Devices on large boards that you debug and rework for a long, long time...
But meet the guy from next door: he writes programs, loads them into the microcontroller, and what you have to debug for months, he does in a few days. You panic, start looking for abandoned books, and remember everything you’ve read before... He can, but you can’t. You get to know this guy better, and under the guise of a side conversation, you begin to ask him about microcontrollers and their capabilities. And he calmly says that controllers are a hobby for him. You ask him to tell you about their device. His answers are simple and unpretentious.

Microcontrollers. What is a microcontroller?
A microcontroller is a small specialized computer, in Russian micro-computer. Moreover, this microcomputer is made in one chip, on one crystal. Hence the full name: “single-chip microcomputer”. Like a computer, a microcontroller is an electronic device whose operation is controlled by a program - a sequence of commands pre-loaded into memory. These commands are executed by the processor: a sort of “mega-brain” that includes an ALU - an arithmetic-logical unit. That is, the processor “can” perform mathematical operations and perform logical operations on data.

Processor capacity. Methods of presenting information.
Both the processor and memory are digital devices that “understand” signals of only two levels: there is voltage/current, and there is no voltage/current on the line. These two states are usually written as follows: logical one - “1”, and logical zero - “0”. Commands and data are a collection of ones and zeros. One line (called a discharge) in its two states can convey only two values. But as the number of digits increases, the number of values ​​also increases: two digits are already four, and eight digits are already 256 values. A digit is usually called a bit: one digit is one bit. And a set of eight bits is a byte: eight bits is one byte. But one byte has only 256 values. To transmit more information, several bytes are used sequentially located in memory. Two bytes already convey 65536 values. Three bytes - 16777216 values! And so on. The most common processors are those that can process eight bits in one operation, which is why such processors are called eight-bit.

Processor command system.
When a processor is developed, it is built into the ability to execute certain commands. The instructions that a given processor is able to execute are called the instruction set. What are these commands? The most common arithmetic and logical commands, as well as commands for working with ports - communication lines between the processor and the outside world. The processor, having read a value from a memory cell or the state of a port into its own memory - a register, can perform mathematical or logical operations on it. Mathematically, the operations are clear to us: addition, subtraction and others. Logical actions mean the following actions: comparison - more, less, equal; working on the bits of a memory cell or register: zeroing or setting it, as well as operations of shifting bits to the left or right.

Memory and its types.
Data can be read from memory. Memory is a place where a program and/or data can be stored for some time. They can be stored for a short time - until the power is turned off, or for a long time - regardless of the presence of supply voltage. The first type of memory is used to store intermediate data used when performing various operations. That’s why it’s called “random access memory”. The second type of memory is more often used to store programs. There are several types of long-term memory: once programmable memory, electrically erasable memory, and ultraviolet or x-ray erasable memory. The physical structure and operating principle of memory may be different, but the essence is the same: to store data. The concept of “cell” is used to describe a data storage. Therefore, the more cells, the more data can be stored. Each cell has an individual address. The processor accesses the value of a memory cell exactly by its address.

Ports. Port operation modes.
Data can also be received from external devices through communication lines - microcontroller pins. These communication lines are called ports, or scientifically: data input and output devices. The port pins can be inputs, using which the processor receives information from outside from various sensors, or be outputs, sending signals to which external devices can be controlled. In modern microcontrollers, the pins of almost all ports are bidirectional, i.e., they can be both inputs and outputs. Universal ports need to be configured - set the operating mode to input or output. For this purpose, there is a special memory cell - a register for controlling port operating modes. For example, in order to make the required output (bit) of the port an input, 1 or 0 is written to the control register bit, depending on the microcontroller model.

Peripherals.
But the microcontroller contains not only a processor and memory. The main role is played by the so-called peripheral devices: timers, counters, analog comparators, digital-to-analog and analog-to-digital converters, serial communication devices (often called a serial port). Often the microcontroller also has a number of non-volatile memory cells (most often Flash), in which various data can be stored.

Microcontroller families.
The presence of all of the listed devices in the microcontroller is not necessary. Most often, a manufacturer produces several product models containing various peripheral devices. Microcontrollers with one type of processor (and a set of executable machine codes), but different peripheral devices, belong to the same family. That's what they say: microcontrollers of the ATtiny family.

Multifunctionality of microcontroller pins.
The question may arise: how do all these devices “communicate” with the outside world, if most chips in a DIP package have no more than 40 pins? To solve the problem of pin shortage, a method is used to combine the functions of several devices using a single pin. For example, the pins of one of the ports (8 bits - 8 pins) are also used to operate an analog-to-digital converter, and the pins of another port are used as inputs of analog comparators, a serial port, or for connecting other built-in nodes. To control the operating modes of the pins, a special port operating mode control register is used (it was discussed earlier when explaining the principles of port operation). In most microcontrollers, the pins have multiple functions. If you refer to the technical documentation for the controller, when describing the output function, a note will be made about the main and alternative functions of this output. For example: PD0/RX - the zero bit of port D is also the input of the serial port, PB1/Ain0 - the first bit of port B is also the input of the analog comparator.

Algorithms. Programs.
Commands to the processor are given in a certain order, in accordance with a previously developed algorithm. An algorithm is a sequence of execution by a processor. Moreover, the commands must be understandable to the processor, and at the same time have an unambiguous interpretation, without any independence in its execution. The algorithm can be written down verbally. For example: start of the program; make the zero bit of the port an input; make the seventh bit of the port an output; read the value of the zero bit of the port; if it is equal to a logical one, then perform the following actions: load a logical one into the seventh bit of the port; return to the beginning of the program. This is how we described the algorithm of operation of a circuit consisting of a switch, a light bulb (or other load) and a power source. The result of the execution will be as follows: when you press the button, voltage is supplied to the input of the port, the processor executes the program - it supplies voltage to the output of the port. And while the contacts are closed, there will be voltage at the port output.
But such writing is very difficult to perceive. Therefore, methods for graphically describing the algorithm were developed. Here is an example of a graphical recording of the above algorithm.
Rice. Algorithm-1. Graphical method of describing the algorithm

Branch commands: conditional and unconditional branches.
Special processor instructions include conditional and unconditional jump instructions. In order to understand this, it is necessary to explain the concept of “the address pointer of the command being executed.” The processor has a special register that stores the address of the currently executing instruction. When power is applied, this register is reset and a zero is written to it. Next, the processor begins to execute commands stored in memory, starting from address zero - after all, the address pointer register of the executed command contains zero. After executing the command, this pointer is incriminated, i.e., its value is increased. The processor reads the next instruction from memory at the address specified in the pointer. That is, commands are executed sequentially. You can break the sequence of program execution using conditional and unconditional jump commands. To do this, a command is stored in one of the memory cells, instructing the processor to change the value of the address pointer register of the instruction being executed. An unconditional jump instruction instructs the processor to change the sequential order of program execution and begin executing instructions stored in memory starting from the previously specified address.
The conditional jump command is more complex: when executed, it checks whether some condition is met. For example, you need to compare the value of two memory cells. If the value of the first cell is greater, then continue executing the program at address A, otherwise (i.e., the value of the first cell is less) - go to address C.

Interrupts and their types. Interrupt priorities.
There is another way to “force” the processor to stop sequential execution of the program and start executing the program at a specific address - call an “interrupt”. The concept of interruption appeared along with the first processors. The thing is that the processor controls devices that are slower than it. For example, the processor must process data until a certain signal appears. Let's give a simple example: the processor runs a program to count the number of pulses received at one of its ports. When you press the button, the processor must interrupt the execution of this program and execute another program: turn on some device (i.e., apply a logical one to one of the bits of the port - “1”). How to solve this problem? In the program itself, you can constantly poll the required digit of the port to which the button is connected. But at the same time, part of the processor resources (speed) will be practically wasted on polling the port. The second way is to use interrupts. The processor (and therefore the microcontroller) has a special pin. It is usually referred to as “Int” (English: “Interrupt”). When a signal is applied to the “Int” pin, the following actions occur:
- stopping the execution of the main program,
- the value of the address pointer register of the executed command is stored in RAM (the place where program execution is interrupted),
- after which a new address is loaded into the same register (depending on the wishes of the processor manufacturer),
- in the memory cell with the specified address there is an unconditional jump command: “go to address xx”,
- in memory, starting from the cell with address xx, there is another program, let's call it a utility program.

In our case, the utility program must issue a logical unit to the port, thereby turning on the necessary device. And here is where the fun begins: the last command of the utility program is the “exit interrupt” command. Upon receiving this command, the processor reads the previously stored value of the instruction address pointer register from memory and loads it into this register. Consequently, the processor continues executing the main program from where it was interrupted.
But an interruption can be caused not only by external signals, but also by internal devices of the microcontroller itself: timers, counters, serial ports and even non-volatile memory. Again, this is done mainly to reduce the number of commands executed to analyze the state of these peripheral devices. Let's give an example: the process of writing data into non-volatile memory is very long, during which time the processor can execute a very large number of commands. Therefore, the processor executes the main program, issues a command to erase non-volatile memory, and then continues executing the main program. As soon as clearing of non-volatile memory is completed, the control circuits generate an interrupt signal from this memory. The processor interrupts the execution of the main program and the process of writing data to memory begins. This method of performing an action outside the main program is called background mode. It is also often said: “this part of the program runs in the background.”
When working with interrupts, you must be careful: a situation is possible in which the execution of the program and the operation of the entire device may be disrupted. The fact is that the microcontroller has several interrupts. To control interrupt operating modes, there is an interrupt control register. When setting up interrupt operating modes, you allowed several interrupts to operate - this is a normal situation. But, having received an external or internal interrupt signal to the main program and proceeded to execute the interrupt service program, you did not disable interrupts. The processor is executing a utility program and at this moment it receives another interrupt signal. The processor interrupts the execution of the service program and proceeds to execute the program for processing a new interrupt. It's easy to imagine what this might lead to.
To solve this problem, a method was developed to assign each interrupt a degree of severity, or “interrupt priority.” Depending on the microcontroller model, the interrupt priority can be set rigidly (and the programmer only allows or disables the processing of a particular interrupt), or can be implemented programmatically by programmers (i.e., the interrupt priority depends on the preferences of the programmer and the algorithm for implementing a specific task).

We control the processor. Programming languages. Translators.
Machine codes. Assembler.
Commands for the processor are sequences of ones and zeros. Often processor commands are called machine codes, emphasizing that these commands were originally designed for a specific performer - a machine, but not a person. Remembering commands from numbers (machine codes) is very difficult. Therefore, to simplify the work, a way was invented to replace digital sequences with symbolic abbreviations that are more understandable to humans. For example, for the command “load data” they came up with a clear abbreviation “ld” (English “load” - load), for the command “compare” - “cp” (English “compare” - comparison), and so on. This method of symbolically recording processor commands is called “assembler”. If, when working with machine codes, the programmer directly enters processor control commands into the device’s memory, then when working with assembler, there is a kind of intermediary between the program and the processor that converts symbolic notations into machine codes. The program that acts as an intermediary is called a translator, i.e., a translator. But there is a small nuance: assembler refers not only to the method of symbolic designation of digital instructions (machine codes), but also to a translator program that helps the programmer translate symbolic designations of commands directly into machine commands. Therefore, the following technique is often used: when they talk about a language, they write Assembler, when they talk about a program, they write simply assembler.
Assembler has a huge advantage: programs written in Assembly are executed very quickly by the processor. The fact is that assembler is practically a machine command. But assembler also has disadvantages: the main disadvantage is the difficulty of writing programs, the second is that even relatively simple programs have a large amount of source text, which makes it difficult to analyze the program.

Modularity of programs. Frequently repeated tasks.
Each programmer accumulated a certain number of programs during his work. But many programs contain the same actions. For example, many programs poll the keyboard and analyze the pressed button. This means that this part of the program code can be transferred from one program to another. Program libraries were gradually formed from such pieces (modules). Programmers began to “sculpt” a program from modules: that is, they inserted the required module into the required place in the program. This approach accelerated the process of writing a program and increased the reliability of the program as a whole due to the use of already debugged modules. But from the first days, the problem of sharing modules arose: after all, each programmer wrote modules according to his own “standard” - as it was more convenient for him at one time or another. Therefore, a standard (more precisely, several starts) for writing these modules was gradually developed. They described the structure of the modules for more convenient “gluing” into one program.

Programming languages ​​and their functional division.
Gradually, these disparate standards for the use of modules formed what would later be called “programming languages.” Like human languages, a programming language has several sublevels that determine both the writing of individual words (modules) and the methods for writing them, as well as the rules for their use. Over time, programming languages ​​have evolved and changed. Gradually, all programming languages ​​were divided into several groups, depending on their “professional orientation”:
- applied programming languages ​​(FORTRAN for mathematicians, FoxPro for financial workers);
- universal (Pascal and Basic);
- system (Assembler and C).

System words began to be called low-level languages, i.e., the programmer works at the lower level, closest to the processor. And languages, when working with which the programmer does not have to directly control the operation of the processor, began to be called High Level Languages ​​(often referred to as Java languages). Do not confuse this abbreviation with the name of the Java language - "Java".

Broadcast of the program. Methods for broadcasting a program.
As with assembler, a program written in any high-level language must be converted into instructions that the processor can understand. At first, this was done manually: a command in assembler was found in a table and written down in machine code. To speed up the process of converting (translating) a program, special programs were written - translators. There are two methods for translating a program: interpretation and compilation. Consequently, a translator is called either an interpreter or a compiler. When using an interpreter, the source text of the program is analyzed and sequentially, command by command, executed by the interpreter. The interpreter contains modules for all usable actions. This per-instruction conversion is very slow. But this method has a big advantage: you can stop the program, change its code and continue its execution. This is convenient when debugging a program. Also in this case, we have the source text of the program and can edit it many times.
When using a compiler, the program text is analyzed and a file containing machine instructions, called an executable file, is created. This ensures a very high execution speed of the compiled program - because the conversion of the program text into machine codes occurs only once during its compilation. But you won’t be able to change the program on the fly: you need to change the program text and compile it again. If the source code is missing for some reason, then it is impossible to recompile the program, and changing the executable file is extremely difficult.

The process of creating a program. Program development environments.
With the advent of translators, the process of creating a program began to look like this:
- an algorithm for the future program is being developed,
- the algorithm is encoded (i.e., described in the form of programming language commands),
- the resulting code is written in some text editor,
- the file with the program text is transferred to the translator,
- the translator converts symbolic commands into commands understandable to the processor and saves them to a file,
- this file is loaded into memory.
As you can see, the programmer had to work in several programs. Most often, all these programs were written by different manufacturers, so the compatibility of these programs with each other was not guaranteed. Their compatibility had to be determined by trial and error.

Integrated software development environment.
Recently, a new approach has emerged: the “Integrated Development Environment” (IDE). Integration refers to the execution in one program of the entire process of creating a program: having written the program text, the programmer with a mouse click starts the translation of the program text into machine codes, after which the resulting executable file is automatically loaded into the memory of the processor device. That is, everything is done in one program. This approach speeds up the programmer's work.

First difficulties.
All previous chapters were an introductory course, preparing you to perceive new information. We have several problems along the way.
1. A large amount of varied information: electronics, microcontroller design, algorithms, syntax of programming languages, descriptions of working with software tools. And how to write? One reader is a good electronics engineer, but has never written a program, another is a programmer, but electronics is at the level of a radio circle, the third is something in between...

2. Selection of MK: if all microcontrollers are good, then on the basis of which product and which manufacturer should we base the process of further training and practical application of microcontrollers?
In order to select a microcontroller for TRAINING, we need to fulfill the following conditions:
A) the microcontroller chosen for training must be accessible and inexpensive.
B) it must be a modern product, but not the newest.

Now in more detail about each point.
With point A, everything is clear: what’s the point of studying a product that is difficult to purchase or its price is exorbitant for a beginner.
Point B requires clarification. The fact is that new products always have some flaws. They are discovered only after some time, until someone accidentally stumbles upon this problem while working with this product. But new products do not immediately find their way into new designs: it takes time to write programs for new models. There is a human factor here: developers already have ready-made solutions for previous models of microcontrollers, and switching to new ones is difficult.
Also, all new microcontrollers have only a proprietary description. And it is written in English and using numerous professional terms: after all, it is intended for professionals! And we are students... After some time, examples of designs appear, more detailed descriptions with numerous comments and advice. Then someone will start translating the documentation into Russian (not everything, but at least the most complex or most frequently used).
There may be no tools for a new microcontroller: compilers, debuggers and programmers “do not understand” this product. Again, waiting until the authors of these programs update their creations...

3. You must select a programming language, on which we plan to write programs for MK.
Choosing a programming language is a very sensitive task. To teach microcontroller programming, I would like to use a programming language with a simple syntax: the programmer must deal with the program, but not its design!
Here it is necessary to make an explanation in advance: currently, three “families” of languages ​​are popular among developers of programs and devices on microcontrollers: C (written as “C”), Pascal (Pascal) and BASIC (BASIC). Pascal was originally developed as a tool for learning programming. BASIC itself is similar in structure to Pascal, but the writing of commands is simplified and the requirements for program design are much less. C is considered to be a language for professionals. Xi is like Chinese philosophy: not only the symbol (command) is important, but also its style and color. Jokes aside, but my opinion is this: C is a nightmare. Its use is justified only in some very narrowly specialized tasks. But our task is to try our strengths and spend them as little as possible on tasks that do not have a direct connection with the main goal.

4. We need a program development environment for microcontrollers. Its choice directly depends on the type of MK used and programming language.
The program development environment is very important for successfully mastering microcontroller programming. It is possible to write programs in a text editor like Notepad, but it is inconvenient (tested!). And calling the compiler on the command line is a thankless task in our graphical window-based age.
The choice of development environment directly depends on the microcontroller on which we will build the practical part of the training. On top of everything else, we need to have free tools. But, as testing of such programs has shown, free software most often has mediocre quality both in terms of use and in terms of learning MK programming: the presence of errors or flaws in the translators themselves create additional difficulties and deprive them of self-confidence.
A demo version would also do, if it had a minimum of restrictions and worked for at least half a year - this is exactly the period needed to gain skills in working with microcontrollers at home.

5. A programmer that will be used to load written programs into the MK’s memory. The choice of programmer also depends on the type of MK used. There are, of course, “universal” programmers that allow you to work with different microcontrollers and memory chips, but they are expensive. Yes, and not needed in most cases. Therefore, it is easier to produce something highly specialized for this family of MKs.
But the point is not so much the complexity of the programmer circuits, but the method of connecting this programmer to the PC. Here it is necessary to clarify: a programmer is an electronic adapter that converts signals from computer interfaces (COM, LPT and USB ports) into signals supplied to the outputs of the MK to load the program into its memory. The electronic adapter is controlled by a PC program, which “forces” the adapter to issue the necessary sequences of signals to the MK pins.
If a programmer adapter connected to a PC via COM and LPT ports can be made at home - “on the knee”, then making such an adapter, but connected to a USB port, is already somewhat problematic: the heart of such an adapter is often... a microcontroller. A paradox arises here: in order to program the MK we need to program the MK.
A logical question arises: why make a complex adapter that connects to USB, when you can make a simple one and connect it to an LPT or COM port. The thing is that many (almost all) modern PCs do not have these ports. Therefore, you will have to make a more complex adapter for programming the MK.

March 2010

I asked myself these questions in March, and now it’s already the end of November. But this time was not in vain: I found a way out of the situations described above and found answers to all the questions that tormented me. And now first things first.

Answer to question number 1
If the materials of the previous chapters could somehow be logically systematized and presented step by step, then the materials in the subsequent chapters are given in parallel: one implies the other. Perhaps my method of presenting new materials will seem somewhat chaotic to you, but I could not come up with something more beautiful in design.

Answer to question number 2
Microcontroller manufactured by ATMEL ATMEGA48. It is well described, has been in production for several years, is not planned to be discontinued for at least another 3 years, and has optimal technical parameters.

Answers to questions 3 and 4
The programming environment is BASCOM (manufactured by MCS Electronics, author Mark Alberts). The programming language is similar in style and requirements for the design of program text to Pascal, but the command syntax is taken from BASIC.
Reasons for choosing:
- a fully functional demo version of the compiler (the only limitation: the code generated by the compiler is limited to 4 KB in size)
- the desire of the program author to cooperate (I translated the interface messages and help system into Russian, he added Russian to this program)
- presence of a Russian-language forum for users of this compiler

Answer to question number 5
It was not possible to combine the simplicity of the circuit and USB. It was decided to describe two models of programmers: one connects to the LPT port of the computer, the second to the COM port. If these ports are missing, the second version of the programmer can be connected to a computer using a USB-COM converter. This is how we get a USB-COM-programmer-microcontroller combination.
The first model of the programmer is known as STK-200/300, contains a third-state buffer chip and several resistors. The second model is the well-known USBasp programmer.

Appearing on our market in the 90s, they warned the installer: they say, you can only break the circuit that controls the activation of the starter. True, on carburetor cars there wasn’t much to tear apart: maybe the ignition coil power circuit, which an experienced thief could restore in seconds. And only with the advent of injection engines it became possible to block the complex power and ignition control system.

The first and probably the last domestic car with an injection engine and a conventional ignition key was Svyatogor with a Renault F3R engine. Everything there was like on a carburetor car. The ignition switch supplied power to the “brains” of the engine, which ensured the operation of the spark plugs and fuel supply.

With the advent of the fuel injection system, VAZ cars immediately acquired an APS unit (automotive anti-theft system), which communicated with the chip in the ignition key and only after identifying its key gave the ECU (electronic control unit) permission to start the engine. Now the block has greatly decreased in size and is located under the steering column cover. The car's ignition switch body is surrounded by a frame that is connected directly to the immobilizer unit. When the ignition is turned on, the unit sends impulses to this frame and goes into reading mode, that is, it begins to receive a response from the chip key. From the impulse, the chip key receives energy and begins to transfer the key embedded into it to the immobilizer frame. The immobilizer frame receives the code and, if the code matches, makes it possible to start the engine. After this, everything runs as usual and the mentioned starting circuit is no longer needed.

It is clear that with this approach, a regular ignition key gives way to a chip key. There is nothing complicated about this: even people who do not have a car at all encounter chip keys every day. After all, the same technology was used to make the key to the intercom, which now stands on the entrance door of almost any apartment building.

Chip keys come in four main types.

  • A key with a chip that allows you to only start the engine by turning a blade in a conventional ignition switch. The chip is a small cylinder or plastic parallelepiped containing an inductive coil and a microcircuit in which the individual code of this key is programmed. The chip in this design is sealed, which allows you not only to use it in the rain, but even to go swimming with it.
  • A key with a chip and a radio transmitter that allows you to open and close the car using buttons on the key fob at a distance of no more than 30–50 m, starting the engine by mechanically closing the contacts in the ignition switch. In some cars, such buttons on the key activate the standard car alarm, which includes a siren, as well as tilt and motion sensors. But the tightness of such keys is limited to a splash-proof design: they cannot be immersed in liquid.
  • A key that does not normally use a mechanical blade. The car is opened and locked using the buttons on the key. To start the car, the key is inserted into a special slot on the instrument panel, and then the button is pressed. The design of the key is splash-proof.
  • Key for so-called keyless entry. The car doors are opened by pressing a small button on the handle, and the engine is started by the “start-stop” button. In this case, the key must be in the owner's pocket. There is a slot in the car's interior, but the key can remain in your pocket throughout the trip. At the same time, all control buttons on the key remain at the owner’s disposal. If desired, you can open and close the car by pressing the corresponding button on the key.

Downshifting... If you have frankly expensive keys, then you can make yourself a blank like this without any chips and go swimming with it. And let your family keys lie somewhere in the nooks and crannies of the car.

Downshifting... If you have frankly expensive keys, then you can make yourself a blank like this without any chips and go swimming with it. And let your family keys lie somewhere in the nooks and crannies of the car.

Do such chip keys have a future? We think not: this is just an intermediate stage in the development of access systems. Systems have been known for a long time that respond to fingerprints, iris and anything else. There are also strange, to put it mildly, solutions: for example, introducing a control chip into the owner’s body. And just yesterday there was a large-scale premiere of the next iPhone, which recognizes the owner by his face. True, there was an embarrassment at the presentation: the smartphone still managed not to identify its creator...