What are examples of RTOS

Go To Last Post
95 posts / 0 new

Pages

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brian Fairchild wrote:

There is no such thing as a 'Real Time' system. Especially when using an 'RTOS' (whatever that might mean). The 'R' in RTOS ought to mean 'Right' as in 'now is the right time to run this task'

 

I am surprised first google search show real time operating system https://www.google.com/search?rlz=1C1CHBF_enIN856IN856&sxsrf=ALeKk01IgZKY-HQiYpv4HYCfAYKoTqkh-g%3A1587806538867&ei=SgGkXtPINJCb4-EPkrW3wAw&q=RTOS&oq=RTOS&gs_lcp=CgZwc3ktYWIQAzIECCMQJzIECCMQJzIECCMQJzIFCAAQkQIyBQgAEJECMgQIABBDMgQIABBDMgQIABAKMgIIADICCAA6BAgAEEc6BggAEBYQHlDyGFi0LWDHM2gAcAJ4AYAB0AOIAbUdkgEJMC4xLjkuMy4xmAEAoAEBqgEHZ3dzLXdpeg&sclient=psy-ab&ved=0ahUKEwjTleKloIPpAhWQzTgGHZLaDcgQ4dUDCAw&uact=5

 

Maybe you mean something else or you are saying in different context 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

rahulk7 wrote:
Maybe you mean something else or you are saying in different context

Yes.

 

Of course there are products called "RTOS" - that wasn't Brian's point.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:

You have read my tutorial? Seems not by your response.

yes I looked tutorial https://www.avrfreaks.net/forum/tutc-multi-tasking-tutorial-part-1?page=all

 

 

I don't see anything wrong if I take one my example consider we are sorting boxes on the conveyor by their size. We have three tasks to complete.: run the motor, count the box and check the safeties, there are a lot more tasks, all are running.

 

Making state diagram will be best choice to understand fundamental  Can you help me make a state diagram for three tasks? 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Your example would use a state machine, but I fail to see how there is three competing tasks. If anything, the tasks would be round-robin.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:

Your example would use a state machine, but I fail to see how there is three competing tasks. If anything, the tasks would be round-robin.

 

I want to make handmade diagram may be state machine, state diagram anything to understand fundamental . If my recruitment is not correct, I will probably not be on the right track. Whatever best had in my mind I have given. Can you improve my example? 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

rahulk7 wrote:
Can you help me make a state diagram for three tasks?

What "help" do you need? What have you tried? Where are you stuck?

 

You now seem to have changed the topic from "examples of RTOS" to system design ...

 

It seems like you really need to spend some time getting some real experience with real systems.

 

Once you understand - from experience - the kind of stuff that actually goes on within real embedded systems, then you will understand how an OS might be able to help some of those things (and hinder others).

 

This  trouble with trying to illustrate this with trivial examples is always that this is not where an OS brings any benefit!

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

The reality is you would not have the microcontroller look after safties!  Fundamental machine safety.

 

Here's an example that is not synthetic - 

microcontroller with usb device interface

the usb device interface is the man digging the hole, but you need someone to move the dirt.

Two tasks - manage usb traffic and manage send/receive buffers

Then you might have other tasks competing to send/receive data via usb.

Which task would have the highest priority? Lowest priority?

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

What "help" do you need? 

I am looking help to make specification before starting to work on real system.  once I have correct specification and requirement for system I would try to make sate diagram.

awneil wrote:

 What have you tried? 

I have spent a lot of my time to understand fundamental of RTOS.  I have put the all thoughts in front of you as much as I could think in my mind

awneil wrote:

 Where are you stuck?

First of all, I do not have a requirement , so I created a requirement (see conveyor example ) then made specification (create multiple  tasks ) I am stuck in planning 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There must be a language issue here, all this is just not making any sense. Like the other posts, we just go around in circles.

I'm calling TROLL.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

rahulk7 wrote:

Maybe you mean something else or you are saying in different context 

 

Consider the Wikipedia entry...

 

Quote:

