ANSARI’s Micro Operating System for embedded Multitasking Demands

» Posted on 11. Jan 2013

Related links:  AMOS | Overview 


The Real-Time-Operating-System AMOS


To answer complex demands in small networked modules, which operate with low power 16-bit µControllers an embedded real time operating system called AMOS ( ANSARI’s Micro Operating System ) has been developed by ANSARI.

AMOS is a multitasking real-time operating system with optimized communication capabilities within its kernel. It supports up to 16 different communication channels and up to 96 user and system tasks to operate simultaneously and needs a very small footprint for its operation (less than 50 kByte of system code and only 2 kByte of SRAM!). The rest of the Flash and RAM areas can be used by user applications.

AMOS is the result of the needs detected in several previous projects and is based on following rules:

  • Optimized usage of system resources
  • Independent OS and application structure
  • Self-sufficient Communication capabilities
  • Integrated remote and multitasking capabilities
  • Table and pointer organized data and function structure
  • Memory and storage reorganization at runtime and not only at compilation time







The Scheduler

The heart of AMOS is a special task scheduler, which is not based on time slice distribution between tasks like many other operating systems. AMOS allows a task to run as long as needed and supports highly any real time oriented application. On the other hand AMOS is more interrupt driven rather than polling driven. The kernel has the ability of setting different priority levels to tasks within runtime.

Memory Management

A powerful implementation in AMOS is the software controlled memory management. The whole physical available memory is declared as a shared memory for the whole system and portions are allocated and released freely as needed by the kernel, communication buffers, system tasks or user applications. Also the main system stack and user application stacks are flexible in size while runtime using this shared memory system.

Communication Links

A communication management module called ComLink handles packet based communication between running tasks locally and also between any running tasks and external world over available hardware links in the system like UART, SPI, I²C, USB etc. Generally packet types are distinguished as verbose or transparent. Verbose packets for example allow a user to talk with the kernel using normal text commands over a hyper terminal. Inter-Process-Communication (IPC) packet is a transparent packet example, which enables any task to communicate to other internal tasks or external world based on a protocol.

External Task Execution

AMOS is capable of handling tasks, which are added to system in runtime, locally or remotely, without new compilation of the code making the operating system very powerful for service and error handling routines.

RTC and Timers

A timer unit realizes unlimited and independent timers for any tasks in the system, while the timer module itself handles any kernel relevant timing issues including RTC functionalities. An application may request any type of timing values from 80µSec up to hour and days based timings.

Error & Warning Handler

System error, warning and status handling facilities operate as intelligent shadow logic beside normal kernel operation to prevent system crashes and keep the kernel alive and operating in fault conditions. Heavy messaging and status reporting capabilities are realized to outside world fully transparent to local tasks for better interoperation of multiprocessor systems.

Multilanguage Messaging

Integrated multi language messaging system enables tasks and system messages to be sent to the user (e.g. terminal emulators) not only in English, but also in another language. The message language can be changed in run-time from English to other custom language or vice versa.

Interrupt Hooking

Interrupt handling module enables tasks to make use of interrupts in real time operations and it also make tasks to be able to hook interrupts in run-time for interrupt sharing purposes.

Type Conversions

Complete string and number and variable type conversions are available to any tasks by APIs


Complete Integer (8, 16, 32 and 64 bit), fixed point (16, 32 and 64 bit), and floating point (IEEE 754, 32 and 64 bit) arithmetic functions are available to any application in the system over given APIs


AMOS itself is provided compiled in a library form as a basic framework. Many features are organized in Add-On modules also compiled and available in library form. This design allows customers to combine any needed features together at compile time using compiler switches, as needed by desired application.

Only header files and the libraries are needed for the customer to write its own applications. Delivered application examples allow programmers easily to learn intuitive how to work with AMOS and how to embed own codes into AMOS environment.



Add-Ons are standalone library components, which can be added to the firmware at compile time providing extra functionality to the operating system needed by user applications. These functions are available by APIs to the user. Any data transferred between user applications and the add-on modules are based on IPC packets.

The add-on list grows continuously as project demands come up. Following a list of actual add-ons:

    Enables the µcontroller integrated analog-to-digital converter capabilities to user application, without having to understand deeply how to configure the ADC peripheral.
    Several services are provided to an application such as automatic monitoring and message triggering on monitoring analog signals.
    Provides the user application with flexible runtime configurable DMA services between different hardware and software modules.
    Controls all system GPIOs and allocates functions to pins and tasks at runtime. Provides application based allocation of a pin and shares the hardware resource between applications and secures misusages by applications.
    A command processor to interpret received verbose commands from user over a hyper terminal to control the system as needed. Many system applications can be terminated, executed or be requested to send status information by sending verbose commands over the hyper terminal. Also user applications can use this command processor for their applications to be controlled by verbose commands.
    This add-on provides storage capability to the system. The whole unused Flash area on the µController itself and additional external serial Flash storage over SPI is emulated as an EEPROM to user application to save application data if needed. Larger file handling and logging capabilities can also be realized over this add-on.
    Any calendar time related events and alerts can be used by user application if this add-on is enabled. Also time stamp capability for logging is supported by this add-on.
    Any external devices, which may be connected to the µController over the SPI can be accessed in a high level manner using this add-on. It adds read and write APIs to external devices for user applications
  • AMOS-I²C
    Same as SPI add-on but over I²C interface. Additionally a powerful verbose command facility allows the user to access any I²C device in parallel, while the applications are running independently.

Detailed information how to use these add-ons are given by existing example codes.



Modules are hardware abstraction layer codes to embed external devices into the system as API based functions. For each external component in the hardware a module code may be created to realize always same functionalities within different projects. This helps to improve the interoperability of the firmware  in  different products.

The module list grows continuously as project demand come up. Following is a list of actual modules:

  • AMOS-DRV8402
    This modules adds the features of a dual full bridge PWM motor driver to the system
  • AMOS-DS3501
    Creates APIs for controlling a high-voltage, non-volatile I²C potentiometer with a temperature sensor and related lookup table.
  • AMOS-DS390x
    Adds functions needed to control a triple 128-position nonvolatile digital resistor/switch to the system.
  • AMOS-MCP4xxx
    Enables the control functions of a 8-bit dual I²C digital potentiometer to the system
  • AMOS-PCA9501
    Enable the functions of a 8-bit I²C I/O expander with interrupt and 2kbit external EEPROM to user applications.
  • AMOS-PCA9691
    Creates APIs for controlling a 8-bit A/D and D/A converter over I²C to the system
  • AMOS-PGA11x
    Allows an application to control a Zero-drift programmable gain amplifier with input multiplexer
  • AMOS-S25FLxxx
    Enables the usage of the external serial SPI Flash storage devices in different capacities

Detailed information how to use these modules in the system are given by existing example codes.

Submit a Comment