嵌入式实时操作系统μC/OS在C51平台上的移植及应用
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
随着现代计算机技术的迅速发展,嵌入式操作系统以其简洁、高效等优点扮演了越来越重要的角色。嵌入式产品已经成为信息产业的主流,被广泛应用于移动计算设备、网络设备、工控设备、信息家电、汽车电子、娱乐设备、仪器仪表等领域。
     依据经济成本考虑,本项目没有去购买昂贵的商业RTOS(实时操作系统),而是选择了源代码公开、体积小且可裁剪移植性好的μC/OS-Ⅱ,选择C51微处理器为应用平台,根据实际项目要求把μC/OS-Ⅱ移植到C51单片机上。移植的过程主要集中在三个文件的重新编写上:一个头文件OS_CPU.H、一个C代码文件OS_CPU_C.C和一个汇编文件OS_CPU_A.ASM文件。还针对C51的小内存所做的优化,对可重入问题的进行了分析与解决,基本达到应用的需要。最后以μC/OS-Ⅱ实时内核为基础,把它应用于智能验钞机系统,运用了三大检伪手段(磁性检测、荧光检测和宽度检测),实现了智能验钞机启停监测、按键监控、信息处理、数据输出和参数设置等多任务的设计目的。基于μC/OS-Ⅱ内核的程序,进行多任务的分配和调用,构建智能验钞机的软件构架,结合外部中断服务程序,具体的完成项目中软件应用的部分,形成了一个具有实际意义的嵌入式系统应用软件。
     嵌入式实时操作系统μC/OS-Ⅱ具有多任务处理等特点,将其应用到实际项目智能验钞机上,使用可剥夺性的实时内核,对验钞时所有时间要求苛刻的事件都得到了尽可能快捷、有效的处理。且移植过程使用C语言开发,简化了程序的设计过程,降低了开发难度,提高了开发效率、可维护性和可移植性。但还存在一些不足和需要改进和地方。文章最后对这些方面做了阐述,提出了改进思路和方法,为下一步的工作提供了有意义的参考。
With modern computer technology to the rapid development of embedded operating system for its simplicity, efficiency, etc. played an increasingly important role. Embedded products have become the mainstream of the information industry, are widely used in mobile computing devices, network equipment, industrial equipment, information appliances, automotive electronics, entertainment equipment, instrumentation and other fields.
     Basis for considering the economic costs, the project did not go to buy expensive commercial RTOS (real-time operating system), but opted for the open source code, small size and portability can be a good cutμC / OS-II, to choose for the application of microprocessor C51 platform, based on actual project requirements of theμC / OS-II ported to the C51 single-chip microcomputer. Transplantation mainly concentrated in the process of re-preparation of three documents: one header file OS_CPU.H, a C code file OS_CPU_C.C and a compilation of documents OS_CPU_A.ASM documents. C51 also made a small memory optimization, re-entrant to the problem are analyzed and resolved to meet the basic needs of the application. Finally,μC / OS-II real-time kernel-based, it applies to smart Detector systems, the use of three pseudo-seizure means (magnetic detection, fluorescence detection and the width of detection), the realization of a smart start and stop monitoring Detector , keystroke monitoring, information processing, data output and parameter settings are designed to multi-task. Based onμC / OS-II kernel procedures, conduct multi-task allocation and call to build the framework of Intelligent Detector software, combined with the external interrupt service routine, the specific software applications to complete the project in part, to form a meaningful embedded system applications.
     Embedded real-time operating systemμC / OS-II has features such as multi-tasking to deal with its application to the actual project on Intelligent Detector, can be deprived of the use of real-time kernel, the task demanding all the time when the events have been as far as possible, fast, effective treatment. Transplantation and the use of C language development process and simplifies the process of the design process and reduce the development of the difficulty of the development of improved efficiency, maintainability and portability. However, there are still some shortcomings and need to be improved and local. Finally, the article done on these areas and put forward ideas and methods to improve for the next step to provide a meaningful work of reference.
