📜 ⬆️ ⬇️

Programming microcontroller family Cypress

Hi, Habrayuzer!
This article I was asked to publish by my friend, Eugene, who does not yet have an account on habrahabr. Therefore, below I present to your gaze his article.

In recent times, at work, I quite often had to deal with such a family of microcontrollers as PSoC Cypress ( http://www.cypress.com ). Before that, I had never once worked with this MK family, I honestly did not even hear anything about them. Actually, the first thing, as usual, I started with studying all the documentation, reading articles, searching for examples, etc., I think everyone does that. And I was faced with such a problem as a catastrophic lack of Russian-language material on this subject. In my opinion, this is a pretty serious gap. That is why I would like to try to write an article or even a series of articles on this topic. I would just like to say that writing articles is something new to me, so please do not be angry at the presentation of material and other flaws, I hope, in time, I will correct it. So let's go ...

What is PSoC and what is it eaten with?


PSoC - Programmable System-on-Chip, this is hidden behind the abbreviation. A programmable system on a chip, in microelectronics, is an electronic circuit that performs the functions of a whole device (for example, a computer) and is placed on a single integrated circuit, the final configuration of which is programmed by the user. Cypress Semiconductors was one of the pioneers of this trend in the MK market. At the moment, Cypress is one of the leaders in this field. There is a huge line MK to solve a variety of tasks. The volume can be read in more detail on the manufacturer’s website.
We proceed directly to the design. We will need the PSoC Designer software package (latest version 5.2).
')


I want to immediately draw attention to the image, as we can see, there is a “designer” on it. And not just like that, because the highlight of Cypress is just the approach of connecting various digital and analog blocks. This allows even beginners to work in this environment. Everything is intuitive and this is good news.
Let's proceed to the creation of the project itself. After the usual new project and selecting the desired directory, the following menu appears:



We see that you can select the desired Device (this is the MK) and the choice of writing language.
By the way, I have to remember that the product is distributed free of charge, but in order to remove various restrictions on the amount of code for the C language, you need to register your version. For example, I chose Device CY8CLED04-68LFXI, the C language. Click OK and see:



In area 1 we have the global settings for the MK (timers, operating modes, power, etc.).
Area 2 is the setting area of ​​the pins. Choose a leg and customize it as you please. All possible options are written in advance and immediately visible.
Area 3 is the area of ​​connection of the modules, it contains all available modules for this MC.
Well, finally, 4 area, in it we see a certain number of blocks that can be connected. Also in this area is configured switching of various elements. Each module occupies a certain number of blocks. Here you can meet the problem of their lack. Unfortunately, nothing can be done except how to choose another MC in order to increase the number of available blocks. Now we have connected the Cap Sensors (touch panel) and LED (led diode) units.



All blocks after insertion are connected as necessary themselves.
Programming in itself is easy, since together with the blocks, libraries of these blocks are automatically connected, which describe many different functions for working with them. If you study these libraries well, the programming process is very, very much simplified.

By cons of all this I want to attribute the lack of funds for software debugging. More precisely, they are there, but all debugging features are turned on after purchasing a variety of emulation tools (Y3215-DK (ICE-Cube)).
The process of sewing the program itself is carried out using the Mini Prog and the PSOC Programmer.

For the first article, I think that's enough. If there is interest, I will analyze many modules and various examples in detail. Thank you all for your attention.

PS All comments on this article will also be given by Eugene on my behalf, so you can ask him questions.

Source: https://habr.com/ru/post/145285/


All Articles