3
\$\begingroup\$

I'm a developer of control devices for switch mode power supplies which need to generate a PWM signal(s) with a frequencies about 100 kHz, measure analog signals, communicate vie USART, make relatively simple calculations and so on. It is also important to start up fast and react very fast on some events like external interrupts (often within a fraction of microsecond).

Now I'm using Atmel Studio with GNU C compiler.

I'd like to go from 8 bit AVRs to ARMs. The main reasons are (hopefully): faster, more flexible, more powerful calculations, better community support.

I'd really want a short learning curve and fast development cycle.

I decided to use ARM Cortex-M0 and M3 processors.

Will I be able to use operation system on ARM?

The reasons why I think it could be useful in my case - faster learning curve and development time. But I have some doubts that I will be able to run application within several milliseconds after supply voltage will be applied and that I will be able to interact with ARM peripherals (like timers).

So do I need an OS in my case?

\$\endgroup\$

3 Answers 3

4
\$\begingroup\$

A general purpose operating system, such as Linux, is a different thing from a real-time operating system (RTOS), such as FreeRTOS and ARM's own RTX. You can search for more info about the differences.

From the description of your application I would say that you certainly don't need, and probably don't want, a general purpose operating system. An RTOS could be used but it is probably not necessary.

I believe the ARM Cortex M0 and M3 microcontrollers do not have a Memory Management Unit (MMU) so that will make it difficult to even run a general purpose operating system on them. An RTOS does not require an MMU.

If you are already familiar with AVR programming but you're not familiar with RTOS programming then using an RTOS on your new ARM project is probably going to increase your learning curve rather than decrease it.

An RTOS does not require a lot of time to boot up like a general purpose operating system. An RTOS application can be up and running within milliseconds.

An RTOS should not get in your way of accessing the microcontroller peripherals such as timers.

\$\endgroup\$
1
  • \$\begingroup\$ ARM Cortex M series does not allow for MMUs (at least for v7) but does allow (i.e., optional) a Memory Protection Unit to be implemented. (The ARMv7-R profile ("real time") also does not support MMUs but does allow MPUs. Also, uCLinux can run on a Cortex-M3, e.g., see "Practical Advice on Running uClinux on Cortex-M3/M4", though the OPs use case does not justify such.) \$\endgroup\$
    – user15426
    Commented Oct 11, 2014 at 17:12
7
\$\begingroup\$

You ask two very different questions.

Will I be able to use operation system on ARM?

Of course, but it will likely be an RTOS like FreeRTOS rather than a dekstop OS like Linux.

So do I need an OS in my case?

Strictly speaking: of course not. Any application can be written in a self-contained way, without an OS or RTOS.

But the question you should has asked is

will I benefit from using an RTOS.

That is more difficult to answer. The Benefits of an RTOS are multithreading and the (additional) libraries, including hardware abstraction. The downside is that it takes time to learn how to use these facilities.

My gut feeling is that for the application you describe using an RTOS will not help you much, so the learning will cost you more than it saves you. But knowing an RTOS will probably be useful for some future project.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ Thanx for accepting, but it is advised to wait some time before accepting to give others the chance to come up with (maybe better!) answers. \$\endgroup\$ Commented Oct 11, 2014 at 9:06
1
\$\begingroup\$

I think it depends on what exactly are you doing. If the controlling system is simple than usually having an RTOS there just adds burden instead of decrease it.

One reason you need an RTOS is when there are more than one thing going on in your MCU.

I have a rather complicated AVR project that called for an RTOS on an ATtiny85: an light dimmer that is controlled over fiber optics. The MCU have two things to do at the same time: watch and time the AC phase sense signal and emit the TRIAC control signal at an appropriate time, and a software serial port at 9600 baud for the optical interface. I have to program both of them using timer-based interrupt-driven non-blocking code.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.