引文
[1]RAJ KAMAL著,陈曙晖译.嵌入式系统-体系结构、编程和设计.北京:清华大学出版社,2005.
    [2]唐寅.实时操作系统应用开发指南.北京:中国电力出版社,2002.7.
    [3]桑楠.嵌入式系统原理及应用开发技术.北京:北京航空航天大学出版社,2002年.
    [4]Steven F.Barrett.Embedded Systems[M],北京:电子工业出版社,2006.
    [5]李伯成.单片机及嵌入式系统[M],北京:清华大学出版社,2005[4]
    [6]陈晗斐.实时操作系统的若干关键问题研究,浙江大学博士论文2004.7
    [7]朱瑾.基于Linux嵌入式操作系统实时性的研究.硕士学位论文沈阳工业大学.2005-3
    [8]刘丙成.μC/OS-Ⅱ内核分析及其平台的构建:硕士学位论文.呼和浩特:内蒙古工业大学,2005.
    [9]VxWorks programmers guide,WindRiver System Inc.
    [10]JEAN J.LABROSSE著,邵贝贝译.μC/OS-Ⅱ-源码公开的实时嵌入式操作系统.北京:中国电力出版社,2001.
    [11]杨屹.在51单片机上固化uCOS51的说明.http://www.hjhj.com.
    [12]田泽.嵌入式系统开发与应用.北京:北京航空航天大学出版社,2005.1.5.
    [13]Keil Elektronik GmbH.and Keil Software,Inc.Cx51 Compiler Optimizing C Compiler and Library Reference for Classic and Extended 8051Microcontrollers User's Guide[M].
    [14]黄亮亮,朱欣华.基于实时多任务操作系统μC/OS-Ⅱ的C8051F系列单片机应用系统开发测控技术2005年第24卷第9期
    [15]李江常,葆林.嵌入式操作系统设计中的若干问题计算机工程2000.6第20卷第6期:89
    [16]刘从新,曾维鲁.51单片机实时操作系统的构建三峡大学学报2003.10第25卷第5期:446
    [17]江平新,容太平.μC/OS-Ⅱ在cso51F上的移植.单片机与嵌入式系统应用,2003年9期.
    [18]李玉峰,倪虹霞编著.MCS-51系列单片机原理与接口技术.北京:人民邮电出版社,2004.5.
    [19]胡大可,李培弘,方路平编著.基于单片机8051的嵌入式开发指南.北京:电子工业出版社,2003.1.
    [20]何立民著.单片机应用系统设计.北京:北京航空航天大学出版社,1990.2
    [21]谢维成,杨加国等著.单片机原理与应用及C51程序设计.北京:清华大学出版社,2006.8.
    [22]成毅,庹先国,高嵩.PS/2键盘在51单片机系统中的应用.中国测试技术.2004年,05期.
    [23]RAJ KAMAL著,陈曙晖译.嵌入式系统-体系结构、编程和设计.北京:清华大学出版社,2005.
    [24]陈明计,周立功等.嵌入式实时操作系统Small RTOS51原理及应用[M],北京:北京航空航天大学出版社,2004.
    [25]熊竞.如何对嵌入式系统进行调试,http://www.spasvo.com/html/ceshi/20080624-176.html
    [26]杨全胜.现代微机原理与接口技术.[M],北京:电子工业出版社,2002
    [27]赵奇,索晓冉.实时系统优先级反转研究,计算机应用研究,2008年第25卷第6期.
    [28]罗蕾.嵌入式实时操作系统及应用[M],北京:北京航空航天大学出版社,2005.
    [29]廖志文.防伪印刷最前沿--浅谈人民币防伪印刷技术,印刷世界,2007年第01期.
    [30]验钞机的辨伪原理http://www.cnnsr.com.cn/jtym/wzxx/cpzx/20051020/2005102016243014385.sht ml
    [31]吴莲贵,李维.μC/OS-Ⅱ在C51系列单片机上的移植,现代计算机2008年第三期(总第二七九期)
    [32]任哲.嵌入式实时操作系统μC/OS-Ⅱ原理及应用.北京:北京航空航天大学出版社,2006
    [33]董余红,阎俊武.μC/OS-Ⅱ在C51系列单片机上的移植,导弹与航天运载技术2004年第6期(总第273期)
    [34]周文.μC/OS-Ⅱ在AT89S51单片机上的移植 计算机与现代化 2008年第4期(总第152期)
    [35]魏洪兴,等.嵌入式系统设计与实例开发试验教程[M].北京:清华大学出版社,2005.190-199.
    [36][美]鲍尔.嵌入式微处理器系统设计实例[M]苏建平,等译北京:电子工业出版社,2004
    [37]田志鑫,张雷,赵明扬.在51单片机上移植μC/OS-Ⅱ关键问题的解决.《微计算机信息》(嵌入式与SOC)2007年第23卷第12-2期
    [38]索双富,孙晋厚,肖丽英.点钞机鉴伪技术发展趋势 机械设计与制造 2007年12月
    [39]刘连浩,罗安,王加阳,等智能型点钞机的研制[J]机电一体化,2003,9(1):11-13
    [40]KEIL C51使用详解PDF.http://www.mcul6.com/microprocessor/Keil-C51-PDF.htm
    [41]谭浩强.C程序设计[M].北京:清华大学出版社,2002
    [42]嵌入式开发论坛http://www.cevx.com/bbs/index.php
    [43]Qian Ji,Qian Dongping,Zhang Mengjie.A digit recognition system for paper currency identification based on virtual instruments[J].Information and Automation,2006:46-49.
    [44]Lu Z,Hein J.Control-theoretic dynamic frequency and voltage scaling for multimedia workloads[C].Proceedings of the 2002 International Conference on Compilers,Architecture,and Synthesis for Embedded Systems.New York,NY,USA:ACM Press,2002:156-163
    [45]Xia Feng,Dai Xiaohua.Feedback scheduling of real-time control tasks in power-aware embedded systems[C].Proceeding of the Second International Conference on Embedded Software and Systems(ICESS'OS).Washington,DC,USA:IEEE,2005:513-519
    [46]eclipsefocus:Motorola joins eclisp,propses Tml project,embedded computing design,2006.10
    [47]Texas Instruments Incorporated.TMS320VC5402 Peripherals Reference Guide [Z],Texeas:Texeas Instruments Incorporated,2001
    [48]Fumiaki Takeda,Sigeru Omatu,High speed paper currency recognition by neural networks,IEEE Trans on Neural Network,1995,6(1):73-77
    [49]A Frosini,M Gori,Pprimi.A neural network based model for paper currency recognition and verification.IEEE Trans on Neural Networks,1996,7(6):1482-1490
    [50]Specification/data Information,May 1996
    [51]T89C51AC2.Atmel.http://www.atmel.com
    [52]T89C51AC2 Errata.Atmel.http://www.atmel.com
    [53]T89C51AC2 UART Bootloader.Atmel.http://www.atmel.com
    [54]C Flash Drivers for the T89C51AC2 for Keil Compilers rev 1.2.0.Atmel.http://www.atmel.com
    [55]陈涛,周金运,彭孝东.红外光电管及其在验钞机中的应用.现代电子技术,2005,18:6-7
    [56]索双富,孙晋厚,肖丽英.点钞机鉴伪技术发展趋势.机械设计与制造,2007,12:199-201