📜 ⬆️ ⬇️

Microcontrollers of the Kinetis family from NXP-Freescale for embedded electronics. Discovering for yourself


From time to time, I also need to change something. And most often I change the family of microcontrollers in my development. And I'm not alone in this. Every year at least 50% of developers change the processor on which they will carry out the following projects. This time I decided to try the Kinetis family.

Kinetis is a family of low power 32-bit microcontrollers based on ARM Cortex-M0 / M4 / M7 processor cores, without MMU, with a core frequency of up to 240 MHz. The absence of MMU means that Kinetis is not designed for operating systems like Windows, QNX, Android, iOS. These microcontrollers are designed to run hard real-time systems as part of a variety of embedded devices, from cardiac implants to electric vehicle controllers. Although there are Linux builds to run on Kinetis.

Where can I apply Kinetis?


Freescale could list a lot of applications. But for myself, I singled out the following: industrial controllers, frequency converters with vector control without touch control, thyristor controllers, voltage converters, electrical network analyzers, programmable logic controllers for elevator control systems, lifts, conveyors and other mechanisms with multiple drives. A promising topic for Kinetis seems to be the Internet of things and intelligent sensors. Finally, it would be nice to try them in multikopter and other robotics.

What is interesting about Kinetis?


The closest competitors to Kinetis include microcontrollers of the following families: STM32F4 , LPC4000 , XMC4000 , SAM4S, and some lesser known ones. For some time now, competitors have also been offering solutions with the ARM-Cortex-M7 core. In general, too, do not stand still.
')
According to the 2014 Embedded Market Study, the most popular 32-bit family in the world is STM32. Therefore, further emphasis will be on the capabilities of Kinetis which are not in the STM32.

In the figure below, I depicted a block diagram of the senior representative of the Kinetis family of the MK70FN1M0VMJ15 chip. It is a little more detailed than it’s customary to depict in Freescale’s descriptions to highlight the characteristic features of Kinetis. In parentheses are the names of the blocks used in the proprietary descriptions.


Here are the main advantages of Kinetis:

-The breadth of the nomenclature . The latitude of the nomenclature Kinetis is not inferior to the STM32 and even surpasses. Kinetis includes the smallest chips in the world (2.0 x 1.6 mm) on the ARM core and advanced MK70 chips with the number of pins 256 and the ability to connect DDRAM, which are not similar to the STM.

-big adaptation to harsh environments . In the family there are chips with a supply voltage of up to 5.5 V. There are chips specifically for automotive applications with increased resistance to electromagnetic interference. In addition, in the periphery of the microcontroller of the whole family, a lot of hardware solutions are implemented to improve noise immunity. Resilience to failures provide:
- up to five independent clock generators, three of which are on external quartz resonators,
-independent generator for watchdog,
- hardware filters of two types on all digital inputs,
- access control to various peripherals, the ability to manage the rights of tasks,
- unauthorized access detector for a variety of events,
-special signal to reset external devices on a separate watchdog timer,
-the ability to snap some peripherals to protect against subsequent changes before the power is turned off,
-flexible control and prioritization of bus switches
etc.

- enhanced programming and debugging mechanisms . Flexibility and convenience of debugging - the overall advantage of all microcontrollers on the core of ARM Cortex M. As the survey mentioned above shows, the developers of all the tools in the work pay most attention to the debugging tools. And I would even refer the high popularity of STM32 to the availability of the JTAG / SWD debugger for these chips, which is immediately integrated into the debugging boards based on STM32. In addition to this, Kinetis has a special serial SPI-compatible programming interface - EzPort. EzPort allows programming chips without a JTAG adapter at high speeds, and also simplifies reprogramming of some chips in a multiprocessor system. No hidden downloaders or hidden code as in LPC or STM32.

-a large amount of application libraries . Freescale application libraries are distinguished by their thoroughness and openness. What is worth only their library to work on the protocol ZigBee. This is probably the best implementation of the ZigBee stack, fully accessible in source code. Next, of course, follows the library to control the engines. Freescale is expected to release an updated and expanded software package for the development of engine management systems on Kinetis. There is a library for building graphical user interfaces eGUI, a library for developing touch panels and keyboards, a library supporting medical communication protocols, a library supporting the security standard IEC 60730-1: 2010, optimized for hardware accelerators, libraries of cryptographic functions, libraries connecting to cloud services etc. And that's not counting the software that accompanies the real-time operating systems for Kinetis, which are listed below. Separately, it is worth mentioning the various initial loaders, as well as the developer’s very useful FreeMaster tool, which is essentially an implementation of an oscillographic software module built into the microcontroller with a logger function and command control.

