您好,欢迎来到佳博论文网!

μC/OS一Ⅱ在AVR(ATmega128)上的移植应用

论文编号:SP015论文字数:9079,页数:24

摘 要

目前在单片机中移植嵌入式操作系统是嵌入式系统发展的一个热点,也是未来发展的方向。本文介绍了嵌入式操作系统在单片机中应用的优势和μC/OS-Ⅱ的特点,并结合AVR(ATMega128)单片机在数据采集和LCD显示方面的应用,分析了μC/OS-Ⅱ的移植过程和基本方法。采用μC/OS-Ⅱ可以大大简化应用程序设计,满足实时要求,降低开发难度,提高系统可靠性。把操作系统配置好后,再将任务设置好执行的优先级经编译下载,这样应用程序连同操作系统就可以在单片机里运行了。最后单片机连同其外围电路实现了本设计要完成的一个功能——在LCD上实时显示采集到的模拟信号(电压)。

关键词:μC/OS-Ⅱ;AVR;数据采集;LCD

Abstract

Porting Embedded RTOS into MCU would be a hot topic of the development of embedded system at present and in the future. The paper introduces the advantages of Embedded RTOS in MCU application and the characteristic of

μC/OS-Ⅱ.It analyses the porting process and the basic method ofμC/OS-Ⅱ,combing the application of data collection and LCD display with AVR(ATmega128). This system could shortcut the design process and suit the real-time request to inhance the reliability of system. After the operated system is disposed in reasonable way and the priority set before hand with be transplanted and edit then the precedure and the operated system would be loaded into MCU. The analog voltage signal gathered in real-time will be shown on LCD, which is a function of the design realized through the periphery circuit with AVR(MCU).

Keywords:μC/OS-Ⅱ;AVR;data collection;LCD

 

目 录

1 引言1

2 AVR单片机特点综述1

2.1 单片机内部结构方框图1

2.1.1 AVR CPU内核介绍3

2.2 结构综述3

2.3 AVR电气特性4

3 μC/OS -Ⅱ系统的特点4

3.1 源代码便于移值、剪裁4

3.2 内核可中断4

3.3 共享资源可保护6

3.4 任务间的同步和通信6

3.5 任务栈和中断管理6

4 μC/OS -Ⅱ系统的应用6

4.1 μC/OS -Ⅱ在AVR微处理器上的移植过程6

4.2 修改与处理器相关的代码7

4.2.1 OS_CPU.H文件7

4.2.2 OS_CPU_C.C文件7

4.2.3 OS_CPU_A.ASM文件8

4.3 修改与应用相关的代码8

4.3.1 INCLUDES.H文件8

4.3.2 OS_CFG.H文件9

5 系统的硬件设计9

5.1 采集模块9

5.2 通信模块10

5.3 显示模块10

5.4 模拟信号源11

6 应用程序(任务)设计12

7 程序下载及在线调试12

8 结束语12

参考文献:14

附1 The Real-Time Kernel15

附2 μC/OS Story(JEAN J.LABROSSE)17

μC/OS-Ⅱ在AVR(ATmega128)上的移植应用......