real-time operating system (RTOS) is an operating system (OS) intended to serve real-time applications that process data as it comes in, typically without buffer delays. Processing time requirements (including any OS delay) are measured in tenths of seconds or shorter increments of time.

 

 

Tenths of seconds? I'd hardly call that Real Time. And 'without buffer delays'? Again, very unlikely.

 

Consider a serial port running at 115,200 baud which is not uncommon. That's a byte every 86 microseconds. An RTOS being serviced slower than that, and without buffer delays will not work.

 

The label RTOS is usually completely misused when talking about things that are nothing more than task switchers. Hence my statements being that most (all?) things called an RTOS aren't really. And by calling them an RTOS it leads people to have the wrong idea as to what they are.

 

In the real world these things fall, broadly, into four categories...

 

1) Superloop.

2) RTC (run-to-completion) scheduler

3) Cooperative scheduler

4) Preemptive scheduler

 

All of them, with the exception of 4), might use state machines to break tasks down into smaller parts to avoid too much time being spent on one task.

 

Most (all?) of them will use interrupts and buffers to deal with incoming asynchronous inputs.

 

I suggest that you get it clear in your head the difference between them. Know the fundamentals and the rest is easy.

 

 

 

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

rahulk7 wrote:
Maybe my Google search technique is very bad

Kartman wrote:
Have you Googled avrfreaks kartman multitask?

You should find a tutorial I wrote many years ago.

This made me smile because that's exactly the search term I'd have used cheeky

 

--

 

Anyway - We somehow have diverged onto State Machines; let's get back to RTOS.

 

rahulk7 wrote:
I spent all my time on research and whatever I understood, I explained here.

{Criticism removed, others have weighed in before me.}

 

On my university course (early 80s) we learnt about the underlying components of an RTOS first before worrying about much else.

 

  • the concept of a task
  • co-operative scheduling
  • pre-emptive scheduling
  • Semaphore
  • Mutex
  • Messages
  • Queues
  • Events
  • Software Timers

 

These items are just as relevant today as they were in 1981 and you should become familiar with them if you want to understand RTOS.

 

I've spent some time looking for a good RTOS tutorial but failed, the vast majority assume the reader already knows the above concepts.

 

The best I've found (Sorry Kartman) were actually FreeRTOS (probably because of it's audience) and a Renesas guide.

 

https://www.freertos.org/about-RTOS.html There is good information here but it's spread randomly over many pages

https://www.renesas.com/us/en/doc/products/tool/apn/res05b0008_r8cap.pdf

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


If you have a smattering of German...

 

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just like many OS's (Windows, Linunx, etc) higher end RTOS's can give you insight into different running tasks & processes...are there execution/timing troubles, how much memory they are using, etc.  Of course, this adds to the processor overhead---nothing is free.

So hopefully now, you can assign this task a lower priority & think about something else.   Watch out for overflow exceptions & unexpected message queue timeouts.

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Kartman wrote:
Car ECUs tend to use a superloop.
also OSEK and AUTOSAR

Requirements on Operating System | AUTOSAR

[page 12]

4.2 Real-Time Operating System

Classic Platform - AUTOSAR

A Case Study of Toyota Unintended Acceleration and Software Safety

by Prof. Phil Koopman

September 18, 2014

Carnegie Mellon University

[3 instances of OSEK]

 


RTOS | Barr Group

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

From my perspective an RTOS is a unit of software that iintegrates a  hardware timer or clock to a scheduler to run jobs that need to meet deadlines.   The RTOS and client software may be designed so that each job runs to completion (w/ possible saved state), so that one stack is required, or the RTOS and client software may be designed so that jobs may be pre-empted, so that multiple stacks are required.   In the first case, it takes some care to design the system so that no job is started late because some other job ran too long.   In the second case, one has to take the time hit for context switches and more complicated code.

Last Edited: Sat. Apr 25, 2020 - 05:51 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

AVR micro can't do all task at one time it only execute one task at one time.

 

