Real Time Operating System

Similar documents
Real Time Operating System

Lesson 6 Programming Arduino Example 9.7. Chapter-9 L06: "Internet of Things ", Raj Kamal, Publs.: McGraw-Hill Education

Real Time Operating System

RTX-166 Real-Time Multitasking Executive for the 80C166 Microcontroller Family User s Guide 07.96

2008 Chapter-8 L1: "Embedded Systems - Architecture, Programming and Design", Raj Kamal, Publs.: McGraw-Hill, Inc.

RTX-51. Real-Time Multitasking Executive for the 8051 Microcontroller. User s Guide 03.02

CMPE3D02/SMD02 Embedded Systems

Introduction to Real-Time Systems and Multitasking. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff

REAL TIME OPERATING SYSTEM PROGRAMMING-I: VxWorks

Inter-Process Communication and Synchronization of Processes, Threads and Tasks: Lesson-3: Task and Task States

CSE 120 Principles of Computer Operating Systems Fall Quarter, 2001 Midterm Exam. Instructor: Geoffrey M. Voelker

Lesson-3: Counters and Timers

Lecture 3. Introduction to Real-Time kernels. Real-Time Systems

Micrium µc/os II RTOS Introduction EE J. E. Lumpp

Computer Systems II. First Two Major Computer System Evolution Steps

Lesson 5: Software for embedding in System- Part 2

LABORATORY MANUAL EMBEDDED C LABORATORY. M. Tech I Year I Sem R13 DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGG.

Real-time operating systems and scheduling

Exam Concurrent and Real-Time Programming

Multiprocessor and Real- Time Scheduling. Chapter 10


CODE TIME TECHNOLOGIES. Abassi RTOS. Porting Document C28X CCS

Lecture notes Lectures 1 through 5 (up through lecture 5 slide 63) Book Chapters 1-4

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science

CRTOS Library for PIC32

COEN-4720 Embedded Systems Design Lecture 9 Real Time Operating Systems (RTOS) Part 1: Processes/Tasks and Threads

Processes and Multitasking

Int tmytask() { while(1){ .. } }

ARM RTX Real-Time Operating System A Cortex-M Optimized RTOS that Simplifies Embedded Programming

SPACE: SystemC Partitioning of Architectures for Co-design of real-time Embedded systems

Part B Questions. Unit I

Embedded Operating Systems

Chapter 2. Overview of Architecture and Microcontroller-Resources

RT extensions/applications of general-purpose OSs

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING ACADEMIC YEAR / ODD SEMESTER

Real Time Kernel v1.1

embos Real-Time Operating System CPU & Compiler specifics for SH2A core using IAR Embedded Workbench

What s An OS? Cyclic Executive. Interrupts. Advantages Simple implementation Low overhead Very predictable

IT2A4 EMBEDDED SYSTEMS

Lesson 2 Prototyping Embedded Software on Arduino on Arduino boards. Chapter-9 L02: "Internet of Things ", Raj Kamal, Publs.: McGraw-Hill Education

EE680 Project Report Final 05/05/2010 Zhou Zhao USC ID:

ECE 3055: Final Exam

5/11/2012 CMSIS-RTOS. Niall Cooling Feabhas Limited CMSIS. Cortex Microcontroller Software Interface Standard.

Lab 8 Real-time OS - 1

Module 8. Industrial Embedded and Communication Systems. Version 2 EE IIT, Kharagpur 1

February 13, notebook

real-time kernel documentation

Multimedia-Systems. Operating Systems. Prof. Dr.-Ing. Ralf Steinmetz Prof. Dr. rer. nat. Max Mühlhäuser Prof. Dr.-Ing. Wolfgang Effelsberg

Introduction to Real-Time Operating Systems

Lab 3a: Scheduling Tasks with uvision and RTX

Model Based Development of Embedded Control Software

OPERATING SYSTEM SUPPORT (Part 1)

TDDD07 Real-time Systems Lecture 10: Wrapping up & Real-time operating systems

Micrium OS Kernel Labs

Scheduling. Scheduling. Scheduling. Scheduling Criteria. Priorities. Scheduling

CABLE AMPACITY PROGRAM (CYMECAP) STUDY: MANHOLE Prepared by

Subject: Operating System (BTCOC403) Class: S.Y.B.Tech. (Computer Engineering)

