====== OSA : Speed characteristics ====== Here is an information to determine the time required by OSA to switch from one task to another for different chips under different compilers and priority modes. How to use this table? First you have to find your compiler and your priority mode in table and get the value. Then this value should be multiplied by nomber of active tasks and then multiplied by time per instruction cycle. ^ Compiler ^ PRIORITY_DISABLED ^ PRIORITY_NORMAL ^ PRIORITY_EXTENDED ^ | \\ **PIC10 (PIC12)** ||||| | Hi-tech PICC | 54*N | 84*N | - | | \\ **PIC16 (PIC12)** ||||| | HT-PICC STD | 49*N | 80*N | 123*N | | HT-PICC PRO (PIC1xF1xxx)| 39*N | 64*N | 80*N | | microC PRO | 74*N | 119*N | 224*N | | CCS PICC | 62*N | 107*N | 167*N | | \\ **PIC18** ||||| | HT-PICC18 STD | 45*N | 70*N | 85*N | | MPLAB C18 | 55*N | 96*N | 117*N | | microC PRO | 73*N | 99*N | 187*N | | CCS PICC | 49*N | 88*N | 101*N | | \\ **PIC24 (dsPIC)** ||||| | MPLAB C30 | 60*N | 87*N | 113*N | | \\ **AVR** ||||| | WinAVR | 108*N | 172*N | 190*N | | IAR | 100*N | 148*N | 177*N | | \\ **STM8** ||||| | Cosmic | 35*N | 58*N | 71*N | | IAR | 93*N | 118*N | 238*N | | Raisonance | 61*N | 80*N | 120*N | N - namber of active tasks **An example 1 of determination** Source data: * Microcontroller PIC16F628 * Compiler HT PICC STD * 4 tasks (N = 4) * Extended priority level (##[[en:osa:ref:appendix:configuration|OS_PRIORITY_EXTENDED]]##) * Frequency 20 MHz (time of instruction cycle = 200 ns) The needed value for our compiler, priority mode and compiler is 123*N. The average time of switching between tasks (time from ##[[en:osa:ref:allservices:OS_Yield|OS_Yield]]##() execution in one task to other task get the control) is: t = 123 * 4 * 200ns = 492 * 200ns = **98.4 us** **An example 2 of determination** Source data: * Microcontroller STM8S105C6 * Compiler Cosmic * 8 tasks (N = 8) * Normal priority level (##[[en:osa:ref:appendix:configuration|OS_PRIORITY_NORMAL]]##) * Frequency 16 MHz (time of instruction cycle = 62.5 ns) The needed value for our compiler, priority mode and compiler is 58*N. The average time of switching between tasks is: t = 58 * 8 * 62.5ns = 464 * 62.5ns = ** 29 us**