Micro operating systems on avr controllers. Microcontrollers outdated? Operational systems of real time

Golovna / Contacts

I've made more than 10 Trochs electronic devices and completely managed in their low-level robots without an operating system. The situation has changed, if the functionality of the offensive device has expanded dramatically. In addition, vinyl is needed in the task, as it calls through set intervals hour, moreover, the accuracy of the week is added to the result. So it became clear that to write all the software for the vision of the hour is not seen, and it will be done later. After some thought, I realized that the project needed to include a real-time operating system (RTOS and RTOS).

On the front of the PC, de OS - there is more ball for robots with system resources, for the RTOS microcontroller - it is the front of the scheduler, which wins and plays the main role in the "real hour". At the present time, it is important for me to secure the so-called pseudo-parallel vikonannya zavdan. Tobto є kіlka zavdan iz the same priority and it is important to call in the given order at the given intervals of the hour.

A clear offensive butt: at the Eurobot 2011 project, the system had 18 peripheral buildings. Two electronic payments can be functionally combined in one. The number of components changed, the number of components increased (the number of components in the system was changed), the number of components increased free space at the hull. Furnishings make it easier for those who are growing in proportion and cannot do without OS. Also, the RTOS helps to eliminate the possible downtime of the robotic processor, for example, at the hour of the ADC conversion, you can block the task and disable it, and by the same token, I will correctly install the robot. It is important that those who now do not fall into the trap of the task, can save private practice (though you can bring it to non-transferable results). For the sake of what do we care about the growth of these shows? Vlasne, michavlyuєmo s MK is all-powerful, effectively vikoristovuyuchi yogo counting feasibility.

After some recent searches, choose a league on freeRTOS. The RTOS is expanding in C and ported to 27 architectures. The rest of the furnishing for me is virishal. It is necessary to reduce the labor costs and the hour of work from the MC of other pickers. At a time, it’s less to click the port for the AVR.

The presence of the freeRTOS RTOS in the project requires you to have approximately 9.8 KB of program memory and 1.8 KB of RAM. For example, for ATmega32 and WinAVR compiler 60% and 85% valid. Already for this model, creating a device from a great functionality is easy - do not forget the memory. Ale tsia problem v_dpadaє pіd h vykoristannya new models AVR. Price is absolutely nothing for Mega2560 with її 256Kb of program memory and 8Kb of RAM. The trend of future MKs is no longer accompanied by the success of RTOS.

Pobіzhshi probіgshis on RuNet, I'm wondering vyvelyuv, scho no documentation on the Russian operating system mine. That yak is here! The original documentation is expanded to the additional version. The situation was cleared by the article Andriy Kurnytsya ( [email protected]) from the journal "Component and Technologists". Over the years, with the author, I have reviewed the material of the article in the revised version. Yogo article as a whole can be documentation of Russian mine. But the original is inaccessible to a friend’s eye, the site of the magazine is lying, that material can be reworked a little. In general, the author has made a thorough review of the article and there is no sense to go over the theoretical one more time, it will be published again here. The original of the article will be an addition to the publication. I also mentioned that there were few difficulties in compiling the RTOS. This is due to the fact that the current makefile is broken, in which way the path to the folders is written. To that I will attach a ready-made project for a similar template for AVR Studio and AVR Eclipse. Unfortunately, the original makefile does not display the statutory information, such as the RAM and program memory levels, it was possible to fix it by adding a standard tweet.

So, briefly about the need, your project needs to win RTOS, which is necessary:

Organize multitasking and writing tasks

Ensure that the task is started at the next time intervals

Transfer information from one task to the next

Add new order if necessary

Advantages of RTOS before M Before:

  1. Bagatozachnіst. The RTOS gives the programmer a ready, rewarding mechanism for bagatality. The skin of the head of the vipad can be programmed okremo, the whole work can be done between the team members. You don’t need to dbati about re-miking between the heads, just to break up the planner.
  2. Timchas base. It is necessary to take into account the intervals of the hour. RTOS is the mother of the tool. Vіn allow vikonuvaty diї through clearly seen intervals of the hour.
  3. Exchange of data between zavdannyami. For whom in RTOS vikoristovuetsya cherga.
  4. Synchronization. Yakscho different tasks you can win over the same resource, for example the last port, you can win over mutexes and critical sections. It is necessary to win the task at the suvory sequence, or at the current singing sound, you can win the semaphore or signals for the synchronization of the task.

Nedoliki RTOS:

1. Increased program memory for kernel implementation

2. Increased RAM consumption for saving the stack of skin management, semaphores, cherg, mutexes and other objects of the system core.

3. Tricks for an hour of switching between tasks for saving the context.

DescriptionfreeRTOS:

FreeRTOS is a cost-free OS for a short real time with a valid code. It is importantly written in C, but there are assembly inserts. It was broken up by Real Time Engineers ltd specifically for systems that need to be considered. Recently, the "SafeRTOS" project began to develop - additional support, documentation, protests and certification for compliance with the IEC 61508 security standard FreeRTOS variant. This project was taken up by a German company and now safeRTOS is a leader in aerospace and medical technology. Also, the openRTOS project is a commercial version with the guarantee of the builder.

Main characteristics of freeRTOS:

1. Planner supports 3 types of rich tasks:

Vitisnyuyuchy

cooperative

hybrid

2. Change the kernel size to 9.8 Kb in the compiled view for AVR. (WINAVR)

3. The basis of the kernel - 4 files per Z.

4. Support the task of spiv programs. Spivprograms specially created for MK with a small amount of RAM.

5. Rich opportunities for tracing.

6. You can check stack reflow.

7. There are no program fees for a number of days, which are fixed at once.

8. No amount of exchange of priority tasks.

9. Dekіlkom zavdannyam can be appointed but the same priority

10. Causes of synchronizing "zavdannya-zavdannya" and "zavdannya-pererivannya":

Chergi

Double semaphore

Rakhunkov's semaphore

Recursive semaphore

M'utexi

11. M'yuteksy with inherited priority.

12. Support of the memory protection module for Cortex-M3

13. Delivered in a fresh looking demo project for various platforms and compilers.

14. Bezkoshtovna. You can win projects without opening the code, up to the extended GPL license.