Common Computer-System and OS Structures

Real-Time Operating Systems (Working Draft) What is an Operating System (OS)?

Process Description and Control. Chapter 3

7.3 Case Study - FV of a traffic light controller

Design a system that accept data from each independent processor and arbitrate which one is granted access to memory at any one time.

Kinematics Review. Physics 2012

K101: Embedded Linux Basics

CONOPS Concept of Operations. Douglas P. B. Renaux Robson Ribeiro Linhares Jean Marcelo Simão Paulo Cézar Stadzisz

CODE TIME TECHNOLOGIES. Abassi RTOS. Porting Document. ARM Cortex-M3 CCS

Chapter 15 ARM Architecture, Programming and Development Tools

Constructing and Verifying Cyber Physical Systems

CODE TIME TECHNOLOGIES. Abassi RTOS. Porting Document. ATmega128 GCC

6/17/2011. Real-time Operating Systems

Embedded Systems. 5. Operating Systems. Lothar Thiele. Computer Engineering and Networks Laboratory

Chapter 2 Operating System Overview

Interactive Scheduling

Operating Systems Process description and control

Two Level Scheduling. Interactive Scheduling. Our Earlier Example. Round Robin Scheduling. Round Robin Schedule. Round Robin Schedule

ArdOS The Arduino Operating System Reference Guide Contents

Embedded Systems: OS. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Interconnecting Components

DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING EE6602- EMBEDDED SYSTEMS QUESTION BANK UNIT I - INTRODUCTION TO EMBEDDED SYSTEMS PART A

Lab 3b: Scheduling Multithreaded Applications with RTX & uvision

MICROPROCESSOR TECHNOLOGY

Programming with μc/os-ii Operating System on the Ide68k Integrated Development Environment

How to use the imap. Choosing which area of the map to explore

Parallel to NSX Edge Using VXLAN Overlays with Avi Vantage for both North-South and East-West Load Balancing Using Transit-Net

Embedded Systems: OS

REAL-TIME MULTITASKING KERNEL FOR IBM-BASED MICROCOMPUTERS

DO NOT COPY. " Input and output pins

CODE TIME TECHNOLOGIES. Abassi RTOS. Porting Document MSP430 GCC

Back to RTOS. CSE466 Autumn 00-1

Process and Resource Management

Job Scheduling. CS170 Fall 2018

Motivation. Threads. Multithreaded Server Architecture. Thread of execution. Chapter 4

Introduction to the ThreadX Debugger Plugin for the IAR Embedded Workbench C-SPYDebugger

Introduction to Embedded Systems

Midterm Exam. October 20th, Thursday NSC

7.3.3 Same Inputs in Antecedent and Consequent

1- Which of the following tasks is the operating system NOT responsible for? d) Coordinates communication between software applications and the CPU

EE 472 Embedded Systems. Name solutions. Instructions:

G52CON: Concepts of Concurrency

RTOS Debugger for RTX51 tiny

Transcription:

Chapter 11 Real Time Operating System

Lesson 06 Case Study of Traffic Light for use of RTOS 51 in Design

Assumptions When a vehicle coming from north, Left turn (north to west) allowed directly Left-lane driving by the vehicles Two set of traffic lights positioned to control north to south (NS for straight path to south) and north to east (NE for right turn) traffic flows. Each set has one green and one red signal. 3

Assumptions Even numbered 8051 port 1 pins P1.0 and P1.2 controls and is used to permit the traffic flow along NS and NE by sending green signals NSG and NEG. ODD numbered 8051 port 1 pins P1.1 and P1.3 control and prevent the traffic flows along NS and NE and are sent red signals NSR and NER. 4

Multitasking system Task init Task init: First task to initialise the NS-NE traffic light controller system (NTCS) Task initialises a serial interface program serial.c Creates other application tasks and then deleted Deactivated from scheduling by the kernel 5

Multitasking system Tasks 1, 2 Task 1 clock: Controls the time clock Task 2 NSG: Controls the Green ON-OFF along NS using port P1.0 6

Multitasking system Tasks 3, 4 and 5 Task 3 NSR: Controls the RED ON-OFF along NS using port P1.1 Task 4 NEG: Controls the Green ON-OFF along NE using port P1.2 Task 5 NEG: Controls the RED ON-OFF along NE using port P1.3 7

