Professional Documents
Culture Documents
Casestudyondevelopmentofatypicalembeddedsystems(DealtHere).SoftwarearchitectureforEmbeddedsystems(Dealtin unit2),CAN,I2C
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
OSSERVICES OS SERVICES
Theoperatingsystem'stasks,inthemostgeneralsense,fallinto: 1)ProgramExecution: Loadingtheprogramintomemory,executing&terminatingtheprogram. 2)ErrorDeletion: Identifying&trafficoferrorsdetectedwhileprocessinguserrequesttohardwarelikekeyboarderror,shortageof memoryetc. 3)ResourceAllocation: Managementofavailableresources&allocationofresourcestodifferentusers. 4)Input/outputOperation: Executionofinput/outputrequestinvolvingdevices&files. 5)FileManagementorManipulation: Executingrequestforread,write,renameordeletethedatafileaswellasfilemanagementservices. 6)Accounting : Maintainingaccountsofusesoftheresourcesbydifferentusers&generatingusabletable. a ta g accou ts o uses o t e esou ces by d e e t use s & ge e at g usab e tab e 7)Security : Providingprotectiontoprogram&data&toensuredatasecurity.
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
How?
In order to give the appearance of lots of things happening at the same time, the operating system has to switch between different processes thousands of ti th d f times a second. H ' d Here's how it happens:
A process occupies a certain amount of RAM. It also makes use of registers, stacks and queues within the CPU and operatingsystem memory space. When two processes are multitasking, the operating system allots a certain number of CPU execution cycles to one ProcessControlBlock program. Alloftheinformationneededtokeeptrackofaprocesswhenswitchingis All f h i f i d d k k f h i hi i After that number of cycles, the keptinadatapackagecalledaprocesscontrolblock.Theprocesscontrol operating system makes copies of all blocktypicallycontains: the registers, stacks and queues used by AnIDnumberthatidentifiestheprocess the processes, and notes the point at Pointerstothelocationsintheprogramanditsdatawhereprocessinglast which the process paused in its occurred execution. ti Registercontents Statesofvariousflagsandswitches It then loads all the registers, stacks and Pointerstotheupperandlowerboundsofthememoryrequiredforthe queues used by the second process and process allows it a certain number of CPU Alistoffilesopenedbytheprocess cycles. Thepriorityoftheprocess When those are complete, it makes ThestatusofallI/Odevicesneededbytheprocess copies of all the registers, stacks and queues used by the second program, EmbeddedSystems,ShriramKV,SENSE, and loads the first program. 3/18/2010 5
VIT
How?
Eachprocesshasastatusassociated Thisprocessswappinghappens withoutdirectuserinterference,and withit.Manyprocessesconsumeno eachprocessgetsenoughCPUcycles CPUtimeuntiltheygetsomesortof toaccomplishitstaskinareasonable amountoftime. t f ti input. i Troublecanbeginiftheusertriesto Forexample,aprocessmightbe havetoomanyprocessesfunctioning waitingforakeystrokefromtheuser. atthesametime. Theoperatingsystemitselfrequires ti t it lf i Whileitiswaitingforthekeystroke,it Th Whil i i ii f h k k i someCPUcyclestoperformthe usesnoCPUtime.Whileit'swaiting,it savingandswappingofallthe is"suspended".Whenthekeystroke registers,queuesandstacksofthe applicationprocesses. application processes arrives,theOSchangesitsstatus. arrives the OS changes its status Ifenoughprocessesarestarted,and Whenthestatusoftheprocess iftheoperatingsystemhasn'tbeen carefullydesigned,thesystemcan changes,frompendingtoactive,for begintousethevastmajorityofits g j y example,orfromsuspendedto example or from suspended to availableCPUcyclestoswapbetween running,theinformationintheprocess processesratherthanrunprocesses. Whenthishappens,it'scalled controlblockmustbeusedlikethedata thrashing,anditusuallyrequires inanyotherprogramtodirect in any other program to direct somesortofdirectuserintervention some sort of direct user intervention tostopprocessesandbringorder executionofthetaskswitchingportion backtothesystem. EmbeddedSystems,ShriramKV,SENSE, oftheoperatingsystem. 3/18/2010 6
VIT
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
OSServices OS Services
ResourceManagement: ResourceManagementisbasically
Transforming Creatingnewresourcefromexistingresource. g g Thecreatedresourcecanbeansubstitutefortheexistingresourcebut wouldbemuchmoreeasiertouseit. Multiplexing Creatingtheillusionofseveralresourcesfromonceresource. Scheduling Decidingwhichprogramshouldgeteachresourceandwhentheyshould getit.
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
OSServices
ResourceManagement:
Transformation
Operating systems transform physical resources into virtual resources to avoid Operatingsystemstransformphysicalresourcesintovirtualresourcestoavoid difficultiesassociatedwithPhysicalDevices. Avirtualresourceismuchmoreeasiertouseashardwareinterfaceishidden. Forexample,anoperatingsystemmayprovideavirtualprinterwhichiscapableof printingacharacter.Tousethisvirtualresource,anapplicationonlyneedsto i i h T hi i l li i l d specifythecharactertobeprinted.
Multiplexing
The sharing of physical resources is called multiplexing. Thesharingofphysicalresourcesiscalledmultiplexing. Letstakethesameprinterexample.Assumethatyoursystemhasgotonlyone printer.Ifyouarerunningtwoormoreapplications,operatingsystemshouldmake itappearasifeveryapplicationhasitsownprinter. OS OSmustmakesurethatthecharactersprintedbyonevirtualcomputerisnot t k th t th h t i t db it l t i t mixedwithothers. CanbeAchievedby TimeDivisionMultiplexing.(TimeSharing)
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
VirtualComputer
OSServices
An operating system creates software copies of Anoperatingsystemcreatessoftwarecopiesof processorandmemory. OScreatesmultipleprocesses(simulatedProcessors) outofsingleprocessorandallocatesthemtothe programs.Itisdonebytimesharing. programs. It is done by time sharing. OSCreatesmultipleaddressspace (memoryfora processtorun). ImplementsfilesystemandI/Osystemsothatthe processescaneasilyshareandusethedisks. processes can easily share and use the disks Letsjumpintovirtualcomputerinamuchdetailedway now! ThemostsignificantdifferencebetweentheVirtual Computersfromthephysicalcomputeristhat,there C f h h i l i h h aremanyVirtualComputersbutthereisonlyone physicalcomputer. Theoperatingsystemcreatestheillusionofmany virtualcomputersbytransformingsingle,physical i l b f i i l h i l computer.
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
10
OSServices
Asthecomputerishaving2basicparts, ProcessorandPrimaryMemoryLetslook intothese,howtheyarehandledinVirtual computers. computers Inmostcomputers,it'spossibletoadd memorybeyondtheoriginalcapacity.For example,youmightexpandRAMfrom1to2 gigabytes. Thisworksfine,butcanberelatively Thi k fi b t b l ti l expensive.Italsoignoresafundamentalfact ofcomputing mostoftheinformationthat anapplicationstoresinmemoryisnotbeing usedatanygivenmoment. Aprocessorcanonlyaccessmemoryone A processor can only access memory one locationatatime,sothevastmajorityof RAMisunusedatanymoment.Sincedisk spaceischeapcomparedtoRAM,then movinginformationinRAMtoharddiskcan greatlyexpandRAMspaceatnocost.This greatly expand RAM space at no cost. This techniqueiscalledvirtualmemory management.
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
11
Wh t is RTOS ?? What i
Lets keep the first few lines of this slide in mind and shall now jump into sea of RTOS.
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
12
Contd.,
A RTOS (Real-Time Operating System) ( p g y ) Is an Operating Systems with the necessary features to support a Real-Time System
What is a Real-Time System? A system where correctness depends not only on the correctness of the logical result of the computation, but a also on the result delivery time u d y A system that responds in a timely, predictable way to unpredictable external stimuli arrivals
EmbeddedSystems,ShriramKV,SENSE, VIT
3/18/2010
13
RTOS
Vx Works, Nucleus, Win CE etc., Very less memory requirement. RTOS typically include the just the services needed for the embedded systems. Most RTOS allow y the user to configure it before user links it to an application thereby enabling the user to leave the functions that he thinks are not required. Even 8 to 16 MB is considered to be q luxurious for Embedded systems. RTOS may not provide many features as Desktop OS, But they will at least provide Task C i M T k Creation / Management Scheduling Inter task communication Memory Management Timers etc.,
14
Support
Desktop OS normally has huge set of libraries that can provide the user many fancy and advanced features. E.g., plug and play feature
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
RTOS
First the application will be started and then it starts the RTOS. RTOS do not protect themselves as carefully from your application as desktop does. For example Desktop OS will check if the pointer passed to a function is valid. But RTOS may skip it as they are more performance oriented. If an application is passing a bad pointer into the RTOS, probably the application may crash and will result in restarting the system Designers should take extra care about the response time as they are mostly employed in real time systems.
Protection
Response Time
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
15
Kernel Architecture
Kernel has the following objects: Task Task Scheduler Task S T k Synchronization h i ti Semaphores Mutexes Timers Ti Mail box Message queue
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
17
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
20
Task Transition
1.When a task is created it will be in Dormant state. 2. When it is added to the RTOS for scheduling it will come to ready state normally. If it is high priority task it will go to Running state. i.e., it could begin b i executing straight away. i i h 3. When a task is running and if another high priority task becomes ready, the task that is running currently will b k h i i l ill be pre empted and highest priority task will be scheduled for execution. 4. During h 4 D i the course of execution of a f i f task, it may require a resource or input. In this case if the input/resource is not readily available, the task gets blocked.
3/18/2010 EmbeddedSystems,ShriramKV,SENSE, VIT 21
Other Transitions
1. ReadytoRunning: Foraparticulartask, ifallthehighprioritytasksareblocked, thenthetaskisscheduledforexecution. Itthenchangesthestatefromreadyto It then changes the state from ready to running. BlockedtoReady:Whenahigherpriority taskreleasesasourcerequiredforalow prioritytask,thenthelowerprioritytask cannotbeginitsexecution,thehigh prioritytaskwillcontinueexecution.But thestateoflowprioritytaskwillbe the state of low priority task will be changedfromblockedtoready. BlockedtoRunning:Sometimesahigh prioritytaskcanbeblocked.(waitingfor aresource/input).Whentheresource isavailablethetaskbeginsexecution,pre emptingthelowerprioritytaskthatwas executing. executing
22
2.
3.
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
Task Scheduling
A part of RTOS called Scheduler keeps track of state of each task and decides which one should go to the running state. Unlike UNIX or Windows the scheduler in RTOS are 100% simpleminded about which task should get the processor. They simply look at the priorities you assign to the tasks, and among the tasks that are not in the blocked state, the one with highest priority runs, and rest of them will wait in Ready State. If a high priority task hogs the micro processor for a long time while lower priority tasks are waiting in ready state, the low priority task has to wait.. Scheduler assumes that you knew what you were doing when you set the priorities.
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
23
Task Scheduling
A task will only block because it decides for itself that it has run out of things to do. Other tasks in the system or scheduler cannot decide that it needs to wait for something. So a task has to be in running just b f i before i i bl k d it is blocked. When the task is blocked, it never gets the micro processor. Therefore an i Th f interrupt routine or i some other task in the system must be able to signal whatever the task was waiting for has happened, else the task will be blocked for ever.
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
24
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
25
How does the scheduler know when a task has become blocked or unblocked??
The RTOS provides collection of functions that tasks can call to tell the scheduler what event they want to wait for and to signal that events have happened. h d
What will happen if there are two tasks with same priority??
It depends on the RTOS that you select.. d d th th t l t
Some RTOS will time slice between two such tasks. Some will run one of them and will block other until first task is completed.
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
26
Task Scheduling Contd., Pre-Emptive Pre Emptive and Non-Pre-Emptive Non Pre Emptive RTOS
A Pre-Emptive RTOS will stop the lower priority task as soon as the higher priority task unblocks. A Non Pre-Emptive RTOS will only take the micro processor away from the lower-priority task when that task blocks.
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
27
Merits
Once priorities are set properly, we can be assured that only important things are handled first
De Merits Merits
X It is possible that one or h more of the lower priority p y tasks do not get to execute at all all.
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
28
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
29
Merits
No Need for Complex y analysis of the system. Easy to implement. i l
De Merits
X we cant prioritize .. This method is very rigid.
robin scheduling
This can be used in conjunction with Pre Emptive scheduling, When two tasks have same priority then time slicing can be used.
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
30
RoundRobinScheduling/TimeSlicing Scheduling h d l
Roundrobinschedulingprovides eachtaskanequalshareoftheCPU executiontime. Pureroundrobinschedulingcannot satisfy real time system requirements satisfyrealtimesystemrequirements becauseinrealtimesystems,tasks performworkofvaryingdegreesof importance. Instead,preemptive,prioritybased schedulingcanbeaugmentedwith roundrobinschedulingwhichuses timeslicingtoachieveequal time slicing to achieve equal allocationoftheCPUfortasksofthe samepriority
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
31
Merits
De Merits
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
32
Task Scheduling an example ( (underground tank monitoring g g system) Here we can show how a
difficult system is built with ease with the help of RTOS RTOS.. Here vLevelsTask task takes up lot of computing time figuring out how much gasoline is in the tank. t k But as soon as the user pushes a button, vButtonTask the task unblocks. RTOS will now stop the lower priority task h k vLevelsTask and will move it to ready state, which will enable vButtonTask execution and user will get a response. ll When vButtonTask has finished responding, RTOS will give chance to vLevelsTask for execution.
3/18/2010 EmbeddedSystems,ShriramKV,SENSE, VIT 33
Performancemetricsinscheduling models. d l
AnRTOSshouldquicklyandpredictablyrespondtotheevent. Itshouldhaveminimuminterruptlatencyandmaximumcontextswitching speed. Thethreemajorperformancemetricsare
Ratioofsumofinterruptlatencieswithrespecttosumofexecutiontimes. CPUload Worstcaseexecutiontimewithrespecttomeanexecutiontime. Letthisbeanassignmentforyouguys!
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
34
Process detailedlook
Aprogramissetofmachineinstructionsanddatastoredinanexecutable image(a.out)onthegivenpath. image (a. out) on the given path. Aprocessisprograminexecutionwhichisusedtoperformtasksinasystem andstateiscontrolledbyOS. I.e.,itcanberunning,blockedetc., , g, , Eachprocesshasauniqueaddressspaceandoneprocesscannotaccess addressspaceofanotherprocessuntilitisshared. Communicationbetweenprocessesaredonebyinterprocesscommunication mechanisms. Aprocesswillneedmanyresourcelikememoryspace,CPUusage,filesetc., duringitslifetime. Kernelshouldkeeptrackoftheprocessesandusageofthesystemresources. Kernel(OS)shoulddistributeresourcesamongtheprocessesfairly
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
35
Process detailedlook
MostimportantresourceisCPUandinmultiprocessingenvironment,toattainanideal p p g , performanceofasystem,theCPUutilizationshouldbemaximum. LetstakeLINUXasanexampleandletstalk! InLinuxthetaskscanbeinfollowingstates: Task_Running TheprocessmayberunninginUSERmodeorKERNELmode(less/highprivileged modes)EveniftheprocessisinRUNqueue,waitingtoRUN,itwillbeinthisstate Task_Interruptable Theprocessisinsleepstate.Theprocessiswaitingforsomeeventtooccur.Thisprocess canbewokenupprematurelybyasignalsincetheprocessallowssignaltointerrupt. Task_Uninterruptable. Sameasbeforebutwillnotallowinterruption.Thesleepmodewillbeoveronlyifafter thewaitingeventhasoccurred. Task_Stopped Whenaprocessreceivesanyofthefollowingsignalsitwillenterthisstate,SIGSTOP, SIGTTINetc., Task_Zombie I ill b Itwillbeazombie,Completesitsexecutionandwaitforparenttogiveexitstatus. bi C l i i d i f i i (Thiswouldthrowsomelightonwhatallcouldbethestatesthataprocesscanresidein)
EmbeddedSystems,ShriramKV,SENSE, VIT
3/18/2010
36
Process DetailedLook
Thekernelkeepstrackofaprocessscreationtimeaswell astheCPUtimethatitconsumesduringthelifetime. E h l k ti k th k Eachclocktick,thekernelupdatestheamountoftime l d t th t f ti thatthecurrentprocesshasspentinsystem.
AclocktickunitiscalledJiffy!
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
38
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
39
ProcessControlBlock
PCBisadatastructurehavingtheinformationtheinformation usingwhichtheOScontrolstheprocessstates. g p PCBgetsstoredinprotectedmemoryaddressesatkernel. ThePCBwillhavefollowinginformation
Processid(pid) Processpriority ParentProcess ChildProcess AddresstothenextprocessPCB,whichwillrunnext. AllocatedprogrammemoryblockdetailsinPhysicalMemoryandVirtual Allocated program memory block details in Physical Memory and Virtual Memory Allocatedheapmemorydetails. Allocatedprocessstackaddressesforthefunctionscalledduringrunning ll d k dd f h f i ll d d i i oftheprocess.
EmbeddedSystems,ShriramKV,SENSE, VIT 40
3/18/2010
ProcessControlBlock
ThePCBwillhavefollowing information
AllocatedaddressesoftheCPU registersavememory(Context g y( Switch) Processstatesignalmask(when maskissetto0,theprocessis allowedtorun,andwhenmaskisset to1,theprocessissettorun) Signals Securityandaccesspermissions FileDescriptors
Eachprocesshasitsownfile descriptortable. descriptor table Validdescriptorrangesfrom0and maximumnumberisconfigurable. StandardInput 0,StandardOutput 1andStandardError2willbe presentinFDtable.
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
41
ProcessControlBlock
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
42
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
44
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
45
Task Synchronization
In all trivial systems tasks need to interact with each others We can explain this with a simple road example.
When the tasks are independent they do not share any
resources between them, of course CPU is an exception. p This can be compared with two roads that run parallel and so they do not meet.
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
46
Task Synchronization
Vehicles V hi l can move i this sort of in hi f road without collision. But the case becomes different when we h h have i intersecting roads. i d In this case we need to use a separate explicit mechanism like traffic signal to make sure that vehicles do not get into mess. The situation is different because there is a shared region between the roads. So traffic on both sides of the road needs explicit synchronization. Signal is required only at the point of intersection..
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
47
Task Synchronization
Task synchronization can be achieved in two ways y y
Task Synchronization using Mutexes. Task Synchronization using Semaphores.
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
48
Semaphores
Asemaphoreislikeakeythatallowsatask tocarryoutsomeoperationortoaccessa to carry out some operation or to access a resource. Ifthetaskcanacquirethesemaphore,itcan carryouttheintendedoperationoraccess theresource. Asinglesemaphorecanbeacquiredafinite A single semaphore can be acquired a finite numberoftimes.Inthissense,acquiringa semaphoreislikeacquiringtheduplicateofa keyfromanapartmentmanagerwhenthe apartmentmanagerrunsoutofduplicates, themanagercangiveoutnomorekeys. g g y Likewise,whenasemaphoreslimitis reached,itcannolongerbeacquireduntil someonegivesakeybackorreleasesthe semaphore. Thekerneltracksthenumberoftimesa semaphorehasbeenacquiredorreleasedby maintainingatokencount,whichis initializedtoavaluewhenthesemaphoreis created. q p , Asataskacquiresthesemaphore,thetoken countisdecremented;asataskreleasesthe semaphore,thecountisincremented.
EmbeddedSystems,ShriramKV,SENSE, VIT 49
3/18/2010
Semaphores
Ifthetokencountreaches0,thesemaphore hasnotokensleft.Arequestingtask, has no tokens left. A requesting task, therefore,cannotacquirethesemaphore, andthetaskblocksifitchoosestowaitfor thesemaphoretobecomeavailable. Thetaskwaitinglisttracksalltasksblocked whilewaitingonanunavailablesemaphore. g p Theseblockedtasksarekeptinthetask waitinglistineitherfirstin/firstout(FIFO) orderorhighestpriorityfirstorder. Whenanunavailablesemaphorebecomes available,thekernelallowsthefirsttaskin thetaskwaitinglisttoacquireit. Thekernelmovesthisunblockedtaskeither totherunningstate,ifitisthehighest prioritytask,ortothereadystate,untilit becomesthehighestprioritytaskandisable torun.Notethattheexactimplementation ofataskwaitinglistcanvaryfromonekernel toanother. Akernelcansupportmanydifferenttypesof semaphores,includingbinary,counting,and mutualexclusion(Mutex)semaphores. l l i (M ) h
EmbeddedSystems,ShriramKV,SENSE, VIT 50
3/18/2010
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
51
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
52
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
53
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
54
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
55
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
56
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
57
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
58
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
60
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
61
Interprocesscommunications
Introduction:
Inamultiprocessingenvironment,oftenmanyprocessesarein needtocommunicatewitheachotherandsharesomeresources. dt i t ith h th d h IPCmechanismshavemanydistinctpurposes,forexample
DataTransfer SharingData EventNotification ResourceSharing Resource Sharing Processcontrol.
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
62
Interprocesscommunications p
Therearelotmanymechanismsusedforinterprocess communication! communication! Theyare
Signals Semaphores(Discussedearlier) Queues Mailboxes Pipes
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
63
Interprocesscommunications Signals
Signalsarethefundamentalmethodofinterprocess communicationandareusedineverythingfromnetwork communication and are used in everything from network serverstomediaplayers. Asignalisgeneratedwhen
Aneventoccurs(timerexpires,alarmetc.,) Auserquotaisexceeded(filesizeexceedinginstance) AnI/Odeviceisready Encounteringanillegalinstruction. AterminalinterruptlikeCTRL+CandCTRL+Z Someotherprocesssendsasignal Kill9PID EverysignalstartswithnameSIGandisdefinedasapositive integernumber.(SIGKILL 9,SIGINT 2) $killl inshellpromptwillgivethelistofavailablesignalsinUNIX orLINUX.
EmbeddedSystems,ShriramKV,SENSE, VIT 64
3/18/2010
Interprocesscommunications Signals
Whenaprocessreceivesasignalonlythreethingscouldhappen
First,theprocesscouldignorethesignal. Second,theprocesscouldcatchthesignalandexecuteaspecialfunction calledsignalhandler(similartoISR.Thehandlerrunsinasimilarwayto thehighestpriorityISR) the highest priority ISR) Thirditcouldexecutethedefaultactionforthesignal.Forexamplethe defaultactionforsignal15,SIGTERMistoterminatetheprocess. Some signals cannot be ignored SIGKILL and SIGSTOP are the two signals Somesignalscannotbeignored,SIGKILLandSIGSTOParethetwosignals whichcannotbecaughtorignored.
$kill9PID ThiswillkillprocesswithpidPID.
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
65
Interprocesscommunications Signals
ASignalhandlerisnotdirectlycalledbyacode.Whenthe signalissentfromaprocess,OSinterruptstheprocess signal is sent from a process OS interrupts the process executionandcallsthefunctionforsignalhandling.Onreturn fromthesignalhandler,theprocesscontinuesasbefore. A signal is unlike semaphore The semaphore has to use a Asignalisunlikesemaphore.Thesemaphorehastousea token,tolockaresourcetoaparticulartaskforagiven sectionofcodes. Asignalisjustaninterruptthatissharedandusedby l h h d d db anotherinterruptservicingprocess. p Anotherimportantareatobeknownistoknowabout Exceptions. Asignalreportsanerrorduringrunningofataskandletsthe schedulerinitiateanerrorhandlingprocessorfunctionor scheduler initiate an error handling process or function or task.
3/18/2010 EmbeddedSystems,ShriramKV,SENSE, VIT 66
It is something very similar to our postal mail box. Someone posts a message in your mail box and you can read it. Likewise a task can h k k have mailbox, in which other lb h h h tasks can post a mail.
Interprocesscommunications Mailbox lb
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
67
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
68
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
69
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
72
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
74
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
75
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
76
InterprocesscommunicationsMessage Queue
key=ftok(.,a); IfwewishtocommunicatebetweendifferentprocessesusinganIPCresource, thefirststepiftocreateanuniqueidentifier.i.e.,akey! Ftok Filetokey! 2. msqid=msgget(key,IPC_CREAT|0666); Msqidisadatastructuredescribingoperationpermission,timeoflastmsgsnd command,timeoflastmsgrcv,currentnumberofbytesinqueueetc., d i fl b fb i Msgget firstargumentiskey.Tocreateanewmessagequeue,IPC_CREATis ORedwithaccesspermissions. 3.msgsnd(msqid,&struct,sizeof(struct),0); msgsnd(msqid,&struct,sizeof(struct),0); Th fi t ThefirstargumentisthemessageQIDandsecondargumentisaddressofthe t i th QID d d t i dd f th structure. Sob4callingthemsgsndfunction,weneedtofillthestructure.. Thirdargumentissizeofthemessage!(i.e.,sizeofthestructure) Finally the flag value i e 0 or IPC NOWAIT Finallytheflagvalue,i.e.,0orIPC_NOWAIT
Whenthereisnomorespaceavailableformessages,theprocesscanspecifythatitcanwait tillmorespaceisavailableforitsmessageorreturnswithanerrorwithoutwaiting!
1.
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
77
InterprocesscommunicationsMessage Queue
4. msgrcv(msqid,&struct,sizeof(struct),mtype,0); msgrcv(msqid,&struct,sizeof(struct),mtype,0); Where 0 retrieveinFIFOorder +ve Retrievetheexactvalueofthemessagetype. ve firstmessage Onsuccessitwillreturnthenumberofbytescopiedintomessagetext. 5. msgctl(msqid,IPC_RMID,NULL); Ifwewanttoknowthestatusofthemessagequeueorifweliketo modifyanyparameters,wecanuse msgctl(msqid,IPC_RMID,NULL); msgctl (msqid IPC RMID NULL); Where IPC_STAT Willletyouknowthestatus IPC_SET Willhelpyoutosetormodify _ py y IPC_RMID willhelpyoutoremoveamessagequeue. 6.$ipcrm qmsqid 6.$ipcrm Fordeletingthequeuecreatedissue$ipcrm qmsgid
EmbeddedSystems,ShriramKV,SENSE, VIT
3/18/2010
78
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
79
QueueUsage noninterlocked,onewaydatacommunication i t l k d d t i ti
Oneofthesimplestscenariosfor messagebasedcommunications message based communications requiresasendingtask(also calledthemessagesource),a messagequeue,andareceiving task(alsocalledamessagesink) task (also called a message sink) Thistypeofcommunicationis alsocallednoninterlocked(or looselycoupled),onewaydata communication. TheactivitiesoftSourceTaskand tSinkTaskarenotsynchronized. py TSourceTasksimplysendsa message;itdoesnotrequire acknowledgementfrom tSinkTask.
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
80
QueueUsage interlocked,onewaydatacommunication i t l k d d t i ti
Insomedesigns,asendingtaskmight requireahandshake(acknowledgement) require a handshake (acknowledgement) thatthereceivingtaskhasbeensuccessfulin receivingthemessage. Thisprocessiscalledinterlocked communication,inwhichthesendingtask sendsamessageandwaitstoseeifthe g messageisreceived. Thisrequirementcanbeusefulforreliable communicationsortasksynchronization. Forexample,ifthemessageforsomereason isnotreceivedcorrectly,thesendingtaskcan is not received correctly, the sending task can resendit. Usinginterlockedcommunicationcanclose asynchronizationloop.Todoso,youcan constructacontinuousloopinwhichsending g p p andreceivingtasksoperateinlockstepwith eachother.
Inthiscase,tSourceTaskandtSinkTaskuse abinarysemaphoreinitiallysetto0anda bi h i i i ll 0 d messagequeuewithalengthof1(also calledamailbox).tSourceTasksendsthe messagetothemessagequeueandblocks onthebinarysemaphore.tSinkTask th bi h tSi kT k receivesthemessageandincrementsthe binarysemaphore.Thesemaphorethat hasjustbeenmadeavailablewakesup tSourceTask.tSourceTask,whichexecutes tS T k tS T k hi h t andpostsanothermessageintothe messagequeue,blockingagainafterward onthebinarysemaphore.
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
81
QueueUsage Interlocked,TwoWayDataCommunication
Sometimesdatamustflowbi directionallybetweentasks, whichiscalledinterlocked, twowaydatacommunication t d t i ti (alsocalledfullduplexor tightlycoupled communication). ) Thisformofcommunication canbeusefulwhendesigning aclient/serverbasedsystem. Notethattwoseparate messagequeuesarerequired forfullduplexcommunication. Ifanykindofdataneedstobe If any kind of data needs to be exchanged,messagequeues arerequired;otherwise,a simplesemaphorecanbeused tosynchronize t h i acknowledgement.
3/18/2010 EmbeddedSystems,ShriramKV,SENSE, VIT 82
QueueUsage BroadcastCommunication
Some messagequeue Somemessagequeue implementationsallow developerstobroadcast p acopyofthesame messagetomultiple tasks. Messagebroadcastingis aonetomanytask k relationship. tBroadcastTasksends tBroadcastTask sends themessageonwhich multipletSinkTaskare p waiting.
3/18/2010 EmbeddedSystems,ShriramKV,SENSE, VIT 83
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
84
Interprocesscommunications Pipes
Theclientserverexamplecanverywellillustratetheapplicationof pipes. TheclientreadsafilenamefromtheSTDINandwritesintothepipe. TheserverreadsthisfilefromthePIPEandopensthefileforreading. Iftheopenissuccessful,theserverrespondsbyreadingthefileand writingintothepipe,otherwiseanerrormessagewouldbe writing into the pipe otherwise an error message would be generated. Theclientthenreadsfromthepipe,writingwhatitreceivestothe STDOUT. STDOUT.
STDIN PathName
Client
STDOUT Filecontent orerror message
3/18/2010 EmbeddedSystems,ShriramKV,SENSE, VIT
Server
FILE
85
Interprocesscommunications Pipes
Pipesarekernelobjectsthat provideunstructureddata provide unstructured data exchangeandfacilitate synchronizationamongtasks. Inatraditionalimplementation, apipeisaunidirectionaldata d ld exchangefacility. Twodescriptors,oneforeachend pp ( g ofthepipe(oneendforreading andoneforwriting),arereturned whenthepipeiscreated. Dataiswrittenviaonedescriptor andreadviatheother.Thedata and read via the other The data remainsinthepipeasan unstructuredbytestream.Datais readfromthepipeinFIFOorder.
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
86
Interprocesscommunications Pipes
Apipeprovidesasimple dataflowfacilitysothatthe d fl f l h h readerbecomesblocked whenthepipeisempty,and thewriterbecomesblocked the writer becomes blocked whenthepipeisfull. Typically,apipeisusedto exchangedatabetweena exchange data between a dataproducingtaskanda dataconsumingtask. It is also permissible to Itisalsopermissibleto haveseveralwritersforthe pipewithmultiplereaders onit.
3/18/2010 EmbeddedSystems,ShriramKV,SENSE, VIT 87
Interprocesscommunications Pipes
Un namedPipeorPipe: p p
Oncommandlineformatpipeisrepresentedby| ItcanbeusedinShelltolinktwoormorecommands.
Ls lrt | grep file c Ls lrt|grepfile.c
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
88
Interprocesscommunications Pipes
LetstakeUnixsystemprogrammingasreference! ThePipefunctionisdeclaredinunistd.h p Whenaprocesscallsread()fromthepipe,theread()returnswith dataimmediately,ifthepipeisnotempty. Ifthepipeisemptythereadcallisblockeduntilsomeonewritestoit. If the pipe is empty the read call is blocked until someone writes to it Ifnoprocesshaspipeopenforwritingthentheread()returns0. Ontheotherhandifaprocesscallwritestoapipeandnoother processhasopeneditforreadingthenitwillreturnEPIPEERROR. process has opened it for reading then it will return EPIPE ERROR
Thisisfamousbrokenpipemessage! TheblockingnatureofRead()andWrite()effectivelysynchronizesthe processes.
Write
Read
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
89
newfunctionbegins,loadingthat addressintoPCandthenexecuting thecalledfunctionsinstructionwill CurrentProgramContext g changearunningfunctionatCPUto another.(newfunctionwillbe PC(ProgramCounter) executed,bykeepingapagemarkfor thefunctionfromwherethenew the function from where the new functioniscalled) SP(StackPointer) Beforeexecutingnewinstructionsof thenewfunctiontheprocessororOS alsosavesthecurrentprograms CPUregisters statusword,registersandprogram contexts. If not done by OS or Processor then IfnotdonebyOSorProcessor,then ProcessorStatusRegister thenewfunctions,instructionshould dothat. CurrentProgram (p g Thisisbecausethese(programs Context C statusword,registers)information mightbeneededbynewlycalled EmbeddedSystems,ShriramKV,SENSE, 3/18/2010 function. VIT
91
Thecontextmustsaveifafunction programorroutineleftearlierhastorun ti l ft li h t againfromthestatewhichwasleft. Whenthereisacalltoafunction(i.e. routineinassemblylanguage)the functionorISRorexceptionhandling function or ISR or exception handling functionexecutes3mainsteps:
SavingallCPUregistersincludingprocessor statusword,registersandfunctionscurrent addressfornextinstructioninPC.Saving q addressofthePContothestackisrequired ifthereisnolinkregistertopointtothePC ofleftinstructionoftheearlierfunction. Savingfacilitatesthereturnfromnew functiontothepreviousfunction. Loadnewcontexttoswitchtoanew function. function Executethenewfunction. Thesethreestepsaretogethercalledas contextswitching.
Context Switching
SavecurrentfunctionorISRcontext onastackandloadnewfunction
3/18/2010
92
Current routine
Stepsonswitchingfornewroutine
ContextSwitching
1.Savecurrentroutinecontextonstackandloadnew routinecontext.
2.Executethenewroutinecodes
3.Onreturnsavethenewroutinecontextandswitchfor thepreviousroutinebyretrievingthesavedcontext
ContextSwitching
3/18/2010
Contextandperiodsforcontext p switching
EmbeddedSystems,ShriramKV,SENSE, VIT
93
P D2
D3
EmbeddedSystems,ShriramKV,SENSE, VIT
3/18/2010
94
Whiletheprogramisrunning{ 1. Poll Device D1 for input PollDeviceD1forinput 2. Iftheinputispresent,processinputfromD1 3. PollDeviceD2forinput 4. Iftheinputispresent,processinputfromD2 5. PollDeviceD3forinput 6. Iftheinputispresent,processinputfromD3 6 If th i ti t i tf D3 }
Algorithmforthreepolleddevices
Thiskeepsthemicroprocessoralwaysbusy.Itiseitherpollingfortheinput oritwillbe p p y y p g p processingtheinput.ThismethodhasmoreCONSthanPROSwithonedefinitedrawbackof makingthemicroprocessortoworkforever. Theothermechanismisinterrupting.Inthismechanismthedeviceinforms,i.e.,interruptsthe p p p microprocessorwheneverithassomeinputforthemicroprocessor. Theclearadvantageofthismethodoverthepollingmethodthattheprocessorisfreetodo otherwork.(Runningotherapplications )
3/18/2010 EmbeddedSystems,ShriramKV,SENSE, VIT 95
Interrupt Types
PeriodicInterrupts:ifthe interruptsoccuratfixedintervals interrupts occur at fixed intervals oftimeline,thentheyarecalled periodic
INTERRUPTS
HARDWARE
SOFTWARE
Exception
EmbeddedSystems,ShriramKV,SENSE, VIT
Theanswerforthisquestiondependsonnumerousfactors: Theperiodoftimeittakestoexecuteanyinterruptroutinesforinterruptthat areofhigherprioritythanoneinquestion!! are of higher priority than one in question!! Howlongittakesforthemicroprocessortostopwhatitisdoing,donecessary bookkeeping,andstartexecutinginstructionswithintheinterruptroutine! How long it takes to store the context ??? Howlongittakestostorethecontext???
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
97
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
98
3/18/2010
Supposethatyouarewritingasystemthatcontrolsafactoryandthatevery secondyoursystemgetsmanyinterrupts(almostsayadozen)towhichit second your system gets many interrupts (almost say a dozen) to which it mustrespondpromptlytokeepthefactoryrunningsmoothly. Ifthatyoursystemmonitorsadetectorthatchecksforgasleaks,andyour systemmustcallfiredepartmentandshutdowntheaffectedpartofthe system must call fire department and shut down the affected part of the factoryifgasleakageisdetected. Nowitisverylikelythattheinterruptroutinethathandlesthegasleakage needstoberelativelyhighpriority,sinceitwouldbebadideaforother needs to be relatively high priority, since it would be bad idea for other interruptstogetmicroprocessorsattention. Howeverthesystemneedstocontinueoperatingtheunaffectedpartofthe factory,sothegasleakinterruptroutinemustnottakeuptoomuchtime.If acto y, so t e gas ea te upt out e ust ot ta e up too uc t e callingthefiredepartment aprocessthatwilltakeseveralseconds,at leastincludedinthegasleakinterruptroutine,thendozensofother interruptswillpileupwhilethisisgoingon,anrestofthefactorymaynot runproperly.Thereforethetelephonecallshouldnotbeapartofinterrupt routine. EmbeddedSystems,ShriramKV,SENSE,
VIT 99
EmbeddedSystems,ShriramKV,SENSE,VIT
Interruptlatency t only where t is the context Interrupt latency =t onlywheret isthecontext switchingtimeforsavingtherunningprogramcontext andloadingthenewroutinecontext
3/18/2010
100
EmbeddedSystems,ShriramKV,SENSE,VIT
CASE:2 Wheninterruptservicedoesnotstartimmediatelybutcontext switchingstartsafteralltheISRscorrespondingtothehigherpriority interruptscompletetheexecution. interrupts complete the execution ifthesumoftimeintervalsforcompletinghigherpriorityISRsequals thentheinterruptlatencyequalsT Texec,thentheinterruptlatencyequalsTswitch+Texec.
Assumethatthisisa CurrentISRofhigher priority
Processor ISR
3/18/2010
101
CASE:3 Wedisabletheinterruptsystemwhenaroutineentersacriticalsection andenabletheinterruptswhenroutineexitsthecriticalsection. AroutineoffunctionorISRmayconsistsofcodesforcriticalregion instructionsandbeforethecriticalsectioncodesalltheinterruptsare disabledandenabledbytheendofcriticalsection. Letssay Tdisable istheperiodforwhicharoutineisdisabledinitscritical section. Theinterruptservicelatencyfromtheroutinewiththeinterrupt disablinginstructionwillbe
ISR Critical Section S i Codes
EmbeddedSystems,ShriramKV,SENSE,VIT
Tswitch+Texec+ Tdisable .
ISR
Interruptlatency=Tswitch+ Texec+Tdisable.Where Tswitchiscontextswitching time.Tdisableistimeforwhich time Tdisableistimeforwhich theinterruptsremaindisabled. Texecisthetimeforwhich otherhighpriorityroutinesare executed
102
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
103
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
104
I2C (I Square C)
I2C is a Serial bus used for interconnecting ICs. It is commonly used to link Mu-Cs to systems. Mu Cs systems I2C is an acronym for Inter-IC bus Developed in the early 1980's by Philips semiconductors to provide an easy way to connect a CPU to peripheral chips in a TV set TV-set.
Ex: being used in MPEG-2 video chip.
EmbeddedSystems,ShriramKV,SENSE, VIT
105
I2C (I Square C)
Designed to be: 1.low cost 2.easy to implement 3.moderate 3 moderate speed ( up to 400 kb/sec) . it uses only two lines: serial Data line ( SDL) F d t i l D t li For data serial clock line (SCL) indicates when valid data are on the line
EmbeddedSystems,ShriramKV,SENSE, VIT
106
I2C (I Square C)
2 wire protocol SDA, SCL. Master-Slave configuration. Multi master protocol
EmbeddedSystems,ShriramKV,SENSE, VIT
107
I2C (I Square C)
From the figure Every node in the network is connected to both SCL and SDL. Some nodes would be able to act as Masters and some as Slaves. There can be more than one master and I2C is a multi master bus. The slaves will be responding only to the queries from the master.
EmbeddedSystems,ShriramKV,SENSE, VIT
108
EmbeddedSystems,ShriramKV,SENSE, VIT
109
I2C (I Square C)
Open collector / drain signaling allows several devices to write p g g the bus without causing electrical damage. The I2C bus is a multi master bus. Any one of several devices may act as a master at various times. So, there is no global master to generate clock signal on SCL. Instead a master drives both SDL and SCL when it is sending data. When the bus is IDLE both SCL and SDL remains high
EmbeddedSystems,ShriramKV,SENSE, VIT
110
I2C (I Square C)
When two devices try to drive either SCL or SDL to different values, the open collector / drain circuitry prevents errors , but each master device must listen to the bus while transmitting to be sure that it is not interfering with another message if a device receives different value than it is trying to transmit, then is an interference.
EmbeddedSystems,ShriramKV,SENSE, VIT
111
EmbeddedSystems,ShriramKV,SENSE, VIT
113
EmbeddedSystems,ShriramKV,SENSE, VIT
114
EmbeddedSystems,ShriramKV,SENSE, VIT
115
The bus uses this feature to arbitrate on each message . When sending the devices listen to the bus as well.. If a device is trying to send a logic 1 , but hears a logic 0 it immediately stops transmissionand gives other sender priority. In many cases arbitration will be completed during address portion of data transfer.. But may continue into data portion in some cases. If two de ces try to t e identical data to sa e add ess, t e t o devices t y the de t ca same address, then of course they never interfere and they both will succeed.
EmbeddedSystems,ShriramKV,SENSE, VIT
116
Summary I2C
I2C is Inter IC Connectivity Protocol Synchronous 2 wire protocol Very useful for cost effective interconnect of slow peripheral ICs to the MCU Most cost effective for serial EEPROM for boot code onto the MCU RAM or for configuration Data Many MCUs and SOCs support I2C on Chip. y pp p Ex. MSP430 I2C SW Drivers are relatively simple to write for simple operations like EEPROM loads and LCD Displays. Displays But not so for generic data exchange
EmbeddedSystems,ShriramKV,SENSE, VIT
117
EmbeddedSystems,ShriramKV,SENSE, VIT
119
EmbeddedSystems,ShriramKV,SENSE, VIT
121
CarrierSenseMultipleAccesswith p CollisionDetection(CSMA/CD)
The CAN communication protocol is a CSMA/CD protocol The CSMA stands protocol. for Carrier Sense Multiple Access. What this means is that every node on the network must monitor the bus for a period of no activity before trying to send a message on the bus (Carrier Sense). Also, once this period of no activity occurs, every node on the bus has an equal opportunity to transmit a message (Multiple Access). The CD stands for Collision Detection. If two nodes on the network start transmitting at the same time, the nodes will detect the collision and take the appropriate action. In CAN protocol, a nondestructive bitwise arbitration method is utilized. This means that messages remain intact (unbroken) after arbitration is completed even if collisions are detected. All of this arbitration takes place without corruption or delay of the higher priority message. g g
EmbeddedSystems,ShriramKV,SENSE, VIT 122
CarrierSenseMultipleAccesswith p CollisionDetection(CSMA/CD)
Thereareacoupleofthingsthatarerequired tosupportnondestructivebitwisearbitration. First,logicstatesneedtobedefinedas First logicstatesneedtobedefinedas dominantorrecessive. Second thetransmittingnodemustmonitor Second,thetransmittingnodemustmonitor thestateofthebustoseeifthelogicstateitis tryingtosendactuallyappearsonthebus.CAN tryingtosendactuallyappearsonthebus CAN definesalogicbit0asadominantbitanda g logicbit1asarecessivebit.
EmbeddedSystems,ShriramKV,SENSE, VIT 123
CarrierSenseMultipleAccesswith p CollisionDetection(CSMA/CD)
Adominantbitstatewillalwayswinarbitrationoverarecessivebit state,thereforethelowerthevalueintheMessageIdentifier(the fieldusedinthemessagearbitrationprocess),thehigherthepriority ofthemessage.Asanexample,supposetwonodesaretryingto transmitamessageatthesametime. Eachnodewillmonitorthebustomakesurethebitthatitistryingto sendactuallyappearsonthebus.Thelowerprioritymessagewillat d ll h b Th l i i ill somepointtrytosendarecessivebitandthemonitoredstateonthe buswillbeadominant. Atthatpointthisnodelosesarbitrationandimmediatelystops transmitting. Thehigherprioritymessagewillcontinueuntilcompletionandthe nodethatlostarbitrationwillwaitforthenextperiodofnoactivity p y onthebusandtrytotransmititsmessageagain
EmbeddedSystems,ShriramKV,SENSE, VIT 124
CAN MessageBasedCommunication
CANprotocolisamessagebasedprotocol,notanaddress basedprotocol. Thismeansthatmessagesarenottransmittedfromone f nodetoanothernodebasedonaddresses.Embeddedinthe CANmessageitselfisthepriorityandthecontentsofthe databeingtransmitted. d t b i gt itt d Allnodesinthesystemreceiveeverymessagetransmitted onthebus(andwillacknowledgeifthemessagewas properlyreceived). l i d) Itisuptoeachnodeinthesystemtodecidewhetherthe messagereceivedshouldbeimmediatelydiscardedorkept tobeprocessed. t b d Asinglemessagecanbedestinedforoneparticularnodeto receive,ormanynodesbasedonthewaythenetworkand systemaredesigned. t d i d
EmbeddedSystems,ShriramKV,SENSE, VIT 125
EmbeddedSystems,ShriramKV,SENSE, VIT
127
EmbeddedSystems,ShriramKV,SENSE, VIT
129
EmbeddedSystems,ShriramKV,SENSE, VIT
130
EmbeddedSystems,ShriramKV,SENSE, VIT
131
3/18/2010
EmbeddedSystems,ShriramKV,SENSE, VIT
133