consider we are sorting box on conveyor and we have following task to 

 

  1. Motor run conveyor belt and control the speed of conveyor belt
  2. When conveyor ON, show the green light indication 
  3. When conveyor OFF show the red light indication 
  4. Read the temperature of system if it exceed maximum temperature range, rung buzzer, shut down system
  5. Display counts and temperature reading 
  6. Encoder get the position of box and box will collect to collection bin 
  7. if something bad happen press panic button , system should be automatically shut down

 

when we have multiple task  how to set priority for all task's which one should run first which one should be next?

 

 

Last Edited: Sun. Apr 26, 2020 - 05:48 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1


rahulk7 wrote:

when we have multiple task  how to set priority for all task's which one should run first which one should be next?

 

That's up to you, as the software engineer to figure out.

 

Have you tried to do so? Have you drawn a flowchart? Have you drawn a statechart?

 

The best way, and only way, to learn is by doing.

 

[EDIT]

I know that they are considered deeply old-fashioned by most people under 30 but have you considered buying a book on the subject. On my shelf I have these...

 

 

 

There were all written over 25 years ago but nothing has changed. I bought them all secondhand for not much money.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

Last Edited: Sun. Apr 26, 2020 - 07:00 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1
  1. Motor run conveyor belt and control the speed of conveyor belt
  2. When conveyor ON, show the green light indication 
  3. When conveyor OFF show the red light indication 
  4. Read the temperature of system if it exceed maximum temperature range, rung buzzer, shut down system
  5. Display counts and temperature reading 
  6. Encoder get the position of box and box will collect to collection bin 
  7. if something bad happen press panic button , system should be automatically shut down

 

1. task. run monotonically

2. state

3. state

4. task run monotonically

5. task run monotonically

6. task run monotonically

7. state

 

The tasks can all have the same priority and run round-robin.

In reality, if the compute load is light, they can all run as one task.

 

You need to do more research.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:

 

The tasks can all have the same priority and run round-robin.

In reality, if the compute load is light, they can all run as one task.

 

As I have read that those tasks which are more important should be given high priority. Accordingly, I should give high priority to the panic button task, The subsequent task is to run the belt. I think the priority of a task depends on its importance, more important task will execute first 

 

I did not understand why you think all the tasks can be a same priority ? 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

rahulk7 wrote:

I did not understand why you think all the tasks can be a same priority ? 

 

Priority only matter when you do not have enough CPU cycles to do everything in the time needed. Nothing in your list needs dealing with at a rate of more than once per second. In that time an AVR will execute 16 million insturctions.

 

In fact, to deal with all those taks you list should take no more than maybe 10,000 CPU cycles so you could deal with all those 1600 times a second. So you don't need an RTOS to do it, you can do it all with a 'while(1)' loop and some 'if ( PIN = 0xXX)' statments.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Just some comments.

 

Depending of the speed I guess that the encoder need high priority, but will typically be done in a ISR.

 

And the panic button, will will for safety typically not be controlled by the AVR. But yes it also need to go to it so it know we have stopped.

 

 

Why do you really want this to be about RTOS and not solve the problem, are you asked to investigate this or ?

simple things like in #67 don't need a OS of any kind.    

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

priority is only needed where's there's competition for a resource. That resource could be cpu time, or it could be something like ethernet or usb where multiple tasks want to send/receive data. Generally the higher priority a task, the less often it will run.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sparrow2 wrote:

Why do you really want this to be about RTOS and not solve the problem, are you asked to investigate this or ?

simple things like in #67 don't need a OS of any kind.    

I'm just talking about multitasking in #67. I don't think rtos are necessary for multitasking, 

 

My overall goal is to design a rtos system just for learning I found some of example on google but they are beyond my capability like satellite system, missile system radar system so I am trying to make specification for small system that needs RTOS.  

Last Edited: Sun. Apr 26, 2020 - 09:46 AM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, you don't seem to be getting much traction here. There's much better resources you could be using.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

rahulk7 wrote:
My overall goal is to design a rtos system just for learning

Then stop procrastinating; you'll learn infinitely more by doing than by asking essentially the same questions over & over on avrfreaks.

 