Case Study Example Program for RTOS RTX51functions for system of traffic flows From north to south and north to east using 8051 Each task among 2, 3, 4 and 5 runs for 120000 ms and therefore signal is switched ON for 120000 ms Assume that RTX166 timer programmed for timeout after 40000 ms When ticks = 5 then wait is for 2 m When ticks = 20 then wait is for 8 m 8

Preprocessor Commands #include <rtxt51full.h> # include <rtx166t.h> 9

main function void main ( ) { while (1) {os_start ( ); } } 10

task init creation of other tasks void init (void) _task_ init { serial_init.c; os_create_task (1) /* task 1 ready */ os_create_task (2); /* task 2 ready */ os_create_task (3); /* task 3 ready */ os_create_task (4); /* task 4 ready */ os_create_task (5); /* task 5 ready */ 11

task init priority 0 Traffic Light System task time clock priority 1 Task 2 NSG ON priority 2 Task 3 NSG OFF priority 3 Task 4 NER ON priority 4 Task 5 NER OFF priority 5 12

task init starting task 2 and deleting itself while (1) { os_send_signal (2);/* Send signal to task 2*/ os_delete_task (init); /* task_init deleted and RTOS does not take notice of it for ever*/ } } 13

from system 14

task 2 wait for signal to NS Green ON job2 ( ) _ task_2 {os_wait (K_SIG, 0, 0); /* Wait for signal first from init */ os_send_signal (3); /* Send signal to task 2*/ while (1) { os_wait (K_SIG, 0, 0); /* Wait for signal */} ;/* Code for NS light green ON for 120000 ms ( 5 clock timeouts) and then OFF */ P1^0 = 1; /* NSG ON */ 15

Signal between Two Tasks Task init t1 signals 2 to enable the OS to start waiting task2 t2 Task 2 t2 - t1 = t switch (task switching time) 16

Example of 3 tasks Example - Task 1 and 3 Synchronisation Task 2 Task 3 1 waiting for signal from 2 signals 3 to enable the RTOS to start waiting task3 2 RTOS 3 17

task init priority 0 Traffic Light System Priority Scheduling task time clock priority 1 Task 2 NSG ON priority 2 Task 3 NSG OFF priority 3 Task 4 NER ON priority 4 When high priority task activates, then that preempts the low priority task running. Task 5 NER OFF priority 5 18

task 2 wait for timeout of ON period os_wait (K_TMO, 5, 0); /* wait for 2 m */ P1^0 = 0; /* NSG OFF */ os_send_signal (3); /* Send signal to task 3*/ }; 19

task 3 wait for signal and NS Red ON job3 ( ) _ task_3 { while (1) { /* Code for NS light red ON for 240000 ms (10 clock timeouts) and then OFF */ os_wait (K_SIG, 0, 0); /* Wait for signal from 2 */ P1^1 = 1; /* NSR ON */ 20

task 3 wait for timeout of ON period NS Red os_wait (K_TMO, 20, 0); /* wait for 8 m */ P1^1 =0; /* NSR OFF */ os_send_signal (4); /* Send signal to task 4*/ 11. }; 21

task 4 wait for signal and NE Green job4 ( ) _ task_4 { while (1) { ON /* Code for NE light green ON for 120000 ms (5 clock timeouts) and then OFF */ os_wait (K_SIG, 0, 0); /* Wait for signal from 3 */ P1^2 = 1; /* NEG ON */ 22

task 4 wait for time out of NEG os_wait (K_TMO, 5, 0); /* wait for 2 m */ P1^2 =0; /* NEG OFF */ os_send_signal (5); /* Send signal to task 5*/ }; 23

task 5 wait for signal and NER ON job5 ( ) _ task_5 { while (1) { /* Code for NS light red ON for 240000 ms (10 clock timeouts) and then OFF */ os_wait (K_SIG, 0, 0); /* Wait for signal from 4 */ P1^3 = 1; /* NER ON */ 24

task 5 wait for timeout of NER os_wait (K_TMO, 20, 0); /* wait for 8 m */ P1^3 =0; /* NER OFF */ os_send_signal (2); /* Send signal to task 2*/ }; 25

Summary 26

We learnt Traffic sight system Use of preemptive scheduling Task synchronized using signals Task wait for timeouts 27

End of Lesson 06 on Case Study of Traffic Light for use of RTOS 51 in Design