Arduino is one. Part 1


Recently, Arduino-like motherboards no longer surprise anyone, as well as Chinese clones thereof. In this article, we will talk about the Cypress Semiconductor's Arduino-compatible motherboard, the CY8CKIT-042 PSoC 4 Pioneer Kit , which can be a good alternative, either due to its capabilities or its highly functional IDE.

What it is


This kit is based on the PSoC 4 chip, which, in turn, is based on the Cortex M0 core and has 4k RAM and 32k ROM. In addition, there are a lot of analog peripherals on board - two operational amplifiers, a 12-bit ADC (SAR ADC), support for capacitive sensors, one of which is on the board, two comparators and more. More details can be obtained from the datasheet . It should be noted right away that when it comes to compatibility, it means only a kind of 'pin-to-pin' compatibility, while software will be discussed further.

Order and delivery


You can place an order on the website http://ru.farnell.com/ , more, sort of, like nowhere else. It turned out without problems to pay for the order with a Ukrainian bank card and wait for the order to arrive. Sending was made via UPS, and, strangely enough, the order was already in Ukraine in two days, given that the UK was the exact starting point. By the way, for all the cost of the order (I ordered two boards) at 43 €, the delivery cost another ~ 20 €. Well, at least for a long time I did not have to wait.

Packaging


The whole kit is packed in a plastic case. It looks very durable:



And here's what's inside:



So, what is next?


Next, you should download the proprietary IDE PSoC Creator - at the moment the latest version is 3.0 with the Component Pack 7 service pack. You can download it from the torrent from the official website: http://www.cypress.com/go/psoccreator , only registration is needed there. Then it’s worth downloading the disk image from the page with the description of the whale: http://www.cypress.com/?rID=77780 , this will be useful because there are examples on this image that will help you figure out the IDE and develop projects for this kit.
Speaking of examples, the action “100 Projects in 100 Days” was held on element14 page, we may be interested in the fact that all these projects are in the public domain .

PSoC Creator




In general, to describe this IDE, it would be worth writing a separate article, since the functionality is quite wide, given that the IDE is free. So if this topic is interesting, I will try to dwell on this in a separate article. In the meantime, briefly:
After installing the IDE, you can connect the kit to the PC. In principle, it is possible before that, but only the programmer drivers will still be installed only with PSoC Creator. So, we will open some project from those that are present in the image, after copying it somewhere where rewriting is possible. I started with the PWM Example Project, which is present on the disk image from the whale page:



And we are welcomed by the component update window. Somewhat unexpectedly, but that's okay. We simply agree by disabling the archiving option.
After updating the component, you can connect the kit if it is not already connected and program it using this button:



After pressing it, the project will compile and be sewn ... As a result, the 3-color LED on the board will start sorting through the different colors and their combinations , thanks to 3 independent PWMs that are present in the project.
In general, the project itself is written in C and it will not be difficult to deal with it, so I won’t stop on the project itself, instead I will talk a little bit about the development environment itself - PSoC Creator and the general structure of the project.

So, the project itself consists of a high-level design - “TopDesign” on which you can put the so-called components that represent the code that is generated by the development environment and helps to implement this or that functionality, while the hardware blocks that are on the PSoC can be involved four:



Each component has its own datasheet, which contains a fairly detailed description of both the component itself and its functionality and the APIs that are contained in the generated code for this component. Also, for many components there are examples of use that can help both in configuring the component and in writing code that will use it. Yes, the configuration of components is not so simple, because, as a rule, the functionality is quite wide, and formulating (read, configure) what is needed may not be so simple the first time. In order to change something in the component settings, you need to call the component configurator from the context menu, it looks something like this:



In principle, a “double click” will have exactly the same result. So, the configuration window for a seemingly simple PWM:



So, why am I - without “smoking” manuals and viewing examples of use it can be quite difficult, given the abundance of parameters and settings.
There is also a * .cydwr file that contains the project parameters and chip settings, which I will not dwell on in this article.
Well, besides all this, there is also a “regular” main.c, well, the generated code that will be automatically regenerated with every complete recompilation of the project, if it has been changed, or if the project settings have changed ...

The kit itself is hardware compatible with peripherals ( shields) from / for Arduino, but there shouldn’t be any problems with the software implementation, and PSoC 4 can work at frequencies up to 48 MHz, so there shouldn’t be any problems with performance ...

In addition to all of the above, there is another chip on the board - PSoC 5LP, which, judging from the datasheets on the kit itself, is a programmer for PSoC 4 as well as an adapter UART <-> UBS and USB <-> I2C. In addition to all of the above, it can also be used as a separate programmable Cortex M3 microcontroller, according to the datasheet on the board: http://www.cypress.com/?docID=47035 .

In general, as a plus of this whale, it is worth noting a very functional IDE, detailed documentation, a support forum at the office. developer page and a wide selection of components with already implemented APIs, which simplifies subsequent development.
As a minus, it is worth noting the complete absence of Russian-language documentation and a Russian-language support forum and the fact that the IDE exists only in the Windows version, and although there is an export of projects to other IDEs, for example, in Eclipse this does not save the situation much.

Those who have mastered the entire article to the end, I would like to ask if it is worth writing a series of articles on the PSoC 4 Pioneer kit and PSoC Creator?

Also popular now: