Tech Search

Custom Search
Showing posts with label EMBEDDED SYSTEMS. Show all posts
Showing posts with label EMBEDDED SYSTEMS. Show all posts

Friday, January 2, 2009

Micro C / OS – II, features and applications

Micro C / OS – II, features and applications
In the previous posts, i have discussed about RTOS, in part of this, i would like to share the importance and features of Micro C and OS - II in this post. This will be very useful for doing projects at system level.
Micro C/ OS-II Overview
• µC/OS-II is a highly portable, ROMable, very scalable,preemptive real-time, deterministic, multitasking kernel
• It can manage up to 64 tasks (56 user tasks available)
• It has connectivity with µC/GUI and µC/FS (GUI and File Systems for µC/OS-II)
• It is ported to more than 100 microprocessors and micro controllers
• It is simple to use and simple to implement but very effective compared to the price/performance ratio.
• It supports all type of processors from 8-bit to 64-bit

Micro C / OS-II Components

Micro C / OS-II Real Time Kernel
– Task Management, Time Management, Memory Management, Inter-Task Communication
Micro C/GUI, Micro C/FS, Micro C/CAN, Micro C/USB

Micro C / OS-II Kernel

• Micro C/OS-II, The Real-Time Kernel is a highly portable, ROMable, very scalable, preemptive real-time, multitasking kernel (RTOS) for microprocessors and micro controllers.

Micro C/OS-II services
µC/OS-II can manage up to 64 tasks and provides the following services :
• Task Management (Create, Delete, Change Priority, Suspend/Resume etc.)
• Time Management, Timer Management.
• Fixed Sized Memory Block management.
• Semaphores.
• Mutual Exclusion Semaphores (to reduce priority inversions).
• Event Flags.
• Message Mailboxes, Message Queues.

Task Management
• Task Feature, Task Creation, Task Stack & Stack Checking, Task Deletion
• Change a Task’s Priority, Suspend and Resume a Task, Get Information about a Task

Task Feature
• µC/OS-II can manage up to 64 tasks.
• The four highest priority tasks and the four lowest priority tasks are reserved for its own use. This leaves us with 56 application tasks.
• The lower the value of the priority, the higher the priority of the task. (Something on the lines of Rate Monotonic Scheduling)
• The task priority number also serves as the task identifier

Rate Monotonic Scheduling
• In Rate Monotonic Scheduling tasks with the highest rate of execution are given the highest priority
• Assumptions
* All tasks are periodic
* Tasks do not synchronize with one another, share resources, etc.
* Preemptive scheduling is used (always runs the highest priority task that is ready)

Process Cycle: Task Creation
• Two functions for creating a task:
• OSTaskCreate(), OSTaskCreateExt()

Task States
Task Management
• After the task is created, the task has to get a stack in which it will store its data
• A stack must consist of contiguous memory locations
• It is necessary to determine how much stack space a task actually uses.
• Deleting a task means the task will be returned to its dormant state and does not mean that the code for the task will be deleted. The calling task can delete itself.
• If another task tries to delete the current task, the resources are not freed and thus are lost. So the task has to delete itself after it uses its resources

Priority of the calling task or another task can be changed at run time. A task can suspend itself or another task, a suspended task can resume itself. A task can obtain information about itself or other tasks. This information can be used to know what the task is doing at a particular time.
• Clock Tick: A clock tick is a periodic time source to keep track of time delays and time outs.
• Tick intervals: 10 ~ 100 ms.
• The faster the tick rate, the higher the overhead imposed on the system.
• When ever a clock tick occurs Micro C / OS-II increments a 32- bit counter
• The counter starts at zero, and rolls over to 4,294,967,295 (2^32-1) ticks.
• A task can be delayed and a delayed task can also be resumed

Five services:

• OSTimeDLY(), OSTimeDLYHMSM(), OSTimeDlyResume(), OSTimeGet(), OSTimeSet()

Memory Management

The Memory management includes:
• Initializing the Memory Manager
• Creating a Memory Partition
• Obtaining Status of a Memory Partition
• Obtaining a Memory Block
• Returning a Memory Block
• Waiting for Memory Blocks from a Memory Partition
• Each memory partition consists of several fixed-sized memory blocks
• A task obtains memory blocks from the memory partition
• A task must create a memory partition before it can be used
• Allocation and de-allocation of these fixed-sized memory blocks is done in constant time and is deterministic
• Multiple memory partitions can exist, so a task can obtain memory blocks of different sizes
• A specific memory block should be returned to its memory partition from which it came
Inter-task communication
• Inter-task or inter process communication in µC/OS takes place using
* Semaphores, * Message mailbox, * Message queues, * Tasks and Interrupt service routines (ISR) can interact with each other through an ECB (event control block)
Single task waiting, Multiple tasks waiting and signaling, Tasks can wait and signal along with an optional time out