15. Documentation is paid, but available online here.

16. The context twitch hour for AVR with 16 MHz crystal becomes less than 20.8 µs. The very style is necessary for the preservation of data at the stack of the task and the wake of the offensive. (Because of the same respect for the PIC18xxx, then the AVR controller should work 4 times faster!

Vytіsnyuyuchi pogozadachnіst means, scho zavdannya, scho vykonuєtsya with low priority, overlapping with the finished task with more high priority. Peremikannya mizh zavdannyami vіdbuvaєtsya through equal quanti hour. Therefore, the first low-priority task is more high-priority, the current quantum of the hour may end, if it is low-priority.

In this way, the hour of FreeRTOS response to calls in the mode of multi-tasking is no more than one quantum to an hour of the planner, which can be set in settings. For umovchannyam vіn dorivnyuє 1 ms.

If you are ready to finish the task with the same priority, then at such a time the planner sees the skin of them by one quantum of an hour, after which management takes the next task with the same priority, and so on the call.

The cooperative rich task is vibrating in spite of the fact that the planner independently cannot interrupt the scheduling of the in-line task, to get ready to complete the scheduling with great priority. The skin manager can independently transfer control to the planner. In this rank, high-priority zavdannya chekatime, while low-priority complete your work and give control to the planner. The hour of the system's reaction to the call of the day becomes insignificant and stale, as it will take a long time to complete the task before the transfer of control. The cooperative richness of the task was stoked in the Windows 3.x family.

Vitisnyayucha and cooperative concepts of richness are united at once in hybrid richness, if the planner’s cycle is a quantum of time, ale, on the vіdmіnu vіd of richness, it’s clear that the programmer may be able to work in the future. This mode is especially corny, if it is necessary to speed up the reaction time of the system to a reset. Let's say that a low-priority task is winned at once, and a high-priority one is scoring the next task. Then, after the completion of the work of the processor, the interruption is turned to a low-priority in-line task, and high-priority points until the in-line quantum of the hour is over. However, even after the completion of the reorganization process, transfer control to the planner, then transfer the control to a high-priority task, which allows the system to react quickly, due to the current situation.

whyon thechatb?

It is possible to expand the distribution of the microcontroller add-on, which is used for the FreeRTOS implementation, from the interest the rest of the version.

The FreeRTOS distribution kit is available in a seemingly great way or it can be self-extracted to a ZIP-archive. Distribution Clean the kernel code without intermediary (for looking at header files and files with output code) and demo projects (one project per skin development environment for the skin port). They gave the following unpacking of archives at any place at the station of unpacking.

Regardless of how many files are in the archive, the directory structure is really simple. If it is planned to design an extension on 2-3 architectures in 1-2 distribution centers, then more files that can be seen before demonstration projects and other distribution centers will not be needed.

The detailed structure of the directories is pointed to the little one.

All output kernel code is moved from the /Source directory.

Vmist:

1.tasks.c- implementation of the mechanism for planning, planning

2. queue.c- realization cherg

3. list.c- internal needs of the planner, prote functions can be used in application programs.

4. croutine.c- implementation of spivprograms (may be used daily at times, as spivprograms do not win).

Header files that are in the directory source/include

1. tasks.h, queue.h, tist.h, croutine.h- header files are valid for single-menu files with code.

2. FreeRTOS.h-replace preprocessor directives to fix compilation.

3.mpu_wrappers.h- Mist remapping of the FreeRTOS software interface (API functions) to support the memory protection module (MPU).

4.portable.h-platform-deposited landscaping.

5.projdefs.h- deeds of systemic appointment

6. semphr.h- Designing API-functions for working with semaphores, such as implementations based on cherg.

7. StackMacros.h- Mist macros to control stack reflow. The skin hardware platform maintains a small part of the kernel code that implements FreeRTOS interoperability with this platform. All platform-deposit code is located in the subdirectory /Source/Portable, de vіn systematizations of the distribution medium (IAR, GCC, etc.) and hardware platforms (for example, AtmelSAM7S64, MSP430F449). For example, subdirectory /Source/Portable/GCC/ATMega323 Migrate the files port.c and portmacro.h to implement saving/recovery of the task context, initialization of the timer for setting the time base, initialization of the skin task stack, and other hardware-deposit functions of the AVR microcontroller in the Winmega system.

Okremo next to see subdirectory /Source/Portable/MemMang, in which files are to be placed heap_l.c, heap_2.c, heap_3.c, which implement 3 different memory viewing mechanisms for FreeRTOS needs, as will be reported later.

The /Demo directory is ready to compile and select demo projects. The main part of the code for all demonstration projects was seen at the subdirectory /Demo/Commo n.

To feature FreeRTOS in your project, you need to include the core output code files and accompanying header files. There is no need to modify them or to understand their implementation.

For example, if it is planned to change the port for the MSP430 microcontrollers and the GCC compiler, then to create the project from scratch, you need a subdirectory /Source/ Portable/GCC/MSP430_GCC ta / Source/Portable/MemMang. All other subdirectories from the /Source/Portable directory can be deleted.

If it is planned to modify the main demo project (which, well, it is recommended to start working on the cob of FreeRTOS), then you also need a subdirectory /Demo/msp430_GCCі /Demo/Common. Other subdirectories found in /Demo are not required and may be changed.

Under the hour of the creation of the program, it is recommended to win makefile(or a file for the middle of the distribution project) as a valid point for the demo project. Optionally disable the build files from the /Demo directory, replacing them with your own, and the files from the /Source directory - undersized. Slide also guess about the header file FreeRTOSConfig.h, which is known to the skin demonstration project. FreeRTOSConfig.h Define a #define that allows customization of the FreeRTOS kernel:

1. Set of system functions.

2. Wikoristannya spіvprogram.

3. Number of priorities for the task and spivprogram

4. Expand your memory (buy a stack).

5. Clock frequency MK.

6. The period of work of the planner is an hour, which is seen by the skin zavdannya vikonannya, which sounds more than 1 ms. Removal of some systemic functions and change in the number of priorities (change of memory).

Prior to FreeRTOS distribution kits, it also included tools for converting trace information taken from the planner into text form (directory /TgaseCon) and the text of the license (directory /License).

Visnovki

For the help of the first article of the cycle, the reader got to know the operating system of FreeRTOS microcontrollers. The features of the robot are shown. Description for the FreeRTOS distribution kit. Introduced the main sketches, from which I will expand the development, which will be used to develop FreeRTOS.

In future publications, respect will be attached to the mechanism of rich tasking, and to the managers of that spivprogram. The robotic planner will be introduced to the application of Atmel AVR microcontrollers and the WinAVR (GCC) compiler.

What falls on the thought if you hear operating system? Chantly kvatirki, linux, makos .. otherwise it’s like that. That's right, and it's necessary for food, everything will be given advice: listen to music, play a game (on the Internet!), roaming with a friend on Skype. At the same time, gazing, like a bright light, otrimavshi byte z yuarta \u003d).

