tailieunhanh - Seminar 5: Meeting Real-Time
Introduction In this seminar, we begin to consider the issues involved in the accurate measurement of time. These issues are important because many embedded systems must satisfy real-time constraints. q y,β x, y, z = position coordinates υ, β, ϖ = velocity cordinates p = roll rate q = pitch rate r = yaw rate Rudder δr Elevator δe x,υ Aileron δa p z,ϖ r Yaw (rate) sensor Pitch (rate) sensor Rudder Roll (rate) sensor Elevator Aircraft Autopilot System Aileron Main pilot controls Position sensors (GPS) Main engine (fuel) controllers Velocity sensors (3 axes) COPYRIGHT © MICHAEL J. PONT, 2001-2006. Contains material from: Pont, . (2002) “Embedded C”, Addison-Wesley. PES I - 116 bit SWITCH_Get_Input(const tByte DEBOUNCE_PERIOD) {. | Seminar 5 Meeting Real-Time Constraints Copyright Michael J. Pont 2001-2006. Contains material from Pont . 2002 Embedded C Addison-Wesley. PES I - 115 Introduction In this seminar we begin to consider the issues involved in the accurate measurement of time. These issues are important because many embedded systems must satisfy real-time constraints. r Copyright Michael J. Pont 2001-2006. Contains material from Pont . 2002 Embedded C Addison-Wesley. PES I - 116 bit SWITCH_Get_Input const tByte DEBOUNCE_PERIOD tByte Return_value SWITCH_NOT_PRESSED if Switch_pin 0 Switch is pressed Debounce - just wait. DELAY_LOOP_Wait DEBOUNCE_PERIOD POTENTIAL PROBLEM Check switch again if Switch_pin 0 Wait until the switch is released. while Switch_pin 0 POTENTIAL CATASTROPHE Return_value SWITCH_PRESSED Now finally return switch value return Return_value The first problem is that we wait for a debounce period in order to confirm that the switch has been pressed. Because this delay is implemented using a software loop it may not be very precisely timed. The second problem is even more serious in a system with real-time characteristics we cause the system to wait - indefinitely - for the user to release the switch. We ll see how to deal with both of these problems in this seminar Copyright Michael J. Pont 2001-2006. Contains material from Pont . 2002 Embedded C Addison-Wesley. PES I - .
đang nạp các trang xem trước