logging in or signing up embedded seminar yenurkarutkarsh Download Post to : URL : Related Presentations : Share Add to Flag Embed Email Send to Blogs and Networks Add to Channel Uploaded from authorPOINT lite Insert YouTube videos in PowerPont slides with aS Desktop Copy embed code: (To copy code, click on the text box) Embed: URL: Thumbnail: WordPress Embed Customize Embed The presentation is successfully added In Your Favorites. Views: 43 Category: Science & Tech.. License: All Rights Reserved Like it (0) Dislike it (0) Added: March 26, 2011 This Presentation is Public Favorites: 0 Presentation Description No description available. Comments Posting comment... Premium member Presentation Transcript Seminar on : Seminar on Multi-taskingIntroduction : Introduction The system has to perform two or more tasks simultaneously called as ……. Multi-tasking For e.g.:- washing machine It has the following tasks such as operation of the wash motor, timers, water level sensing and keypad scanning. “scheduler”- part of RTOSWays of multi-tasking: Ways of multi-tasking There are many ways of multi-tasking:- Round robin Round robin with interrupts Function queue scheduling RTOSRound robin: Round robin void main(void { While(1) { If(device 1 needs service) Perform device1 I/O functions; If(device 2 needs service) Perform device2 I/O functions; If(deivce3 needs service) Perform device3 I/O functions; . . . If( deviceN needs service) Perform deviceN I/O functions; } }Round robin with interrupts: Round robin with interrupts BOOL flag_device1 = false; . . BOOL flag_deviceN = false; Void interrupts ISR_device1(void) { critical code for servicing of device1; Flag_device1 = true; } . . Void interrupts ISR_deviceN(void) { critical code for servicing of deviceN; Flag_deviceN = true; } conti ….. void main(void) { while(1) { if(flag_device1) { Non critical code of servicing device1; } . . If( flag_deviceN ) { Flag_deviceN = false; Non critical code of servicing deviceN; } } }Function queue scheduling: Function queue scheduling queue of function pointers; Void interrupts ISR_device1(void) { Critical code for servicing of device1; Put function1 on queue of functions pointer; } . . Void interrupts ISR_deviceN(void) { Critical code for servicing of deviceN; Put functionN on queue of functions pointer; } conti ….. Void function1(void) { Non critical code of servicing device1; } . . Void functionN (void) { Non critical code of servicing deviceN; } Void main(void) { While(1) { While(function queue is empty); Call the first functn in the queue and update the queue; } }RTOS: RTOS Void interrupts ISR_device1(void) { Critical code for servicing of device1; Set signal1; } . . Void interrupts ISR_deviceN(void) { Critical code for servicing of deviceN; Set signalN ; } conti ……. Void tasks1(void) { While(1) { Wait for signal1; Non critical code of servicing device1; } } . . Void tasksN (void) { While(1) { Wait for signalN ; Non critical code of servicing deviceN; } }Basic RTOS principles related to multi-tasking : Basic RTOS principles related to multi-tasking running ready block Task has the highest Task is initialized and enters the Task no longer has the highest Task is unblocked and the highest priority task Task is block due to the request for an unavailable resource You do not have the permission to view this presentation. In order to view it, please contact the author of the presentation.
embedded seminar yenurkarutkarsh Download Post to : URL : Related Presentations : Share Add to Flag Embed Email Send to Blogs and Networks Add to Channel Uploaded from authorPOINT lite Insert YouTube videos in PowerPont slides with aS Desktop Copy embed code: (To copy code, click on the text box) Embed: URL: Thumbnail: WordPress Embed Customize Embed The presentation is successfully added In Your Favorites. Views: 43 Category: Science & Tech.. License: All Rights Reserved Like it (0) Dislike it (0) Added: March 26, 2011 This Presentation is Public Favorites: 0 Presentation Description No description available. Comments Posting comment... Premium member Presentation Transcript Seminar on : Seminar on Multi-taskingIntroduction : Introduction The system has to perform two or more tasks simultaneously called as ……. Multi-tasking For e.g.:- washing machine It has the following tasks such as operation of the wash motor, timers, water level sensing and keypad scanning. “scheduler”- part of RTOSWays of multi-tasking: Ways of multi-tasking There are many ways of multi-tasking:- Round robin Round robin with interrupts Function queue scheduling RTOSRound robin: Round robin void main(void { While(1) { If(device 1 needs service) Perform device1 I/O functions; If(device 2 needs service) Perform device2 I/O functions; If(deivce3 needs service) Perform device3 I/O functions; . . . If( deviceN needs service) Perform deviceN I/O functions; } }Round robin with interrupts: Round robin with interrupts BOOL flag_device1 = false; . . BOOL flag_deviceN = false; Void interrupts ISR_device1(void) { critical code for servicing of device1; Flag_device1 = true; } . . Void interrupts ISR_deviceN(void) { critical code for servicing of deviceN; Flag_deviceN = true; } conti ….. void main(void) { while(1) { if(flag_device1) { Non critical code of servicing device1; } . . If( flag_deviceN ) { Flag_deviceN = false; Non critical code of servicing deviceN; } } }Function queue scheduling: Function queue scheduling queue of function pointers; Void interrupts ISR_device1(void) { Critical code for servicing of device1; Put function1 on queue of functions pointer; } . . Void interrupts ISR_deviceN(void) { Critical code for servicing of deviceN; Put functionN on queue of functions pointer; } conti ….. Void function1(void) { Non critical code of servicing device1; } . . Void functionN (void) { Non critical code of servicing deviceN; } Void main(void) { While(1) { While(function queue is empty); Call the first functn in the queue and update the queue; } }RTOS: RTOS Void interrupts ISR_device1(void) { Critical code for servicing of device1; Set signal1; } . . Void interrupts ISR_deviceN(void) { Critical code for servicing of deviceN; Set signalN ; } conti ……. Void tasks1(void) { While(1) { Wait for signal1; Non critical code of servicing device1; } } . . Void tasksN (void) { While(1) { Wait for signalN ; Non critical code of servicing deviceN; } }Basic RTOS principles related to multi-tasking : Basic RTOS principles related to multi-tasking running ready block Task has the highest Task is initialized and enters the Task no longer has the highest Task is unblocked and the highest priority task Task is block due to the request for an unavailable resource