And if you dig deeper, then listening to music, transferring data via the Internet - all are single processes, and we have only one processor, then one hour you can win only one task. That is why the tasks are beaten for the sake of small "portions", the essence of OS work is unrecognizable for the koristuvach: so that the sound is not wheezing and the bytes were sent and everything worked at once. If so, one of the days was “hanging”, then everything else continued to work.

If you throw out all the goodies and lose the goal, then the OS is just a timer, a kind of breath equal intervals of an hour, and also, without the participation of the coristuvach, it mixes between the tasks, vikonu as a part and re-mimics. It is also necessary to vrahuvat, that the greater task can not be reached in one quantum of an hour, it is necessary to save the task at the moment of switching to another, and the coming time to replace the camp of change. The manager of which is engaged in the planning manager.

There are two main types of OS: vitіsnyayucha and cooperative. At the first fluke, the conversation between the leaders will be zhorstky, tobto. if the quantum of an hour is 1ms, then the next time the task is counted exactly 1ms, then the other time is equal to 1ms, etc. Such a clock is called a real hour (RTH). For cooperatives, it’s easier, the process itself is guilty of saying that “I’m here,” and it’s impossible to bring it up to the RTOS.

Vgamuvati vytіsnyayuchu on drіbnі AVR not vide through a small amount of RAM. Of the most recent options for cooperatives, I was honored by mRTOS, you can read the details of the system on the author’s website (easy to google). The main reason for the variance is simplicity, the availability of a ready-made version of CAVR for understanding fundamental principles yourself.

Otzhe, the head food was lost, it’s necessary if you stop everything. Theoretically, all those same, that you shobi z vіssyu, you can download without it, more resources alone you yourself. Depending on what you fit to the project, don’t fly megahertz into space, it’s enough to get by yourself, that’s where the resources are.

To that varto put your own spice to power:
1. Can you manage resources wisely?
2. Chi is not transferred during the process of writing the firmware of the wine, and is the same bike similar to the planer?
3. How readable is your code? How can you help you through pіvroku-rіk vіdkriti yogo i vіdrazu razіbratisya?
4. Are you alone Do you write as a group?

On the first day, it is difficult to give a supply, because everything is left in the form of a crooked hand of the retailer. With others, everything was more understood, as there are a lot of independent zavdans and it is planned to win over them through singing intervals of an hour, rather to marvel at the Bik OS. Thirdly, it has become clearer, easier to sort out in the okremu plant, lower the fallow land in the main cycle. If you write more than one, then there are also pluses, since you can write your own task well, not respecting others.

According to what has already been said, the scope of stosuvannya to dosit is specific, just like the day before. Not varto phati її in the leather project. For the majority of amateur radio projects, the whole project, even if it was announced about it earlier, singsongly putting in a couple of projects.

Now zazirnemo under the hood. To run mRTOS before the project, you need to include mrtos.c and fix mrtos.h. The structure of the trocho coda looks like a voiced

#include #include "mrtos.h" //here is the body of the function de mi write your super code void task1() ( while (1 ) //Start in a be-yak_y OS on the basis of an unstopped cycle { //here is the code of your task DISPATCH; //function of transferring control to the planner } ; } // timer reset handle 0 interrupt [ TIM0_OVF] void timer0_ovf_isr(void ) ( char ii; #asm("cli") TCNT0= 0x9C ; inc_systime() ; for (ii = 0 ; ii< init_tasks; ii++ ) if (tasks[ ii] .delay ) -- tasks[ ii] .delay ; #asm("sei") } void main(void ) { // initialization of the periphery init_mRTOS(); //initialization of OS //here we create tasks(tasks) 3 tasks are created here create_task(task1, 1, Active); //create a task (my task, priority, status) create_task(task2, 1, Active); create_task(task3, 1, Active); scheduler(); //launch planner while(1); )

#include #include "mrtos.h" //here we write our own super code void task1() ( while(1)//the task in any OS is called on the basis of an unstopped loop ( //here is the code of your task DISPATCH; / /function to transfer control to the scheduler );) // timer interrupt routine 0 interrupt void timer0_ovf_isr(void) ( char ii; #asm("cli") TCNT0=0x9C; inc_systime(); for(ii = 0; ii

Now report. the number of the task is specified in mrtos.h to the default APPTASKS N. The task is voiced in the middle of task1()(), task2()() just fine, in the middle of while(1) it is not necessary to write anything, it is not necessary to call the function, it is not necessary to create the planner for you . As you can see, the task is folded from an inexhaustible cycle, but it’s normal so and can be, but in the middle of the task, the obov’yazkovo is necessary to control the planner. Or the WAIT function, or DISPATCH. As much as possible, then the task of vikonuvatimes inexorably.

How do you work? Let's create a task of blimannya with light.

void task1() ( while (1 ) ( PORTB.0 = ! PORTB.0; WAIT(100 ) ; ) ; )

void task1() ( while(1) ( PORTB.0 = !PORTB.0; WAIT(100); ); )

WAIT is not an analogue of delay() only, for an hour the microcontroller does not miss anything and perform empty cycles. Under hour WAIT management is transferred to other workers. Tobto. you can create a couple of thrusts of blinking different lights, with a different WAIT and all the stench will shine with a different frequency. If you don't need zatrymki, then in the kintsi vikoristovuemo DISPATCH.