Semaphores consist of two elements
• 16-bit unsigned integer count
• list of tasks waiting for semaphore
• Micro C / OS II provides Create, post, pend, accept and query services

message-mailboxes
• MciroC/OS-II message-mailboxes: an Micro C/OSII object that allows a task or ISR to send a pointer sized variable (pointing to a message) to another task.
message-queues
• Available services: Create, Post (FIFO), PostFront (LIFO), Pend, Accept, Query, Flush
• N = #of entries in the queue: Queue full if Post or PostFront called N times before a Pend or Accept
• µC/OS-II message-queues organized as circular buffers.

Writing Applications Under µC/OS-II
• Tasks running under a multitasking kernel should be written in one of two ways:

Mciro C/GUI Features
• Memory Devices: Frame buffer, the image of the windows etc are drawn on this buffer and when the drawing is completed, this is copied to the touch screen. This helps in preventing the flickering of the screen.
• Window Manager: It manages the windows that are created in the GUI. It handles all the mouse and keyboard events (touch screen in this case).
• Touch Screen: Touch Screen drivers
• LCD Drivers
• Anti-aliasing: This smoothens the fonts and other graphical entities. It gives a pleasant affect to the eye instead of the rugged look.
MicroC/GUI Features
• Widgets and Dialogs: A library to create the widgets (buttons, textboxes, etc) and dialog boxes. Reduces lot of effort to build everything using pixels and lines
• Font Converter: It converts a general font format (ttf, utf, etc) to the µCGUI compatible fonts
• Bitmap Converter: It converts the 32-bit bitmap images to the compatible bitmap image that is used on µCGUI
• µC/GUI supports all the processors from 8-bit to 16-bit

MicroC/F
• µC/FS is a FAT file system which can be used on any media
• Basic hardware access functions has to be provided
• MS-DOS/MS-Windows compatible FAT12 and FAT16 support
• Multiple device driver support allows to access different types of hardware with the file system at the same time
• Multiple media support. A device driver allows you to access different medias at the same time
• OS support: µC/FS can easily be integrated into any OS
µC/FS Device Drivers
• µC/FS has been designed to cooperate with any kind of hardware. To use a specific hardware with µC/FS, a device driver for that hardware is required.
• The device driver consists of basic I/O functions for accessing the hardware and a global table, which holds pointers to these functions. Available drivers are:
• RAM disk, SMC (Smart Card), MMC (Multimedia Card), SD (Secure Digital), CF (Compact Flash), IDE Hard Disk

Wednesday, March 26, 2008

Microcontroller project pages review

Review of project sites:
I am very happy that this site is gaining more popularity of its content. Thank for the visitors and engineering project enthusiastic people
Microcontroller project pages review Here i would like to share some of the websites which deals with micro controller projects, articles related to microcontroller, embedded system related projects for engineering students studying in final year, some of the top sites are here
1. Programming PIC MCUs in BASIC :
This sites deals with the basics of PIC microcontroller, programming basics, hardware and so on. This will give some deep insight before start to do projects in this controller in electrical and electronics applications.
for project pages click here

2. Microcontroller, FPGA, Embedded projects:
This sites offer projects on Microcontroller, FPGA and Embedded related projects and it has forum related to these projects where u can discuss on various topics
Some of the sample projects are
Short Range Personal Radar, FPGA projects

3. Technical blog
This blog discusses various technical articles which are new concepts

Wednesday, March 19, 2008

SMS BASED INDUSTRIAL AUTOMATION USING PERSONAL COMPUTER

SMS BASED INDUSTRIAL AUTOMATION USING PERSONAL COMPUTER
ABSTRACT
The short message system (SMS) of a standard mobile phone can be used for much more than just exchanging cryptic message. This application finds a humble mobile working in a remote site monitoring and controlling external equipments. The SMS service provides by the service providers are comparatively low cost. Hence the system is highly efficient and low cost. It can be implemented for a variety of industrial applications.

In this SMS techniques together with the micro controller technology are used in a wide variety of applications in industry, including computer peripherals, business machines, motion control, and robotics, which are, included in process control and machine tool applications. The automation system is designed by keeping in mind that it should be user friendly and it should be possible to operate it from anywhere in the world. This system is designed in such a way to reduce the wiring complexity and manpower. Thus the system provides an excellent hold as per industrial motion control systems.

