Skip to main content

Posts

Showing posts from September, 2008

Tasks, Process and Threads

Process Sequential Execution of Instructions Tasks Each task is independent since it is controlled by a scheduler or kernel of an Operating System No task can call other tasks. since the Scheduler schedules the tasks Each task is associated with an ID. Each task has priority. for a 1 byte priority assignment, values 0 to 255 is used. higher the value higher the priority Each task should coded in such a way that, they are waiting for a endless - event waiting loop. Each task has a Task Control Block (TCB) Each task will be having its own context and values at an instant. it is having its own Program counter(PC) and stack pointer (SP. Each task will be in any one of the following 4 states idle - After the completion of one cycle of execution, a task will be in idle state until an event is fired ready - the task is ready to execute on the CPU, but the CPU is busy with executing higher priority tasks Running - currently the task is executing on the CPU - only one task can be in this state

Software Maintenance

There are five types of software maintenance Preventive Maintenance - A system may be checked and maintained periodically Corrective Maintenance - Correct the deviation noticed under certain conditions of field use of the system Perfection or Enhancement Maintenance - development team delivers a system on schedule and then finds another design capable of working more accurately and effectively Adaptive Maintenance - Adapt the software to new conditions System Reengineering - previously developed system is reengineered.

Software Project Management

People People Senior Manager 1. Responsible for creating environment, 2. Organising, coordinating and managing all communications Project Technical Manager or Team Leader 1. Selecting the language and tools 2. reorganize available software specification 3. Maintain activity graph for starting 4. motivates and encourage implementors Implementors 1. Implements the software and hardware development process 2. uses modeling, source code engineering, testing Customer or End User 1. Specifies the product and its quality requirements Product Embedded System product Process 1. Product Development partitioned into smaller components and modules so that activities defined in the graph for activity are finished Project 1. Design 2. Planning 3. Implementing and testing 4. Debugging and Maintaining

Square Wave Generation using Delay

Delay Calculation Crystal frequency = 11.059MHz. 1 machine cycle = 1 / (11.059/12) = 1.085μ s For 1second delay1.085μ s * 921660 = 1 sec (approx) #include < reg51.h> main() { int i,j; P0=0xff; for(i=0;i<=1000;i++) { for(j=0;j<=490;j++); } P0=0x00; for(i=0;i<=1000;i++) { for(j=0;j<=458;j++); } }

Sine Wave Generation

#include reg51.h> at 0x2000 xdata char sinetable[13]; at 0x80 sfr sineout; char dacout; char i; void timer_isr(void) interrupt 1 { TF0=0; dacout = sinetable[i++]; TH0= 0xff; TL0=0xfb; TR0=1; if(i>13) { dacout = sinetable[0]; i=1; } } void main() { sinetable [0] = 128; //0 sinetable [1] =192; //30 sinetable [2] =238; //60 sinetable [3] =255; //90 sinetable [4] =238; sinetable [5] =192; sinetable [6] =128; sinetable [7] =64; sinetable [8] =17; sinetable [9] =0; sinetable [10] =17; sinetable [11] =64; sinetable [12] =128; i=0; IE=0x82; TMOD=0x01; TCON = 0x01; TH0 = 0xff; TL0 = 0xFb; TR0=1; dacout = sinetable [i++]; for (;;); }

Issues in Real Time Software Development

Issues in Requirement Analysis and Design Inter Process Communication Fault Tolerance and Reliability Event Latencies Maximum Latencies of ISRs Maximum response Time Issues in Implementation Selection of OS (RTOS) Selection of Processors, Hardware, Memory and its Size Selection of Programming Language Power Management using wait and sleep mode Caches to be used or not Issues in Testing Testing the Inter Process Communication (IPC) Testing Parallelism and Concurrency Testing Memory and Stack Overflow Testing Software Portability in Hardware Testing Software Hardware Integration Testing the program flow in critical regions for shared data Testing the throughput from the tasks and ISRs

Software Testing, Verifiying and Validating

Verification - to ensure that all the specific functions are correctly implemented Validation - to ensure that the software that has been created is as per the requirments agreed upon at the analysis phase and to ensure its quality Testing White Box Testing (also called as Glass Box) Testing the program flow Testing the conditions testing all the loop indices (start to last) all logical paths testing the function control structures and looping structure Black Box Testing (Behavioral testing) testing in done with set of input conditions and events performance testing Specific Environment Testing Testing GUI and User Interface Client Server Testing Test the display and keypad Testing the help utilities and Documents Comparison Testing Several available versions are running in parallel and the functions and behavior compared Debugging Laboratory tools like Simulator, IDE, etc Program Break Points Macros Output files for Inputs Scopes (CRO, Storage Oscilloscopes, Logic Analyzer,etc)

Software Implementation

Use of language in which the software team has expertise and experience Use an Operating System or RTOS that is more appropriate. (Small scale does not need RTOS, so code size will be reduced much) Simpliciyt to be maintained. Each function should perform a single task and have simple design Comments must be added before control statements Program implementation should be as per design specification. Make function implementation general, not tied to specific input conditions or events. This makes reuse earlier. Redesigning might be needed to solve software implementation difficulties

Software Development Life Cycle (SDLC)

Phases in Software Development Definition and Analysis of System Requirements Clarity of the Specifications Specifications are obtained for Required processing of data Necessary functions & tasks and their expected performance Expected system behavior Design constraints Life cycle of the product Development Software design, coding and testing are the main activities in the development process. Support Software should need little support for software reengineering by changing environment Models for process Life Cycle Linear Sequential Life cycle model Model/ Analyze Design of data structures, software architecture, Interfaces and Algorithms Testing the internal logic and external functions Rapid Development Model (RAD) Each software component of Linear Model developed by a team Stage 1 – Business modeling Stage 2 – Characteristics and attributes of sets of Data Structures and objects, data modeling, software architecture Stage 3 – Description of adding, deleting, modifying and retri

Use of Graphs in Multiprocessor Systems

Each task or function executed in an assigned processor PA, PB – are two processors A and B V1’,V2’,V3’ – three threads of task 1 V1 2 ,V2 2 ,V3 2 – Three threads of task 2  Each task or function is executed on different processors at different periods Instructions of four different tasks partitioned on two processors Instructions of four different tasks partitioned and scheduled on two processors differently at different periods PA, PB – are two processors A and B V1’,V2’,V3’ – three threads of task 1 V1 2 ,V2 2 ,V3 2 – Three threads of task 2  C11,C12 - Instructions for Task 1 C21, C22 - Instructions for Task 2 C31, C32 - Instructions for Task 3