Thursday, 21 January 2016

ARTIFICIAL RTOS

ARTIFICIAL RTOS
G. Anand,
Email id- anandg.embedd@gmail.com,
Mobile No- +91 9994879483


ABSTRACT
ARM is the industry's leading supplier of microprocessor technology, offering the widest range of microprocessor cores to address the performance, power and cost requirements for almost all application markets. The aim is to develop advanced LPC1768 ARM processor without compromising the performance. RTOS with library functions which can be accessed remotely adds advantage to this processor in terms of efficiency, performance, memory, speed.  In conventional processor there is no enough memory to perform complicated algorithms and tasks in image processing such as face recognition, fingerprint authentication, etc. In order to overcome this problem web service is incorporated with this processor. A web service is any piece of software that makes itself available over the internet. Web service includes a web server which handles standard library functions and complicated functions like image processing functions. This will provide easy access to the user who needs to perform complicated functions. With the help of this web service time and memory consuming processes can be done in am efficient manner.
INTRODUCTION
An operating system is a computer program that supports a computer's basic functions, and provides services to other programs that run on the computer. Most operating systems appear to allow multiple programs to execute at the same time. This is called multi-tasking. In reality, each processor core can only be running a single thread of execution at any given point in time. A part of the operating system called the scheduler is responsible for deciding which program to run when, and provides the illusion of simultaneous execution by rapidly switching between each program. The type of an operating system is defined by how the scheduler decides which program to run when. For example, the scheduler used in a multi user operating system will ensure each user gets a fair amount of the processing time. The scheduler in a Real Time Operating System (RTOS) is designed to provide a predictable execution pattern. This is particularly of interest to embedded systems as embedded systems often have real time requirements. A real time requirement is one that specifies that the embedded system must respond to a certain event within a strictly defined time (the deadline).
Embedded systems are not recognizable as computers. Instead, they are hidden inside everyday objects that surround us and help us in our lives. Embedded systems typically do not interface with the outside world through familiar personal computer interface devices such as a mouse, keyboard and graphic user interface. Instead, they interface with the outside world through unusual interfaces such as sensors, actuators and specialized communication links. Real-time and embedded systems operate in constrained environments in which computer memory and processing power are limited. They often need to provide their services within strict time deadlines to their users and to the surrounding world. It is these memory, speed and timing constraints that dictate the use of real-time operating systems in embedded software.


Real time embedded system with RTOS
The heart of a real-time OS (and the heart of every OS, for that matter) is the kernel. A kernel is the central core of an operating system, and it takes care of all the OS jobs. In an embedded system, frequently the kernel will boot the system; initialize the ports and the global data items. Then, it will start the scheduler and instantiate any hardware timers that need to be started. After all that, the Kernel basically gets dumped out of memory, and the scheduler will start running the child tasks. In this paper, advancement in processor is introduced in the aspect of RTOS. In conventional processor RTOS handles only standard library functions. This limits the performance of the processor. In order to enhance the capability of the RTOS, complicated functions such as image processing algorithms and tasks are made as functions and added to the function library. 
1.      Booting
2.      Task Scheduling
3.       Standard Function Libraries + library handling complicated algorithms which can be accessed remotely from web server.                                                                           
User can perform complicated tasks by calling the functions in the library. The input of the complicated task/algorithm should be given as arguments of the function. The function definition is stored in the webserver. By sending the function with arguments to the webserver through GPRS, the user can perform desired operations. Webserver returns the output to the RTOS in a specified format. Thus RTOS is responsible for providing specified output to the user.
IMPLEMENTATION
                LPC1768 is an ARM Cortex-M3 based microcontroller for embedded applications featuring a high level of integration and low power consumption. The LPC1768/66/65/64 operates at CPU frequencies of up to 100 MHz. The ARM Cortex-M3 CPU incorporates a 3-stage pipeline and uses Harvard architecture with separate local instruction and data buses as well as a third bus for peripherals. The ARM Cortex-M3 CPU also includes an internal prefetch unit that supports speculative branching. The peripheral complement of the LPC1768/66/65/64 includes up to 512 kB of flash memory, up to 64 kB of data memory, Ethernet MAC, USB Device/Host/OTG interface, 8-channel general purpose DMA controller, 4 UARTs, 2 CAN channels, 2 SSP controllers, SPI interface, 3 I2C-bus interfaces, 2-input plus 2-output I2S-bus interface, 8-channel 12-bit ADC, 10-bit DAC, motor control PWM, Quadrature Encoder interface, 4 general purpose timers, 6-output general purpose PWM, ultra-low power Real-Time Clock (RTC) with separate battery supply, and up to 70 general purpose I/O pins. The LPC1768/66/65/64 are pin-compatible to the 100-pin LPC236x ARM7-based microcontroller series.

Processor
The RTOS of the introduced processor consists of specific functions to access peripherals. In conventional processor user needs to write lengthy program to access peripheral devices. This will reduce the complications in accessing the peripherals. Input of the time consuming processes should be sent to the web server which provides web services using GPRS. The term web services describes a standardized way of integrating web based applications using the HTML,AJAX,XML, SOAP, WSDL and UDDI open standards over an internet protocol backbone. Now let us see how to access webserver function and how to execute it in server side. Following program explains how to call FFT function which is in webserver library.
Program to be handled by RTOS (to access web server):

#define freq 60                 
#define pi 3.14
struct function_args
{
//function name
char *func_name;                           
//function argument address collection
int function_arg[100];                     
//int,float,array etc
int function_argtype[100]              
//return argument collection
int retun_arg[100];           
//int,float,array etc
int return_argtype[100];  
};
main()
{
float res[100],sig[100];
int i;
struct function_args func_args;
static char *fname=”fft”;
for(i=0; i<100; i++)
{
//signal generation for fft
sig[i]= 2* pi* freq* *(i/100);                           
}
func_args.func_name= f_name;
//assign input signal to argument of FFT function
func_args.funcinon_arg[1]=sig;                    
// assign argument type for FFT. Ex: 0x15 àfloating point array and 0x64 àbuffer size 100
func_args.function_argtype[1]= 0x6415;   
//assign address of result for FFT
func_args.return_arg[1]=res;                                          
func_args.return_argtype[1]= 0x6415;
// inbuilt function in RTOS which handles server through    TCP/IP or HTTP. Function name and  function arguments are extracted by RTOS from func_args structure and it is passed to the server and responses are stored into the func_args structure
Remote Call( &func_args);                                                     
}
To perform FFT operation RTOS calls the function in webserver through TCP/IP or HTTP. Function name and function arguments are extracted by RTOS from func_args structure and it is passed to the server. After calling the FFT function which is in webserver, function definition should be executed by the web server. To perform specific operation, program should be written in server side. Following program explains how the webserver should react if the user (RTOS) tried to access FFT function. The result is sent to the RTOS using GPRS.
Server side program for php:
<?php
if(isset($_POST[‘func_name’])
{
$func_name=$_POST[‘func_name’];
If($func_name==’fft’)
{
$sig=$_POST[‘inp1];
$freq=$_POST[‘inp2];
//created in server

$res=fft($sig, $freq);                          
Echo $res;
}
//other functions
elseif                                                       .
.
.
}
echo ‘check syntax’;
?>

The above program which is written in php shows the selection of FFT function among various functions in webserver. Thus our proposed processor can be implemented to overcome the problems such as performing complicated functions in the context of memory and speed. Surely this processor will be the perfect replacement for existing processors. 
Download Full Paper

 functions for Dynamic configured peripheral devices, visit to   Library for ARM Device

No comments:

Post a Comment