Mobile phones have become a widespread means of communication. It becomes a part of everyday life with ever more people enjoying the service and extra freedom they provide. It works on the basis of Global System for Mobile Communication (GSM). A subscriber from any systems can access telecommunication services by using a Subscriber Identify Module (SIM) card in a handset suitable for the network on the visited system The Short Message Service allows text messages to be sent and received to and from mobile telephones. The text can comprise words or numbers or an alphanumeric combination. Because Simple person - to - person messaging is such an important component of total SMS traffic volumes, anything that simplifies message generation as well as extended utility of the SMS being sent is an important enabler of Short Message Service. Such extended utility of SMS fulfills certain important requirements. Keeping this in mind the research work “ SMS BASED INDUSTRIAL AUTOMATION USING PERSONAL COMPUTER " is developed. This system is developed to control the functions of a device from a remote area through the SMS of a mobile phone using personal computer and Micro controller.

The short message service (SMS) of a standard mobile phone can be used for much more than just exchanging cryptic message. This application finds a humble mobile working in a remote site monitoring and controlling external equipment. This system accommodates the SMS techniques together with the micro controller technology that are used in a wide variety of applications in industry via computer peripherals, business machines and robotics that are related to process control and machine tool applications. This Automation system is designed in such a way that it has to be user friendly and it must be possible to operate it from anywhere is the world.
"

EMBEDDED SYSTEMS - AN OVERVIEW

Breathtaking developments in microelectronics, processors speed and memory elements accompanied with dropping prices have resulted in powerful embedded systems with a number of applications.The intelligence of smart devices resides in embedded systems. An embedded system in general incorporates hardware, operating system, low­ level software binding such as, peripheral devices and communication software to enable the device to perform pre-defined functions.

A plethora of processors are variable to cater to different applications. 8 bit, 16 bit and 32 bit processors are available with different processing powers and memory addressing capabilities. Advanced Digital Signal processors (DSPs) cater to AV coding and image processing. Embedded systems are built around processor boards. These processors boards incorporate necessary RAM, ROM and peripheral such as USB port and serial port.

DSP based embedded systems are available for diversifications, with circuitry being specific to the application on hand. Sensors, transducers, relay I/O devices and special circuitry interfaces to the processor board are the various elements in action.

We stand to immensely benefit from modern embedded gadgets armed with powerful processing, adaptable memory, and sophisticated software managing complex information and communication protocols. In the future smart gadgets would connect and initiative action on our behalf.
DESCRIPTION
The short messages such as stepper on, stepper off etc, (at a time only one) are delivered to the Nokia mobile phone, which is kept at the receiving end from the transmitting section using a mobile phone. In the receiver section this mobile is connected to the personal computer through the com port. The master micro controller is connected to the parallel port through the octal buffer and line deriver. The port 0 of the micro controller is connected to the stepper motor driver through the actual buffer and line driver. The stepper motor whose motion to be controlled, is connected to a driver. Another port (i.e.) port 2 of the micro controller is connected to the LED indicators via the octal buffer and line driver. The necessary power required to all the parts are supplied by the suitable power supplies.

Messages such as stepper on, stepper off etc to control the motion of the stepper motor are received by the mobile phone kept in the receiving side and are read by the personal computer for which the software for Nokia PC connectivity is enabled. To control the various motion control operations of the stepper motor from remote place, the Front End Design as well as application is developed using Visual Basic 6.0. The application always monitors the inbox of the mobile and the received SMS is accepted only if the transmitted mobile phone number is available in the database of it. If not, simply it shows the message.
"Received message from unauthorized phone" and message will be deleted. It shows the design and ensures that the system is highly protected and cannot be operated by any unauthorized persons.

When any message with one of the above commands (stepper on, stepper off, etc) received from the authorized mobile phone number the application sends corresponding information to the micro controller through the interfacing device (octal buffer and line driver). The micro controller reads the data and delivers the corresponding information to control the motion of the stepper motor. At the same time the corresponding LED will indicate the status of the motion what is going on. Which indicate the various commands received by the mobile and during the sequence of operations performed.

The maximum speed or minimum is reached when the corresponding command is continuously send to the receiving mobile. During that time, the message “can’t increase the above current speed” “can’t decrease the above current speed” will get displayed in the screen. The system is capable of continuously functioning round the clock.

RESULTS AND DISCUSSIONS

The developed system " SMS BASED INDUSTRIAL AUTOMATION USING PERSONAL COMPUTER " is used to control the functions of a device from a remote area through the SMS of a mobile phone using personal computer and micro controller.

From the transmitting section using a mobile phone, short messages are delivered to the Nokia Mobile Phone. In the receiver section this mobile is connected to the Personal Computer. This in turn is connected to micro controller, which controls the motion of the stepper motor. This system is designed in such a way that it has to be user friendly and it must be possible to operate it from anywhere in the world.

It compensates all the drawbacks of the landline telephone due to the inclusion of enhanced feedback and monitority facility. It acts as a better remote mobile operation. This project can be modified according to the industry requirements. Only an attempt has been made here to control the motions of the stepper motor using this developed system. This could be further more researched, wherein the same application can be utilized to control any other hazardous devices or similar devices in place of the stepper motor.