FreeRTOS was introduced into this thread by yourself and mentioned extensively in the earlier posts Why don't you download it and start to play ?

 

There is a WIN32 port of FreeRTOS for Demo & Testing, you can get by without AVR etc., so install Visual Studio or equivalent IDE; compile the blinky demo and examine the code.

 

I did just that this morning - OK despite being called blinky, the demo isn't particularly visual but it does run. You've told us your good at C code, so read through the code and see for yourself how things are done.

 

In fact I already see how I could write your MotorControl task. Without a speed sensor, it's actually trivial.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:

Well, you don't seem to be getting much traction here. There's much better resources you could be using.

 

I understood this, so I am not asking specific questions for rtos. I am a newbie,  I can see that even the experience people are not able to answer the questions of RTOS. I know It is a difficult subject and It will take a lot of time to understand fundamental.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Now you’re just talking rubbish. Be off with you then.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

N.Winterbottom wrote:

rahulk7 wrote:
My overall goal is to design a rtos system just for learning

 

FreeRTOS was introduced into this thread by yourself and mentioned extensively in the earlier posts Why don't you download it and start to play ?

 

There is a WIN32 port of FreeRTOS for Demo & Testing, you can get by without AVR etc., so install Visual Studio or equivalent IDE; compile the blinky demo and examine the code.

 

 

That's how i started,  I did experiment by running demo code of free RTOS on Atmel studio But I think first I have to understand when I need rtos.  I need to find a project that requires rtos. I have seen some code on internet, but it does not seems why rots are needed in it. I am not in a hurry, I know it will take time and I am ready to spend my time on searching and reading books 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Now you’re just talking rubbish. Be off with you then

 

This is the  fact, I am not pointing anyone here you all are helpful members but  I asked some people in my circle, they just tell me to read this book or read it on the website, But if you ask for just a little explanation , they struggle then they say that everything information is available on Google

 

When I will learn well, I will make the threads, it May be help for newbie  like me 

Last Edited: Sun. Apr 26, 2020 - 12:35 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Forget FreeRTOS, forget RTOS in general. Go back to the problem you specified back in #67 and make a flowchart. Now write the code. Does it work? Are there any places where a response to an input is late? Then, and only then, do you know if you need an RTOS.

 

It's called design. Those of us who do this sort of thing to earn money do it all the while. I will always build prototypes, both hardware and software, before I even think about starting a project for real.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Brian Fairchild wrote:
I will always build prototypes, both hardware and software, before I even think about starting a project for real.
A really BIG yes

David (aka frog_jr)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brian Fairchild wrote:

Are there any places where a response to an input is late?

Can give your example What is the place where response should be fast?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

 But I think first I have to understand when I need rtos.  I need to find a project that requires rtos. 

Well, then you should quit now...since NO project absolutely requires RTOS....a smart workaround or other approach can always be found without RTOS.  RTOS is a tool that make such extreme workarounds unneeded.  RTOS makes it easier, faster, and more out-of-the-box reliable to do these things.   Just like a compiler is a great tool to help you code more efficiently (rather than resorting to asm), RTOS is another tool in your arsenal.  RTOS helps YOU, the programmer, the system could care less if it was written using RTOS.  I've never had a system complain about my coding style or tools.

 

So if you are looking for simple apps that REQUIRE RTOS, you should probably stop looking and start trying RTOS to see HOW this tool can help you.

 

What is the place where response should be fast?

Fast can be had even by a tiny13 running 100 lines of asm code...you need to rethink  

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Sun. Apr 26, 2020 - 06:50 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

rahulk7 wrote:

Brian Fairchild wrote:

Are there any places where a response to an input is late?

Can give your example What is the place where response should be fast?

Hang on. It was you who posted the list of requirements so it should be you who works that out. Until you start to do some work yourself I am out of this topic.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Important fact: there are (probably) no applications that require RTOS. RTOS is simply a tool that might, or might not, help the programmer to achieve specific goals. One of those goals that suggest an RTOS is deterministic response time to particular inputs when there are a variety inputs present. 

 

