PIC controller Programming PIC controllers. PIC Controller Circuits

When schemes are made, it is necessary that someone or something supervise the implementation of the necessary actions. For humans, this is quite problematic, since you have to use a significant number of different elements to control their operation (transistors, resistors, thyristors, diodes, capacitors and others). But all complex and large circuits can be controlled using controllers (microcontrollers). What they are will be described on the example of PIC families. So what are PIC controllers for dummies? What is their scheme and where are they used.

What is a PIC microcontroller?

pic controller
A PIC controller (or microcontroller) is a means of automating certain actions using a pre-prepared program. A feature of the representatives of this product line is the ease of programming and the availability of all the necessary functions for work. Outlining its design, it should be noted that only one silicon crystal is present in its composition (this is a characteristic feature of all microcontrollers). In addition to it, the PIC controller has a certain number of legs. Some of them can be used as logical inputs, some as outputs, the rest have two-way use. The legs can be either digital or analog.

For the vast majority of PIC controllers to work, a stable voltage of 5V is required. This is enough for him to work in his usual mode and execute the program set for him. Programming PIC controllers directly from a computer is not possible. For this purpose, a programmer is used.

Controller families

programming pic controllers
The PIC controller does not exist in a single instance. The manufacturer company produces a significant range of microcontrollers, each of which has its own characteristics, capabilities and potential uses. The number of families themselves is quite large and depends on the classifying attribute, which is taken as the main one. Therefore, it is worth reporting only on the main classification, in which there are only three families: 8-, 16- and 32-bit. They, in turn, are divided into others, but since the families themselves are not the topic of the article, they will not be discussed.

Where applicable

Due to its versatility, the PIC controller can be used almost anywhere. Microcontrollers themselves can be found in refrigerators, televisions, washing machines. But the PIC product line has the peculiarity that circuits on PIC controllers are popular among hams and self-taught robotics. With their help, you can easily configure the operation of the node or the entire device. Such popularity is promoted by reasonable price, ease of programming and a significant amount of educational material.

You can use the PIC controller when creating a radio -controlled machine, a robot arm, and in other crafts that can be done, limited to a modest budget. You can use it for something industrial - the topic of creating automatic home-made machines controlled by a microcontroller is quite popular. The range of uses is wide, and with a competent approach, almost any goals can be achieved, therefore, schemes on PIC controllers can be seen not only on amateur creations.

PIC controller software

circuits on pic controllers
The minimum software needed is notepad. But still, due to the free distribution, you can use the MPLAB software tool offered by the manufacturer. More precisely, a line of software tools (development environments, compilers) MPLAB. Thanks to company policy, it is distributed free of charge, but has certain limitations. So, with a short-term demo version you can try with all the features, but after its completion the program’s functionality will be cut. In a full-fledged program, there is a significant toolkit that makes it easy to create programs, conveniently search for various problem areas and carry out code optimization. Depending on the version, the code optimization function may be terminated or the number of controllers supported by the program may be reduced. For the sake of truth, it is worth saying that the company leaves support exclusively to the most popular representatives.

There are a number of software provided by other companies. In general, their functionality is similar, but there are differences. So, many complain that MPLAB has a design disloyal to users. Therefore, manufacturers rely on the preservation of trimmed functions and the convenience of working with their software. Programs for PIC-controllers are very diverse, so there is largely a matter of taste.

Creating a program for a PIC controller

microcontroller programming
You can create a special program using the appropriate software, and even in a simple notebook. This possibility exists due to the fact that it works with programming languages ​​such as assembler and C. The main difference is the amount of information to be written and the ease of setting data. You can hear a lot about C complexity, but assembler is even more complicated and requires a more thorough approach.

So, when creating a program, you must specify for which controller it is intended. It may be necessary to make a number of settings, but it is necessary to carry them out if you have work experience or self-confidence, because errors can lead to the fact that microcontrollers turn into ordinary pieces of plastic and iron.

Programming with a programmer

programs for pic controllers
But how to transfer the developed program to the microcontroller itself? How is the programming of microcontrollers? Especially for this purpose, there are special devices - programmers. They send signals to the microcontroller that change the cells in memory in accordance with the program. To begin the process of data transfer, you must insert the microcontroller into the programmer, and it, in turn, connect to the computer. Then, using the software, you should run the firmware. Typically, programming PIC controllers lasts from thirty seconds to two minutes.

Types of programmers

firmware pic controllers
Which programmer to choose to write the program to the microcontroller? Conventionally, there are three types: home-made, from the manufacturer and factory from other companies. The use of each of them has its own characteristics.

So, homemade programmers are pretty cheap. But their use is fraught with the fact that they can easily turn a microcontroller into a piece of plastic and iron. And the programming of microcontrollers can in such cases address unpleasant consequences in the form of electric shock, so you should adhere to safety precautions. In addition, if you do it yourself from scratch, you often get a product with rather limited capabilities regarding the change of the object of work. But in the global network you can find a significant number of solutions to this problem, proposed by other people, and which probably will not cause you problems.

The original programmer from the manufacturer will be able to perform its work efficiently for any microcontroller. There is a guarantee for it, and if after receiving it does not work, then replacing is not a problem. But in the order of things, when the firmware of PIC-controllers is carried out without problems.

But it stops a pretty high price from its acquisition.

Programmers issued by other companies have a fairly wide range of objects that they work with. Their feature is a low price and / or the ability to work with other microcontrollers except PIC. There are truly universal “monsters” that can provide various types of work, but because of the need to create a large number of compounds, their price is not low.

Schematic Features

pic controllers for dummies
And finally, a few words about image schemes. It should be guided by the legs on the basis of the accompanying documentation, since microcontrollers often schematically differ from the actual construction of the conclusions. The main thing in such cases are the signed conclusions, and it is precisely on them that one should be guided when creating the device.


All Articles