AVRs and RTOS (real  time OS). - Page 1
Forum section: electronics / general

author: firewalker
author_rank: Super Contributor
timestamp: April 05, 2012, 12:10:06 pm
content: A friend of mine asked me today about AVRs and RTOS (freeRTOS, femptoOS etc). I really haven't used (or read anything related) RTOS on a microcontroller before. RTOSs is a framework/toolchain/IDE that you can use to write your program compile it and burn to your microcontroller?Include some header files, make use of the functions/macros/"magic" the RTOS offers, use it's compiler, burn the hex to the target, done.Am I correct at all?Does anyone have any experience on AVR+RTOS? Any hints, examples etc?Alexander.

author: JuKu
author_rank: Frequent Contributor
timestamp: April 05, 2012, 12:31:03 pm
content: RTOS normally does not come with an IDE, it is just a code you include in your project, either in binary or in source code form. And yes, you just include some files, make use of the functions and enjoy the magic.And on AVRs (or AVR32s as I have done), Atmel has plenty of examples. Just take an example program that is close to what you are doing, preferably with too much stuff on it than too little. Cut off what you don't need and add some.

author: Bored@Work
author_rank: Super Contributor
timestamp: April 05, 2012, 01:08:21 pm
content: You don't really need an RTOS for AVRs. It just complicates things, because AVRs are small and simple and it is easily possible to keep control over the code. In my experience people want to throw in an RTOS for such small devices like AVRs when they aren't up to the task and don't understand them, although they are simple.

author: firewalker
author_rank: Super Contributor
timestamp: April 05, 2012, 01:10:26 pm
content: Thanks guys!Alexander.

author: T4P
author_rank: Super Contributor
timestamp: April 05, 2012, 02:58:29 pm
content: Off topic : I haven't used a RTOS before , what's a RTOS ? ( Real time OS , but what's that got to mean? )

author: Jad.z
author_rank: Regular Contributor
timestamp: April 05, 2012, 04:49:21 pm
content: @Dave.sI found this tutorial to be useful:uRTOSFixed Link

author: steve_w
author_rank: Regular Contributor
timestamp: April 05, 2012, 09:30:11 pm
content: hey Jad.z your link is broken.

author: firewalker
author_rank: Super Contributor
timestamp: April 05, 2012, 09:49:03 pm
content: This is the above link.www.mikroe.com/eng/downloads/get/1040/urtos_mikroc_ew_06_2010.pdfAlexander.

author: benemorius
author_rank: Regular Contributor
timestamp: April 06, 2012, 04:11:55 am
content: In a nutshell, a realtime OS differs from any other kind of OS in that the tasks are scheduled deterministically and strictly according to priority. The highest priority task always runs until completion and the OS can never take a different amount of time to respond to input than it took the last time. Think airbags and machinery control or measurement systems as opposed to user interfaces or batch data processing.This realtime nature isn't needed in many cases and you probably don't need it unless you know you need it, but that doesn't mean you can't use an RTOS anyway.

author: DrGeoff
author_rank: Frequent Contributor
timestamp: April 06, 2012, 04:52:37 am
content: Have a look at rtems. It's open source and includes both rate-monotonic tasks and pre-emptive scheduling. Not really intended for small 8-bit micros, but useful for the 32 bit micros now in use, and some 16 bit micros.http://wiki.rtems.org/wiki/index.php/Main_Page

author: jpelczar
author_rank: Contributor
timestamp: April 06, 2012, 06:20:26 am
content: You may want to check out the Contiki OS. Runs on AVR, MSP + some other chips and even on Commodore 64It was developed by the guy who created the uIP network stack. I doubt that you'll need the RTOS for 8-bit AVRs. Just use proper interrupt pins (if you want triggering) and hardware I2C/SPI/etc. instead of bit-banging, timers for scheduled tasks, etc.

author: T4P
author_rank: Super Contributor
timestamp: April 06, 2012, 04:59:36 pm
content: I've been using ChibiOS for sometime now without knowing what's a RTOS ...http://www.chibios.org/dokuwiki/doku.php?id=start

author: bingo600
author_rank: Super Contributor
timestamp: April 07, 2012, 03:26:11 pm
content: FemtoOS was made for the AVRAnd runs on almost all AVR hardwarehttp://www.femtoos.org//Bingo

author: steve_w
author_rank: Regular Contributor
timestamp: April 08, 2012, 06:17:47 am
content: Hey firewalker,I the advice that has been posted is introducing terms that you have never heard then I'd reccommend a bit of study. An RTOS is simple in concept, but can be quite a challenge to get running so it works like an RTOS. If you don't understand the concept then probably you don't need one.Having said that a lot of people here want to do complicated things to learn how they work and understand how to apply techniques in real life situations. So if its a learning experience you want you picked a good one.After all micros are easy, they are made of sand and count to one, how hard can it be?regardsSteve W

author: firewalker
author_rank: Super Contributor
timestamp: April 08, 2012, 07:39:51 am
content: Well, my intention wasn't to learn and use a RTOS on a micro. I was asked what an RTOS for micros is and how to use it by a friend. I just wanted to know if the explanation (a guess at the time) I gave him was far of from the truth.Alexander.