If the system is not too complex, a skilled programmer can usually achieve these goals without an RTOS. Adding RTOS simply adds structure to a program and it provides defined behavior. But, as a system becomes more complex, it is harder and harder to achieve deterministic responses. Also, RTOS takes considerable learning effort. But, once you learn how to use one, then it becomes relatively easy, almost a "crutch" so that you don't have to think so much about program architecture; you basically have to use the architecture imposed by the RTOS.

 

Let me give you an example that I know about. I make data logging accelerometers (link in signature, below). One of the big challenges is that data is generated fairly fast (up to once every 40ms) and needs to be written to a microSD card. The issue, in my case, is the write time of the memory card compared to the data rate. It would seem that this might be an application for an RTOS. But, RTOS, in this case, solves nothing because an RTOS will not make the uSD card write any faster. The uSD card is the limiting factor, not the software. Without uSD cards spec'd for higher write rates, that is what I am stuck with. 

 

On the other hand, an RTOS MIGHT help organize a fairly complex state mechine (actually several of them, intertwined).  The counter-argument is that the RTOS takes additional code and my Mega328P flash is already 97% full. Maybe some code would be saved in other places, but I cannot count on it at this point. It might make more sense if I had started with an RTOS but I did not.

 

So, in this case an RTOS is completely optional. And, I think this is more often the case than not. If you like RTOS and know how to use one, then maybe it can help you. Otherwise, it is highly probable that you can do without one.

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:

Fast can be had even by a tiny13 running 100 lines of asm code...you need to rethink  

 

A real-time system has time-critical deadlines that must be met; 

 

1.  Can you tell me a task where it has to be completed in its deadline ? I don't get such tasks in my mind

2.  What happens if a task does not complete in its deadline?

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ka7ehk wrote:

Important fact: there are (probably) no applications that require RTOS. RTOS is simply a tool that might, or might not, help the programmer to achieve specific goals. One of those goals that suggest an RTOS is deterministic response time to particular inputs when there are a variety inputs present. 

 

So, in this case an RTOS is completely optional. And, I think this is more often the case than not. If you like RTOS and know how to use one, then maybe it can help you. Otherwise, it is highly probable that you can do without one.

 

Jim

yes Thank you very much I will keep your advice in mind Thanks for taking time to explain in detail 

Last Edited: Sun. Apr 26, 2020 - 07:23 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brian Fairchild wrote:
rahulk7 wrote:

Brian Fairchild wrote:

Are there any places where a response to an input is late?

Can give your example What is the place where response should be fast?

Hang on. It was you who posted the list of requirements so it should be you who works that out. Until you start to do some work yourself I am out of this topic.

I asked you back because I thought a lot in my mind but nothing came out 

 

mechanical relay  can take many 10's of milliseconds to  operate. LCD  can take around 100 milliseconds 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

rahulk7 wrote:

 

AVR micro can't do all task at one time it only execute one task at one time.

 

consider we are sorting box on conveyor and we have following task to 

 

  1. Motor run conveyor belt and control the speed of conveyor belt
  2. When conveyor ON, show the green light indication 
  3. When conveyor OFF show the red light indication 
  4. Read the temperature of system if it exceed maximum temperature range, rung buzzer, shut down system
  5. Display counts and temperature reading 
  6. Encoder get the position of box and box will collect to collection bin 
  7. if something bad happen press panic button , system should be automatically shut down

 

when we have multiple task  how to set priority for all task's which one should run first which one should be next?

 

 

 

Not to drag this wheel spinning on even more but.......

 

What you describe above is done all the time with PLC's.  The Auto Industry handles far more critical operations on assembly lines than your simple project.  When I was with the Fiber Optics company I worked at Denver International Airport on teh Runway Lights and all of that is controlled with a PLC....No RTOS needed there.

 

As others have explained to the point of exhaustion is that the processors are running your code so fast teh user will never notice what happened first anyway.  Couple that with teh fact that the mechanical components are moving slower than the processor and the human user only adds to teh point that using a RTOS is not gaining anything.

 

