290 likes | 530 Views
Advanced Embedded Systems Design. BAE 5030 - 003 Fall 2004 Instructor: Marvin Stone Biosystems and Agricultural Engineering Oklahoma State University. Overview Of Embedded Systems Design. Embedded systems
E N D
Advanced Embedded Systems Design BAE 5030 - 003 Fall 2004 Instructor: Marvin Stone Biosystems and Agricultural Engineering Oklahoma State University
Overview Of Embedded Systems Design • Embedded systems • Definition: The special function micro-controller based element integrated into an engineered system • Provide control and user interface functions • May or may not be real-time • Real-time: Provides that quality of processing events as they happen and collecting information as it is available and providing control outputs and necessary responses within specified time constraints. • What is not an embedded system • General purpose microcomputer • Non micro-controller based electronic components of a system • Embedded systems design • Requirements specification, planning, development, and specification for manufacture of the hardware and software for embedded systems.
Goals of BAE 5030-003 Embedded systems design • To provide an introduction to methods and techniques for planning embedded systems • To provide an introduction to task scheduling and development of time-triggered embedded systems • To provide an introduction to event scheduled embedded systems • To focus primarily on software at the system design and development level. Hardware will be covered with regard to interfacing basics and system level aspects, but other courses address electronic hardware design • To develop hands-on competency in development of multi-tasking embedded software
Web-site for BAE 5030 • Course materials website • http://biosystems.okstate.edu/home/mstone/5030_04/5030_04index.htm • Includes syllabus, downloads, lectures resources, assignments • Course syllabus • http://biosystems.okstate.edu/home/mstone/5030_04/outline/bae5030_sched.htm
Topical review • Embedded systems operating environments • Event and time triggered tasking • main()+ISR, RTOS, and quantum approaches • Cooperative, pre-emptive, time triggered and shared clock scheduling • Rate Monotonic Analysis • Planning and design of embedded systems • Use of state machine and statechart descriptions • Inter-task communication and task synchronization • Application of a “Quantum framework” paradigm • Management of communications • Asynchronous queuing strategies • Asynchronous serial/SPI/I2C • Network communications • Multi-processor strategies • Implementation of control systems • Monotonicity • Control interfacing • Distributed systems techniques • Requirements specification for embedded systems
Course style • 15 3-hour class meetings • Questions on reading • 1 hour lecture from instructor • 0.5 hour problem review or reading assignment review from student • Demonstration from instructor • Final exam Pre-requisites • Completion of an undergraduate class in automatic control design • Completion of an undergraduate level class in embedded systems • Completion of an undergraduate class in electronics hardware
Introduction to an Embedded Systems Design Process • System planning – process • Develop thorough requirements specification • Set a realistic project schedule • Identify the significant tasks that will be needed to produce the ES • Identify the resources available to conduct the development • System designer • Programmers • Hardware designers • Testers • Budget and accounting • Project management • Documentors • Explainors • Assign resources, time and schedule to tasks • Include reasonable contingency • Make an initial hardware selection • Develop a software plan • Context diagram • Data flow diagram • State chart description
Introduction to an Embedded Systems Design Process • System preliminary design • Develop an initial hardware design • Review the hardware and software plans to assure requirements will be met • Obtain hardware prototypes for software development • Develop the software • Develop and test driver level software on the prototypes • Must include basic test software • Develop the first draft of the application level software • Develop the hardware design to the schematic level • Review the hardware and software designs to assure they meet the requirements specification Adjust as appropriate • Create first draft system hardware and software documentation • System final design • Revise the software to second draft • Revise the hardware schematic • Build and assemble hardware
Introduction to an Embedded Systems Design Process • System test • Receive and test the target hardware with the previously developed drivers and test software • Revise prototype hardware as necessary • Install and test second draft software • System final design • Create final hardware schematics • Create third draft – final software design • Fabricate final hardware prototype(s) • Install and test final software and hardware • Revise system documentation • Deliver system
Goals for Class Today • Introduce course (done) • Embedded Systems (done) • Introduce graphical system planning tools • Context diagrams • Data flow diagrams • Statecharts as a tool for specifying event driven systems • Introduce Keil Compiler • Set assignments
Behavioral Modeling • Logic tables – a tabular relationship between all inputs and outputs. Inputs and outputs can include parameters in memory • Statecharts – modeling technique suited to describing systems where past state or memory defines the transitions to the next state • Mealy automata – processes occur on transitions between states • Moore automata – processes occur within a state • UML - Unified Modeling Language – specifies a syntax for state machine modeling
Statechart definitions • State - a distinguishable consistent characteristic behavior of a system that persists for a significant period of time • Event – a change in stimulus to a system that occurs in an infinitesimal period of time • Transitions - responses to events that move the system from state to state • Finite State Machine – A model of a system and its behavior that captures states, events, and transitions between states • Finite State Machine characteristics • Characteristic behavior within a state is distinct and unchanging • Finite number of states • Residence time in states is a significant period • Transitions are the response of the system to events • Transitions between states are distinct and unchanging • Transitions between states are finite in number • Transition time between states is infinitesimal
Statechart elements and syntax • Start occurs at the initial pseudo state • The trigger event causes the change of state if the guard condition is true • System may exit the top state when the final state is reached • Time between states is infinitesimal • Elements (Simple statecharts) • Initial state • State • Transition • Event • Trigger • Guard • Action • Final state
Modified statechart for “Lowering mode” • Handle case where current is high when determining mode • Explicitly handle testing for time in “determining lowering mode”
Software structure to realize a state machine • Many possibilities but typical isinfinite loop encompassinga case structure. (see Samek) • Consider the following example: void Process_State_0( void ) { state = STATE_1 while((!Trigger_5) & (state == STATE_3)){ switch (state) { case STATE_1: if (Trigger_1) { process_1(); state = STATE_2 } break; case STATE_2: if (Trigger_2) { process_2(); state = STATE_2 } if (Trigger_3) { process_3(); state = STATE_2 } break; case STATE_3: if (Trigger_4) { process_4(); state = STATE_1 } } }
Context diagrams • Usage • Define the extents of a system • Define elements of a system • Define information flow from external elements to or from the system • Process for construction • Identify external elements that communicate with the system • Identify data that are the object of the communications • Construct the diagram that connects the external elements to the system with lines representing the communication
Dataflow Diagram • Usage • Define the movement of information to, from, and within a system • Define processing elements and data stores of a system • Define information (data) flow to and from processing elements of a system • Process for construction • Identify processing elements of the system • Identify data passed to, from and between processes in the system • Construct the diagram that connects the data flows to processing elements of the system
Assignment • Code the door control example in C • Read Pont, Chapters 1,2,3,6 (Review 4,5,7,8 as necessary) • Read Samek, Chapter 1,2,3 • Tutorial – 30 min • Explain how an interrupt and return from interrupt works at the machine level on an 8051. Explain the situation where an interrupt has occurred and then another occurs.