When WAIT is different, it is important to understand that the entire system has a minimum tick (hour quantum), so we check not WAIT (50) 50 milliseconds, but 50 system ticks. Setting the tick to lie down in the first place, as the timer 0 is often called out, tobto. just as we have adjusted the interruption for 1ms, we can allow that our action will last for 1ms. So far, we have shown that it is possible to change the system tick up to ~20 µs at a clock speed of 16 MHz.

The setting of the timer is not considered in any way earlier, since the timer can only be reordered, all the settings are tied to the price. In other versions of CAVR, you can also manually write time requirements, which are automatically generated.

create_task(task1, 1, Active);

create_task(task1,1,Active);

It is not easy to achieve everything with priorities. Even though two tasks with different priority and a task with a high priority are constantly vied, then a task with a low priority will not be entered by any means. That is why it is necessary to organize the robot in such a way that the administrators would deny access. We won’t be able to show respect for anyone, we’ll save an offensive time. Starter Mill, Active – running, StopTask zupinena.

Otzhe, for those who are willing, just blink with light:

#include #include "mRTOS.h" void task1() ( while (1 ) ( WAIT(1000 ) ; PORTB.0=! PORTB.0; ) ) // Timer 0 overflow interrupt service routine interrupt [ TIM0_OVF] void timer0_ovf_isr(void ) ( char ii; #asm("cli") TCNT0= 0xb2 ; inc_systime() ; for (ii = 0 ; ii< init_tasks; ii++ ) if (tasks[ ii] .delay ) -- tasks[ ii] .delay ; #asm("sei") } void main(void ) { DDRB= (1 << DDB7) | (1 << DDB6) | (1 << DDB5) | (1 << DDB4) | (1 << DDB3) | (1 << DDB2) | (1 << DDB1) | (1 << DDB0) ; PORTB= (0 << PORTB7) | (0 << PORTB6) | (0 << PORTB5) | (0 << PORTB4) | (0 << PORTB3) | (0 << PORTB2) | (0 << PORTB1) | (0 << PORTB0) ; // Timer/Counter 0 initialization// Clock source: System Clock // Clock value: 7.813 kHz TCCR0= (0<< CS02) | (1 << CS01) | (1 << CS00) ; TCNT0= 0x83 ; // Timer(s)/Counter(s) Interrupt(s) initialization TIMSK = (0<< OCIE2) | (0 << TOIE2) | (0 << TICIE1) | (0 << OCIE1A) | (0 << OCIE1B) | (0 << TOIE1) | (1 << TOIE0) ; Init_mRTOS() ; create_task(task1, 1 , Active) ; Sheduler() ; while (1 ) ; }

#include #include "mRTOS.h" void task1() ( while(1) ( WAIT(1000); PORTB.0=!PORTB.0; ) ) // Timer 0 overflow interrupt service routine interrupt void timer0_ovf_isr(void) #asm( "cli") TCNT0=0xb2; inc_systime(); for(ii = 0;ii

As a bonus, I tried the polyphonic (double-voiced) melody "Dr. Mario chill". The idea is that the controller's skin is constantly inverted into a real craving, thereby generating the frequency itself. By changing the patch you can change the height of the note.