I am not sure who is more stubborn here.  YOU (rahulk7) for continuously not listening to what is being explained, or the community for thinking they could crack the thick skull of the stubborn.

 

IF you(rahulk7) still wish to continue on the RTOS brick road, then take my suggestion and start where I pointed in my first post. 

 

Enough!

 

JIm

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 2

rahulk7 wrote:
That's how i started,  I did experiment by running demo code of free RTOS on Atmel studio But I think first I have to understand when I need rtos.  I need to find a project that requires rtos

Why on earth didn't you explain this in your original post. If you had "set the scene" and told us the full story; explaining what you had achieved already; this thread would have progressed in an entirely different manner.

 

It's clear to me that you have NOT read any of the web pages or PDF documents we freaks have searched out for you. That verges on plain rudeness.

 

In fact your original question in #1 can be answered by the PDF I linked in #62  https://www.renesas.com/us/en/doc/products/tool/apn/res05b0008_r8cap.pdf at the beginning of the first "proper" chapter we find:

Figure 1 depicts an example of RTOS implementation on Renesas automotive dashboard platform

As for "But I think first I have to understand when I need rtos" That same PDF has a section titled: Why RTOS for Real-Time Application

 

As for "I need to find a project that requires rtos"  well for the purposes of learning and instruction that's plainly wrong. The FreeRTOS demo is basically a blinking LED. To build on that, your conveyor application will suffice just fine.

 

I really don't know where this thread goes from this point on. If you continue to ask silly questions, we freaks will simply just drop away and you'll be left here on your own.

 

Last Edited: Sun. Apr 26, 2020 - 09:08 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yikes: Double post. How did that happen - please delete:

 

I know what I did, I clicked Quote instead of Edit

Last Edited: Sun. Apr 26, 2020 - 09:09 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

jgm makes a very important point, though it may be hidden to rhulk7.

 

It is really difficult for beginners to comprehend the speed at which even a simple microcontroller runs. Often even fairly complex decisions can be made within a few microseconds. The time between a user pushing a button and turning on an LED can often be well less than a millisecond, even after doing debouncing (which, by the way, is as close to a hard real-time task as one can usually get). 

 

Now, compare these times to what a human can perceive or do. Things that happen in less than 50milliseconds are usually perceived to be instantaneous.  Its not until you get slower than once every 100ms or so that most folks can determine that separate things are happening. The time it takes you to apply car brakes after seeing something is usually taken to be around 1.5 seconds (it can be shorter with training, as for race car drivers).

 

Even I, who have many years of electronic, logic, and microcontroller experience, am often surprised be the response speed of things I make. The short conclusion is that if you judge things on a human scale, even the most mediocre microcontroller is 100s of times faster. For many, many, things, they are so close to instantaneous that you can all but ignore the response speed. Then, even 10s of milliseconds of response delay is undetectable by humans and is still perceived as "perfect real-time response".

 

Jim

 

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you all for spending your precious time  to help me. I learned a lot of things from this whole thread. I understood that in order to achieve a big task, I should divide big task into small tasks. Small tasks should be achieved first. I know I want to learn about rtos. I should have asked the questions related to rtos at the right place But  before this, I should learn fundamental of real time system.

 

I realized that I should pay more attention to my learning skills. I should start learning by making state machine and flow chart for easy understanding. I think people can help me more if I tell them my problem other then asking the question on rtos  

 

I would like to apologize to all of you. my intention was not bad all I was trying to learn but by chance t if you feel bad I am really sorry 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

rahulk7 wrote:
I am a newbie

Then concentrate on newbie stuff!

 

You can't understand advanced topics until you've laid good, solid foundations with the basics.

 

That's why you're struggling.

 

As I said back in #57:

 

awneil wrote:
you really need to spend some time getting some real experience with real systems.

 

Once you understand - from experience - the kind of stuff that actually goes on within real embedded systems, then you will understand how an OS might be able to help some of those things (and hinder others).

 

This  trouble with trying to illustrate this with trivial examples is always that this is not where an OS brings any benefit!

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...

Pages