-the presence of effective free development tools . Without free development tools, this Kinetis article would make little sense. Yes, for Kinetis there is a very advanced free development environment based on the Eclipse project and the GCC compiler called Kinetis Design Studio IDE. This powerful environment contains a high-quality source editor, compiler, basic libraries, graphical configurator for microcontrollers (analog STM32CubeMX for STM32 microcontrollers), automatic generator of template projects and source texts, SDK with a full set of drivers for all peripherals, symbolic debugger-programmer based on various JTAG / SWD adapters with plug-ins for debugging operating systems and project generator using real-time operating systems. For those who work with commercial IDE Keil or IAR in Kinetis Design Studio, it is possible to automatically export projects and source texts to these IDEs and synchronously with Kinetis Design Studio to support them.

The picture shows the project preparation workflow window in Kinetis Design Studio


-A wide selection of ready-made real-time operating systems . Real-time operating systems - this is something without which modern embedded electronics is unthinkable. They enable the integration in a single device of a huge number of functions without loss of reliability and ensure its competitiveness. Here, Kinetis has what I would call a compelling argument — the open source real-time operating system MQX . Actually, my interest in Kinetis began with her. But most developers prefer FreeRTOS . For FreeRTOS, there is also the possibility of generating projects in the Kinetis Design Studio. In addition, you can generate projects for widely known operating systems uCOS-II and uCOS-III . As already mentioned, there is a build of Linux OS for Kinetis. From the mbed.org project site, you can download the mbed OS open source operating system for Kinetis. And of course you can find at least a dozen commercial operating systems adapted for Kinetis.

Briefly about MQX.


The first feature of this real-time operating system (hereinafter RTOS) is an unusually developed driver layer for the Kinetis family. Practically for all interfaces there are drivers and as a rule in two implementations: using poling and using interrupts. The second feature is the multiprocessor of this RTOS. It contains a stack of protocols and routing for transparent interaction of tasks performed on many microcontrollers. The feature is very relevant for complex robotic systems. And the third feature is advanced middleware software supplied with this RTOS.

The composition directly RTOS is presented in the diagram below.


A basic composition of the middleware is difficult to enumerate because it is constantly expanding. But in any case, here are the components that are part of the software for quite some time:
• File system for drives on SD cards
• File system in RAM.
• File system for NAND Flash drives
• Multiprocessor communication library
• TCP / IP protocol stack including: ARP, DHCP, IP, TCP, UDP, PPP, ICMP, SMTP, SNMP, DNS, HTTP, NAT, RIP, Telnet, FTP, WEB server with authorization, CGI.
• Wi-Fi drivers for the Qualcomm Atheros AR4100 chipset family
• USB host classes: audio, CDC, HID, HUB, MSD, PHDC, printer
• USB device classes: CDC, HID, MSD, PHDC
• Universal FreeMaster communication tool driver

Interesting examples of applications for Kinetis:



Electrocardiograph and pulse meter (with source code)
Connecting a camcorder with an OV7675 chip (with source code)
A simple practical guide to measuring engine parameters necessary for vector control
Fine-tuning the algorithm without touch control BLDC engines
Using DMA for organizing a continuous automatic scan cycle of an arbitrary set of analog inputs by an analog-to-digital converter module
Reliable way to update the microcontroller firmware via wireless communication channels using mutual substitution of Flash memory banks (with source code)
Manage and monitor microcontrollers via Twitter (with source code)
Manage Kinetis microcontrollers from a device running Android OS
Audio player on Kinetis (with source)
Using the fast Fourier transform to implement the gauge parameters of the power grid (with source code)

Listed here is a small part of the application examples published by Freescale for the Kinetis family.
The rest can be found on the official website.

And now to practice



I do not like ready-made debugging boards and KITs. Having sufficient experience with microcontrollers, you can immediately start developing “combat” platforms without wasting time on unnecessary prototypical iterations.
After a brief study, I developed a debug frequency converter:

This device receives voltage from a single-phase network and starts the operation of an asynchronous motor with a capacity of up to 3 kW. In addition, it provides a smooth start and stop of the engine, and adjustment of its rotational speed in a fairly wide range. The engine can be made to rotate even several times faster than it could rotate connected directly to a 3-phase network. The converter uses the modern method of vector control.

The project is open for study and is located by reference.

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


All Articles