void task2(void ) ( while (1 ) ( if (mute == 0 ) //how allowed to grati( if (note_ch2[ n_n] == 0 ) // just like a pause, then it is checked, nothing is read( PORTB.4 = 0 ; WAIT(5 ) ; ) else ( PORTB.4 = ! PORTB.4; // if not a pause, then it's moving with the foot at the required frequency WAIT(note_ch2[n_n]); ) ) ) )

void task2(void) ( while(1) ( if(mute == 0) //should it be allowed to play ( if(note_ch2 == 0) //should the pause be checked, nothing can be mute ( PORTB.4 = 0; WAIT( 5);) else ( PORTB.4 = !PORTB.4; //if not a pause, then we move the foot with the required frequency WAIT(note_ch2); ) ) ) )

I'm not fooling around with the idea, in 1 task a meander is generated from the frequency of the note for the solo part, in the other for the bass. The height of the skin note is taken from arrays. Trivality, shaving and shaving in a task3.

void task3(void)(while(1)(WAIT(1500)); //graimo the minimum trivality of the note for (mute = 0; mute< 500 ; mute++ ) // shave off the note so you don't get angry(PORTB.3 = 0; PORTB.4 = 0;); mute=0; //we set up a flag that you can make a sound n_n++; //go to the next note if (n_n == n_max) //yakscho played all those demos on the stake( n_n = 0 ; ) ) )

void task3 (void) (while (1) (WAIT (1500); // keep note for (mute = 0; mute)< 500; mute++) //обрываем ноту, чтобы не сливались { PORTB.3 = 0; PORTB.4 = 0; }; mute = 0; //выставляем флаг, что можно воспроизводить звук n_n++; //переходим на следующую ноту if(n_n == n_max) //если сыграли все то идем по кругу { n_n = 0; } } }

To change two channels by twisting a simple circuit.

A small piece at once

For bad firmware

I'm constantly asking myself what to do, to occupy my hobby for an hour - a small home automatic control system (smart booth), based on a 16-bit microcontroller - what is the correct idea? The second month ago, I already wrote in my blog on the topic “Microcontrollers vs. systems-on-a-chip”. So the axis, I'm getting ready to write about it again.

I was often stunned by the appearance of the sale of Stellaris Launchpad and Arduino Due. The stench is offended based on 32-bit microcontrollers, and in many respects they are similar. I'm up to date with the specifications (datasheet), and wanting to stink at a price, stinks are charged for one target audience. I was thinking about those who can change my mind from the MSP430 to Stellaris, and I can switch to my system, switch to the Raspberry Pi, replace the microcontrollers.

Obidva, Stellaris Launchpad and Arduino Due, even harder, but not recognized for running Linux. The stench works either on the iconic code written without intermediary for them, or on the control of the real-time operating system (RTOS) - a minimalistic OS, with an even short hour of reaction to the calls. So the stench is obviously foldable, lower MSP430 or 8-bit AVR.

On the other hand, in real life (beyond the Internet), most people I know are running Raspberry Pi or other systems that run on Linux. Vykoristannya itself microcontrollers, dosit rare vipadok among the quiet, whom I have learned. Navit Arduino, a little less popular, in my honed, lower Linux, which comes to mind. As I understand it, it’s worth buying an Arduino, if you can get a Raspberry Pi, which one can be richer, and which ones are smaller? Under Linux, there is no ready-made software, and on it you can program, using simple scripts to move.

Especially for me, the reason is because I don’t care about victorious Linux, because I’m doing vicor yoga on a robot today, and turning home, I’m not happy with the need to re-practice on Linux-like systems. I don't have a lot of problems with linux hacks, but it's too much to suffocate, rot me. I’m more comfortable with simple electronic devices based on 8/16-bit microchips.

Prote I do not turn into reality. As I want to be left alone with the real world, I can win over those instruments, like win over with the real world. Otherwise, it’s like driving a car with a steam engine, less so, because the engine of the internal combustion is superb, I’m post-warrior in such a rank. If it is necessary to switch to more modern technology, it is necessary to master it, to be like me. Especially, as I want my blog to be relevant to people and become relevant.

At my project of a smart booth, I really got stuck with this problem. I've already built a local network driver for the control system on the MSP430 and everything looks good. In fact, I can do everything you need for an automation system on the MSP430. Tim is not smaller, I'm wondering, which ones are correct, how can I do it? I don’t smuggle, what is the soup with a saw, if it’s a spoon? Maybe, Linux is more similar system? Let me explain.

It’s worth looking at the current situation, for technological achievements for the fall of 2012 rock. I'll ask myself, what good are the current microcontrollers, compared with systems-on-a-chip, what Linux wins?

How to overhaul projects on the system, how to come to my mind, tse: drones, robots, home automation, motor controllers, sensors, wrist yearbook, 3D printers, etc. Do any of these types of Linux, scho vbudovuetsya, fit more, lower microcontrollers? Why?

I really appreciate that there are three situations, if the microcontroller is the best choice: there, de important is the instantaneous (realtime) reaction to the sub; there, de need extremely low energy; And there, it is necessary to use microcircuits of the lowest possible var.

For the cob, the use of cheap microcircuits is not such an important moment for me. I take care of my hobby for myself and do not choose if I release competitive products. I don’t have to succumb to the transfer of production to the plant, which is a kind of victorious slave labor, to provide a competitive price for these other projects, as I rozroblyaet. I'm happy, yakby zmіg pay more than one pay per day, zavdyak to your comforts!

For example, for a smart booth project, I can develop remote control of vimikach. Vіn can turn on / switch off the light or else. At the same time, I can go to my local electrical shop and buy those for $20, made in China. Chi can I if you kill the price by trying to sell vlasny vimikach? I don't think it's possible.

To be more thoughtful, it is necessary to reach the richness of other speeches necessary for home automation. Temperature sensors, dima, ruhu, etc., I can build a building independently, but it’s unlikely that you can take a financial benefit. Who cares to buy such speeches from me for $75, if they can find them for $20 at State Goods?

If you think about taking care of your own hobbies, then it’s better to gain respect for more expensive and foldable products. For example, a home automation controller or a thermostat, sound cost over $100, and give more freedom for individual creativity, you can encourage one, sell your money and earn money on your own.

Ale bazhannya, reaching the highest price of the residual attachment, does not mean that it is necessary to beat the found microcontroller on Earth. Really bad idea, because the hour of rozrobki those same can own the versatility, like victorious details. Possibly, the microcontroller is cheap, but it takes more than an hour to write the code to control. An hour is a penny, and if you practice smarter, you will achieve a greater reach.

All the same, think about bringing me to a visnovka, which is better to expand the system of a smart booth on Linux, lower on microcontrollers, regardless of my special skills, don’t beat Linux (I need to program a low level, more lower scripts, Linux needs less scripts).

If you turn to those topics, the price of microcontrollers, it can be an important factor for great corporations that choose to launch a new product, but on an individual level, as if you want to do business in the style of Kickstarter, this factor is no longer so significant, in fact, Swedish , Most important, lower variance of components.

On the other hand, microcontrollers can be a better choice, lower system-on-a-chip, if low energy is needed. Such systems have two moments: low self-sustainment of the circuit itself for an hour of work and a short start hour. A typical way to save batteries for other outbuildings is self-connection (shut off). If you mimic a computer on Linux, you will need a decent hour to turn to work, sometimes to dekilkoh hvilin. Such an hour is not acceptable for systems that need to be wooed.

If you take such a microcontroller, like the MSP430, you can sometimes use one battery. Stellaris Launchpad and Arduino Due, in principle, the same on the same building, stink more energy lower than the MSP430, but still a little less, equal to the Raspberry Pi. Still, MSP430, you can instantly start, after you turn it off.

In this rank, I am absolutely convinced that in all situations, where low-voltage operations are necessary, there is a sense of victory in microcontrollers. There is a large number of various outbuildings that work on batteries, which is the reason for such a need.

For the third type, as I said before, the use of a microcontroller is more understood than Linux, in operations that require an instant response (realtime response). I can use such attachments, like 3D printers and CNC typesetting, I know what I’m talking about, dedicating a lot of time to my wedding. Due to its nature, the stench requires high accuracy in robots, as it is less likely to lie down in the hour of reaction to commands.

For example, if you have a circular file running, as if at a given moment the pieces of wood or metal are being cut, you cannot start the process, through those that the computer needs to have a pause, so that the data can be transferred from the memory to the disk, otherwise else in the same spirit. Be someone who wins the PC, knows about the vipadkovy podvisannya, who periodically blame the hour of the splendid work. And now let me know that you have a great drilling workflow, under the heading of a PC, which raptom starts to change the update for Windows, work for an hour, and drill, drill through the steel, on which one to stand, because. the computer has gained control over it.

PCs and system-on-a-chip are not designed for real-time work, either from Windows, or from Linux, but by themselves the stench is getting close to you. As an example, I use a real-time patch for the Linux kernel and special CNC software, creations for robots of this kind. I don't know much about the cim Linux patch, and I don't know if it's a bit of a gnuchky one, for better control of the real time. But I’m wondering if there’s a better alternative, tk. Linux, even though patches didn’t hang on it, the microcontrollers won’t be able to break their systems in this window.
Nasamkinets, I want to say that after spending a lot of time, trying to know the areas where microcontrollers are installed in my projects, I can win. And everything looks like the era of light domination of Raspberry Pi and Beaglebones has come. This is a current situation for DIY sleepers. It has more options, is faster and easier to develop on these systems, so it is the best choice for more projects.

For microcontrollers, there are no more areas for low-voltage attachments, real-time operations, and low-voltage attachments.

You can’t lie about the fact that microcontrollers can make “funny” lower PCs. Tse those with whom you happen to reconcile.

Translated from the English movie of the original post

The system is budged, the system is budged(eng. embedded system) - if the computer system is specialized, the computer itself will sound like an attachment, which will control it.

Characteristic features:

  • Even less energy saving, close to 0.5 to ~20 W
  • Little Roses
  • Presentation of great systems of heat supply (cooling). Most of the time, the CPU does not cool down, but rather a small heatsink heats up.
  • The CPU and system logic, as well as other ICs, are often combined on a single chip (System On Crystal = SOC)

The basis of budding systems can be either single-board or single-chip microcontrollers, specialized or universal CPU, PLIS. It is a special feature of certain types of systems to overcome the old processors of the x86 family (for example, i386, i486, Pentium) and their clones through low energy and low cost (about 1-5 US dollars). There are also a lot of views in victorious systems for the CPU of the ARM architecture.

At the moment, there are a large number of companies (including those in Russia) using single-board computers based on microcontrollers and CPUs with RISC architecture. Among them Advantech, AAEON, Advanced Micro Peripherals (AMP), Ampro Computers, Diamond Systems, iBASE, InnoDisk, Fastwel (Russia), Lippert, Octagon Systems, RTD Embedded Technologies, Tri-M Systems - Engineering, SanDisk, STEC. ATMs, avionics, PDAs, telecommunication systems can be butts in the systems.

Deyakі vbudovanі systems vikoristovuyutsya in bulk quantities (for example, RFID). Vbudovanie system є prioblyayuschey method for the creators of shkіdlivogo code through its breadth and vіdnosnu bezakhisnіst. Step by step winkіdly code for vbudovanih systems (Cabir, RFID-virus); Luckily, this process is still difficult due to the diversity of building outbuildings, including the dominating PZ and subsidizing the functionality of such kinds of building outbuildings. On the other hand, the leaders of anti-virus companies and old computer security are also complicated by environments, as well as low-powered systems, which often do not allow the spread of all anti-virus software security.

The main CPU hacks for budding systems є VIA technologies, Transmeta Corporation, Infineon Technologies.

Operating systems for systems that need to be

In systems that need to be built, for management, they win over tsіyni systems of real time (OS RT) .

The operating system of the real hour of the OS is the OS that reacts to the transfer of the hour to the non-transfer of the appearance of the sound ones. Some RTOS are called interactive systems of constant readiness. In the RTOS category, they are included in marketing marketing applications and, as such, an interactive program is called “working in real time”, which means that drinks are processed from a dark, unfamiliar place to people. Some people understand the real time of the system with the “Swedish system”, but don’t start it correctly, for that it’s important not to stop the reaction of the RTOS, but those that the hour was enough for the addendum and it was guaranteed.

Different systems are divided "hard" and "soft" real hour. The OS of the “hard” real hour guarantees the change of time for the last interval of the hour, the OS of the “soft” real hour, as a rule, catches the charge of the day for the interval of the hour, but again it does not guarantee it. Most of the software is oriented to the "soft" real hour.

These systems are characterized by:

  • guarantees of an hour of reaction to ovnishnі podії (resettlement due to obladnannya);
  • just a subsystem of process planning (high-priority tasks are not to be blamed for low-priority ones, for some sort of blame);
  • shifting up to an hour of response to calls or reactivity (the delay in the interruption of the recall cycle is not more than tens of microseconds, the delay in the transition of tasks is not more than hundreds of microseconds)

The classic butt of the manager, de need of the RTOS, is the control of the robot, which takes the detail from the line of the conveyor. The part is collapsing, and the robot can only take a little time, if you can take it. If the fault is delayed, then the part will no longer be on the necessary conveyor space, and later, the robot will not be broken, regardless of those that the robot is in the right place. If the wines are positioned earlier, the detail has not yet been caught, and the wines will block the way.
Windows CE (won WinCE)- tse variant of the operating system Microsoft Windows for improved computers, mobile phones and systems that you need. Windows CE is not a "urban" version of Windows for desktop PCs and is based on a different kernel. Up to the main shortcomings of the system, you can see all the necessary software programs. The x86, MIPS, ARM architectures and Hitachi SuperH processors are supported.

The main competitors of WinCE are VxWorks, eCos, OSE, QNX, LynxOS, Symbian OS, OS-9 , as well as different Linux flavors (for example, uClinux ) i, the largest vіdomy, Palm OS . The builders of the outbuildings are also preparing a power system.

Windows CE is optimized for add-ons that require the least amount of memory: the Windows CE kernel can run on 32 KB of memory. With a graphical interface (GWES) for Windows CE robots, 5 MB will be required. Attachments often do not waste disk memory and can be designed as "closed" attachments without the possibility of expansion with a hard case (for example, the OS can be "hardwired" into ROM). Windows CE is aware of the operating system's real-time clock.

On the basis of Windows CE, an anonymous platform was founded, including a Handheld PC, Pocket PC, Pocket PC 2002, Pocket PC 2003, Pocket PC 2003 SE, Smartphone 2002, Smartphone 2003, Windows Mobile, as well as an anonymous industrial add-on and other systems. The Sega Dreamcast prefix supported Windows CE. Windows CE itself in a post-packed post, but it could run on a console from a CD. Deyakі іgri vikoristali tsyu mozhlivіst.

Often call Windows CE, Windows Mobile, Pocket PC vicorist as mutually interchangeable. We don't know for sure. Windows CE 3.0 is a modular operating system, as the basis for many class attachments. Whether there is a retailer, you can buy a tool (Platform Builder), which can replace all the components and programs that allow you to use the platform. If so, the programs, like Word Mobile/Pocket Word, are not part of this tool.

Windows Mobile is the best showcase for platforms that are based on Windows CE. At this time, this set includes platforms: Pocket PC, SmartPhone and Portable Media Center. The skin platform has its own set of Windows CE components plus its own set of related features and add-ons.

Windows CE.– This is the code name for Windows CE version 4.2.

Windows Embedded CE 6.0(code name Yamazaki) is the sixth version of the Windows Embedded operating system, oriented towards enterprises that manufacture controllers and add-on electronics. In Windows Embedded CE 6.0, the kernel has been completely overhauled to support over 32,000 processes, up from 32 in earlier versions. From 32 MB to 2 GB, a virtual address space was added, which is seen for processes.

Windows Embedded CE 6.0 was released on Fall 1, 2006.
Windows CE 6.0 R2 was released on Fall 15, 2007.
Windows Embedded CE 6.0 is also the basis of Windows Mobile 7 (codename "Photon").

QNX- commercial POSIX-summ_sna real-time operating system, recognized as important for systems that need to be built. Consider one of the best implementations of the concept of micronuclear operating systems.

Yak micronuclear operating system, QNX is based on the idea of ​​​​working the main part of its components, like small factories, as they are called services. Tsed the vides of traditional monolith nuclei, in the yak core of the operational systems - one is a great projection, it is a great part of the great part, and the leatherette. The QNX microkernel subkey allows cores (retailers) to turn on whatever functionality they don't need without changing the core. Natomist, you can simply not start the singing process.

The system is small, so that the minimum configuration can be placed on one floppy disk, at the same time it is important even with a swede and a proper rank of “finished” (as it is practically not to avenge pardons).

QNX Neutrino, Released in 2001, ported to a wide variety of platforms, and at the same time, it is practical to practice on any modern processor that wins on the systems market, that it will be developed. There are families among these platforms x86, MIPS, PowerPC, as well as specialized families of processors, such as SH-4, ARM, StrongARM and xScale.

A version for the non-commercial wiki is available for download on the retailer's website.

Lynx OS- Unix-like real-time operating system, decomposed for systems that need to be combined with POSIX standards and, for the rest of the hour, with the GNU/Linux operating system. LynxOS wins out most importantly in aviation, industrial process management systems, and in telecommunications rooms.

ChorusOS- micronuclear operating system for real time, broken down for systems that need to be worked out. In 1997 Sun Microsystems bought Chorus systems, the company that made ChorusOS. At the end of 2002 The founders of Chorus Systems organized a new company VirtualLogix and were engaged in the development of systems to develop Linux and ChorusOS.

Nucleus- a real-time operating system, created by Accelerated Systems, a follow-up on the systems of the Mentor Graphics company, which is expected, for various processor platforms. Nabula widened in television decoders, mobile phones, and other portable and intestinal outbuildings. Nucleus is awarded by Garmin International to a GPS module recognized for civil aviation.

OS-9- richly tasked, rozrakhovan on a richly koristuvachіv real-time operating system, rozroblen Microware Systems Corporation.
Winning for interactive and budding systems. Today, OS-9 is owned by RadiSys Corporation, a retailer in Oregon (USA).

VxWorks- Real time operating system (RTOS) developed by Wind River Systems (USA).
Like the most other RTOS, VxWorks includes a multi-tasking core with a smart scheduler and a quick rebuild guide, support for cross-process interactions and synchronization, as well as a file system and a networked subsystem (TCP/IP protocol stack). The package includes tools for cross-compilation, productivity monitoring (WindView), remote character enhancement, and emulation of different processors. Additionally, a large number of different stacks of protocols, graphic subsystems and others are supplied. as well as from Wind River Systems itself, as well as from third companies. The impersonal support of VxWorks platforms is one of the largest RTOS environments.

The remaining version of the integrated Wind River Workbench development environment (which comes with VxWorks versions 6.x, as well as 5.x) is based on the Eclipse environment. The front proprietary middle of the rosette was called Tornado.

Victory:

  • Mars Reconnaissance Orbiter in Mars orbit (VxWorks system is vying)
  • The Spirit and Opportunity probes, as well as the Mars Reconnaissance Orbiter, are using VxWorks on the POWER platform. The system wins in other space missions, for example Deep Impact.
  • It is planned to compete with new airliners Boeing 787.
  • Communications of wealthy companies (for example, Nortel, 3COM, Alcatel and others).
  • Linksys WRT54G (ver.5,6,...), NetGear WGR614 (ver.5,6,7)
  • Active PostScript printers.
  • Medically owned by Siemens AG (magnetic resonance imaging cream).
  • Remaining BMW iDrive interfaces

OS2000- The real time operating system (RTOS) was developed by the National Institute of Science and Technology of the Russian Academy of Sciences for the design of the RF Ministry of Defense for MIPS and Intel microprocessors.
Qia RV OS is recognized as a software development for systems (software and hardware complexes) that are used in the real time mode.
Supporting outbuildings:

  • Ethernet attachments (protocols NFS, FTP, Telnet);
  • storage attachments - floppy and hard disks (file systems vfat and tar)

Є support for the graphical client-server subsystem of the X Window System, which wins in Unix systems.

The computer wins, first for everything, for the security of flexibility and for the simplicity of the system design. When viewing a PC, the program code should be saved in ROM, and not on a hard drive. chime in kіntsevy koristuvach do not expand new software security for a built-in outbuilding. With the development of VLSI technology, the flooring systems have become inexpensive, which can be found in most of today's electronic appliances.

Apply vbudovanih systems

A robot, so like a marsohid, indications for a little 1.1 є vbudovanoy system. Stilnikovy phone, PDA or portable multimedia player, shown on a small 1.2, or in built-in outbuildings. Install an electric toothbrush, shown on a small 1.2 є vbudovany system. small microcontroller at the toothbrush, it is safe to program the maintenance of the swidkist and the indication will become a battery charge. High-yield cars can avenge close to one hundred microcontrollers. A typical middle-class home can be close to 50 built outbuildings. For skin PC, the world has more than a hundred built-in attachments. Zagalom, vbudovanі pristroї to establish a greater part of the light production of microprocessors.


Rice. 1.1.

As can be seen in Table 1.1, appliances can be found in various industrial products, including electronics and military systems, biomedical systems, automobiles, communications, computer attachments, electronic instruments, home electronics, industrial equipment, robotics, office machines. intellectual toys. You can know where the outbuildings are.

Designers of budding systems often get stuck with folding design tasks. Vbudovani systems may be worthy. A lot of built-in outbuildings cannot be lamatized and cannot be re-vantaged. Software security it is impossible to move in at the riches in the outbuildings. A lot of outbuildings may have a simple constructional exchange for productivity and energy saving. Deyakі pristroї owing pratsyuvati vіd battery trivaliy hour. In addition, spozhivchі pristroї zazvichay more quickly enter the market with new products and may zhorst price competition. In rich additions, there is an exchange of real time and a lot of outbuildings, there is an exchange of memory, and there is a calculation of the exhaustion.




Rice. 1.2.Table 1.1. Apply vbudovanih systems
Aviation & Military systems Aircraft autopilots, avionics and navigation systems, automatic landing systems, guidance systems, engine guidance.
Biomedical systems Computed tomography and ultrasound follow-up systems, patient monitoring, pacemakers.
Cars Engine management, anti-blocking galvanic systems, anti-skidding galvanic system, airbag maintenance, heating and air conditioning control, GPS navigation, satellite radio, system diagnostics.
Communication Communication satellites, mesh routers, switches, concentrators.
Spozhivcha electronics televisions, ovens, dishwashers, DVD-players, stereo systems, security systems, lawn watering control, thermostats, cameras, radio clocks, automatic transmissions, cable TV decoders, and other attachments.
Attachments for a computer Keyboards, mouses, printers, scanners, displays, modems, hard disk attachments, DVDs, graphics cards, USB attachments.
Electronic instruments Data acquisition systems, oscillography, voltmeters, signal generators, logic analyzers.
Promise of possession Elevator control, watchdog systems, robots, CNC typesetting, programming logic controllers, industrial automation systems and control.
Office machines fax machines, copiers, telephones, calculators, cash machines.
Personal outbuildings stylish telephones, portable MP3 players, video players, personal digital assistants (PDA), electronic wristwatch, portable video games, digital cameras, GPS systems.
roboti Promislovi roboti, autonomous transport services, space exploration robots (for example, robotic rovers)
toys video systems, robot toys such as "Aibo", "Furby", and "Elmo".

Operational systems of real time

Real time systems owe to external parameters introduction and creation of new results of observation for an hour, as shown in the little 1.3. Hour vіdpovіdі mayє buti will be obmezhenim. Even the trivial hour of the vіdpovіdі can be caused by vіdm's systems of the real hour.

Illustrative butt real time systemє controller of the car airbag. If the sensors of the rotation of the airbag (accelerometer) recognize the gap, the system needs to react, I will curve the airbag with a stretch of 10 ms, otherwise the system will not work properly. At a high speed from a tuck over 10 ms, the water will already close with the kermovy wheel before the pillow opens.


Rice. 1.3.

In a soft system of real time, the priority may be critically important tasks. M'yaka real time system chirp to the exchanges of the real time. Butt typical soft real time systemє multimedia player. The player can sometimes skip a video frame or an audio sample, and it can not be remembered while the player is working correctly for more than a part of the hour.

In the same system of real time, a new result of seeing the time may be charged at the time intervals, otherwise the system will not work. Yak butt zhorstkoy real time system Let's take a look at the system of remote curing with kerms (to be cured by a computer). In the system of managing the flight of the aircraft, if the pilot moves the steering wheel, the kerma of the management of the flight of the aircraft will shift even more quickly, or else spend the stamina in the fall. In order to ensure safety, the FAA constantly reviews and certifies the response in real time of computerized flight simulators.

Procedures for changing the sides of virtual memory and folding memory, which are necessary for object-oriented mov, can eliminate problems in hard real-time systems. Navit keshuvannya іnоdіє є problem, shards can lead to change the hour of the program.

A lot of vbudovannyh systems є systems of real time with kіlkom inputs and outputs. Dekіlka podіy vіdbuvayutsya independently one in one. programming sproshchuєtsya pіd podіlu zavdan, ale tse vіmagає vіd tsp postіyny svіykannya mizh iznimi zavdannyami. Operating system, as a support for multitasking, security podіl time TsP mizh kіlkom zavdannyami. The OS also takes care of the synchronization elements, the necessary coordination between different tasks, and runs in parallel.

Operating systems are often classified according to the characteristics of the real time. Operating system The real time can be relatively designed to support the real time programs. Recently, it has come to the point that 95% of the real time programs have a fixed hour in the range of 0.5 to 10 ms. Only 10% ventilation (cooling from 50 microseconds to 1 ms) at the time of the event may be acceptable. Apparently, to such a large number of operational systems of the cryptic recognition are not real time systems. According to these criteria, an OS was created, such as Windows XP, it can be seen in the shortest possible way only as soft. real time OS. For Windows XP, there are some third-party post-worker tools to improve the hour of recovery.

Operating systems for wake-up systems

More new outbuildings can be folded software security, as it is necessary for multitasking, task synchronization, support for a wide range of input / output devices, scheduling and buffering input / output operations, memory management, support for graphic displays, file systems, storage, security and management of live. Operating system you can give all the possibilities to help the retailers of the programs. Applied programs will be productive, shards of stench will work on the highest level of abstraction, vicorists will help you rely on the operating system.

Recently, a model of a style phone was released to replace five million rows of code. Few people, who have started such projects, often need those funds necessary for the development of all the code independently. At the same time, there is an economical sense to win over the main operating system. The short time of the expansion and the decrease in the total amount of time validate the variance of the license for the operating system.

Licensing renewal of a typical commercial operating system will cost less than a few dollars for attachments. Deyakі more simple additions can do without OS, but new additions become foldable.

At zv'yazku z tsim more vbudovanih outbuildings vikoristovuyut vbudovanu operating system. The operating systems are built to sound native in C/C++ and are delivered together with a C/C++ compiler, assembler and debugging tools to help retailers develop application programs and test applications. Tools for rozrorobka vbudovanih systems faulty also pіdtrimuvat vykonannya programs for help code that is stored in independent memory, such as ROM or Flash memory.

© 2022 androidas.ru - All about Android