Font Size: a A A

The Research And Design Of Event-driven Framework For Embedded System Based On Event Priority

Posted on:2017-03-21Degree:MasterType:Thesis
Country:ChinaCandidate:N ZhangFull Text:PDF
GTID:2308330482992250Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
Due to volume, power consumption, cost etc. embedded systems cannot use the equipment with excellent performance. Generally, the CPU of embedded system has limited computing power and the capacity of memory is also small. Embedded systems have two features: resource-constrained and high real-time. As the applications become more and more complex, develop directly on bare board is no longer applicable. Due to high efficiency, embedded operating systems gradually become an effective way.Traditional sequential programming model is difficult, that can bring problem of data exclusion and data sharing between multiple threads, and when waiting for event, it can’t react to any other event, and also busy waiting happens. Event-driven programming model can solve this problem effectively. For event-driven programming paradigm, this paper propose a method named fast implementation of hierarchical state machine, and provides running context and event queue which support state machine to run, that is event-driven framework for embedded system based on event priority.In this paper, we study the traditional embedded real-time multitasking operating system μC/OS-II and event-driven software framework QP, and analyses the difference between the two completely different systems. Event-driven system is run to completion, do need context preservation and recovery when tasks switch, improve response speed, and it only requires one stack, reducing RAM consumption, it identified the advantages of event-driven programming theoretically.The state machine is a well-known method to achieve event-driven systems need real-time response to events. On the basis of the fastest response speed of the event, this paper propose a method that is fast implementation of hierarchical state machine suitable for high real-time, simple state topology, state is directly represented as a state handler function, while state transition is hard-coded into state processing function.The event-driven framework provided in this paper has the characteristics of control reversal, single stack, event based priority, etc. Scheduling policy refer to interrupt processing in traditional embedded operating system. Events(interrupts) have priority and tasks(interrupt handler) do not have priority. The core data structure: event control block: HEP_ECB, event pool: HEP_Evt Pool, event control block helper: HEP_ECBHelper, event pool helper: HEP_Evt Pool Helper, state machine: HEP_AO. Event schedule refer μC/OS-II, the complexity of querying highest priority event is O(1).Finally, this paper develops an application based on this event-driven framework, a web server running on Arduino. User can control the device connected to Arduino through web page. The feasibility of framework is verified.
Keywords/Search Tags:Hierarchical State Machine, Event-driven, Quantum Programming(QP), Embedded Operating System
PDF Full Text Request
Related items