❶ 需要一篇自动控制方面的英文文献
本毕业设计课题是属于教师拟定性课题,主要是研究基于单片机的对步进电机的有效控制。步进电机是一种能将数字输入脉冲转换成旋转举察或直线增量运动的电磁执行元件,每输入蠢虚一个脉冲电机转轴步进一个步距角增量。电机总的回转角与输入脉冲数成正比例,相应的转速取决于输入脉冲频率。
步进电机是机正档茄电一体化产品中关键部件之一,通常被用作定位控制和定速控制。步进电机惯量低、定位精度高、无累积误差、控制简单等特点。广泛应用于机电一体化产品中,如:数控机床、包装机械、计算机外围设备、复印机、传真机等。
Abstract
This article mainly elaborated has been hanging the movement control system merit, introced was hanging the movement control system function, the principle and the design process. Is hanging the movement control system is one of in control engineering domain important applications, its main target is to is controlled the object the movement condition, including path, speed and position implementation check. The movement control system compares with other control systems, has the system model simply, the check algorithm is unitary, also not complex characteristic and so on non-linearity and coupling situation. Also is precisely because the movement control system can implement to the path, the running rate, the pointing accuracy as well as the repetition precision accuracy control requirement, has the broad application foreground in each category of control engineering, therefore the movement control system has at present become in the check study application domain very much significant the research direction. Through the monolithic integrated circuit to stepping monitor check, implemented the motor-driven to cause the object at on the board which inclined the movement, The control section is the SST89E52 monolithic microcomputer which SST Corporation proces primarily, with when the 1602LCD liquid crystal screen and according to turned has implemented with the user interactive, through the keyboard entry different control command, the liquid-crystal display was allowed to display the setting value and the run the coordinates. The electrical machinery control section used LM324N four to transport puts and is connected the electronic primary device voluntarily to develop the 42BYG205 stepping monitor actuation electric circuit to implement the electrical machinery accuracy control. The algorithm partially for will suit the monolithic integrated circuit system to operate carries on optimizes many times, will rece the microprocessor the operand. Has completed the object voluntarily the movement and according to the different setup path movement.
Key words Magneto; 1602LCD; LM324N; Drive circuit
选择步进电机时,首先要保证步进电机的输出功率大于负载所需的功率。而在选用功率步进电机时,首先要计算机械系统的负载转矩,电机的矩频特性能满足机械负载并有一定的余量保证其运行可靠。在实际工作过程中,各种频率下的负载力矩必须在矩频特性曲线的范围内。一般地说最大静力矩Mjmax大的电机,负载力矩大[1 ]。
选择步进电机时,应使步距角和机械系统匹配,这样可以得到机床所需的脉冲当量。在机械传动过程中为了使得有更小的脉冲当量,一是可以改变丝杆的导程,二是可以通过步进电机的细分驱动来完成。但细分只能改变其分辨率,不改变其精度。精度是由电机的固有特性所决定。
选择功率步进电机时,应当估算机械负载的负载惯量和机床要求的启动频率,使之与步进电机的惯性频率特性相匹配还有一定的余量,使之最高速连续工作频率能满足机床快速移动的需要。
基于单片机的悬挂运动控制系统,具有硬件电路结构简单,精确度高,抗干扰性强等优点。
1.2 课题目的
培养综合运用四年大学所学知识去分析问题和解决实际问题的能力。在实践中检验所学知识,从而加强理论与实践的相结合。 体验一个科研项目开发的全过程,学会单片机开发应用方法,锻炼应用能力,动手能力。本课题设计是具有一定难度的基于单片机的应用系统开发项目,培养学生创新精神和创新能力。通过这次毕业论文及设计,检验的综合素质和专业教育的培养效果,并且使学会阅读、利用英文文献资料,阅读并翻译外文资料的能力,学会设计报告和论文。
1.3 课题意义
随着社会的发展、科技的进步以及人们生活水平的逐步提高,各种方便于生活的自动控制系统开始进入了人们的生活,以单片机为核心的自动门系统就是其中之一。同时也标志了自动控制领域成为了数字化时代的一员[ 3]。它实用性强,功能齐全,技术先进,使人们相信这是科技进步的成果。它更让人类懂得,数字时代的发展将改变人类的生活,将加快科学技术的发展。
通过对“微机控制自动门系统”的研究和设计,精心撰写了微机控制自动门系统论文。本论文着重阐述了以单片机为主体,LED点阵显示芯片及步进电机为核心的系统。
本设计主要应用SST89E58作为控制核心,LED点阵显示芯片、步进电机、压力传感器、电位器相结合的系统。充分发挥了单片机的性能。其优点硬件电路简单,软件功能完善,控制系统可靠,性价比较高等特点,具有一定的使用和参考价值。
1.4 应解决的主要问题
在基于单片机的悬挂运动控制系统中,主要分三个部分设计,一个是输入和键盘显示模块;另一个是步进电机驱动模块;第三个是最小系统和输出模块设计。主要解决的问题是:
1. 单片机最小系统硬件设计;
2. 步进电机驱动模块设计;
3. 输出部分的软硬件设计;
4. 主程序设计;
5. 绘图板的设计。
1.5 技术要求
设计一电机控制系统,控制物体在倾斜(仰角≤100度)的板上运动。
在一白色底板上固定两个滑轮,两只电机(固定在板上)通过穿过滑轮的吊绳控制一物体在板上运动,运动范围为80cm×100cm。物体的形状不限,质量大于100克。物体上固定有浅色画笔,以便运动时能在板上画出运动轨迹。板上标有间距为1cm的浅色坐标线(不同于画笔颜色),左下角为直角坐标原点。
[看不到}
❷ 求助如何找到关于单片机的外文文献翻译,用于毕业设计
Getting Started with µVision2
The Keil Software 8051 development tools listed below are programs you use to compile your C code, assemble your assembly source files, link and locate object moles and libraries, create HEX files, and debug your target program.
µVision2 for Windows™ is an Integrated Development Environment that combines project management, source code editing, and program debugging in one single, powerful environment.
The C51 ANSI Optimizing C Cross Compiler creates relocatable object moles from your C source code.
The A51 Macro Assembler creates relocatable object moles from your 8051 assembly source code.
The BL51 Linker/Locator combines relocatable object moles created by the C51 Compiler and the A51 Assembler into absolute object moles.
The LIB51 Library Manager combines object moles into libraries that may be used by the linker.
The OH51 Object-HEX Converter creates Intel HEX files from absolute object moles.
The RTX-51 Real-time Operating System simplifies the design of complex, time-critical software projects.
Software Development Cycle
When you use the Keil Software tools, the project development cycle is roughly the same as it is for any other software development project.
1. Create a project, select the target chip from the device database, and configure the tool settings.
2. Create source files in C or assembly.
3. Build your application with the project manager.
4. Correct errors in source files.
5. Test the linked application.
µVision2 IDE
The µVision2 IDE combines project management, a rich-featured editor with interactive error correction, option setup, make facility, and on-line help. Use µVision2 to create your source files and organize them into a project that defines your target application. µVision2 automatically compiles, assembles, and links your embedded application and provides a single focal point for your development efforts.
LIB51 Library Manager
The LIB51 library manager allows you to create object library from the object files created by the compiler and assembler. Libraries are specially formatted, ordered program collections of object moles that may be used by the linker at a later time. When the linker processes a library, only those object moles in the library that are necessary to create the program are used.
BL51 Linker/Locator
The BL51 linker creates an absolute object mole using the object moles extracted from libraries and those created by the compiler and assembler. An absolute object file or mole contains no relocatable code or data. All code and data reside at fixed memory locations. The absolute object file may be used:
To program an EPROM or other memory devices,
With the µVision2 Debugger for simulation and target debugging,
With an in-circuit emulator for the program testing.
µVision2 Debugger
The µVision2 symbolic, source-level debugger is ideally suited for fast, reliable program debugging. The debugger includes a high-speed simulator that let you simulate an entire 8051 system including on-chip peripherals and external hardware. The attributes of the chip you use are automatically configured when you select the device from the Device Database.
The µVision2 Debugger provides several ways for you to test your programs on
real target hardware:
Install the MON51 Target Monitor on your target system and download your program using the Monitor-51 interface built-in to the µVision2 Debugger.
Use the Advanced GDI interface to attach use the µVision2 Debugger front end with your target system.
Monitor-51
The µVision2 Debugger supports target debugging using Monitor-51. The monitor program resides in the memory of your target hardware and communicates with the µVision2 Debugger using the serial port of the 8051 and a COM port of your PC. With Monitor-51, µVision2 lets you perform source-level, symbolic debugging on your target hardware.
RTX51 Real-Time Operating System
The RTX51 real-time operating system is a multitasking kernel for the 8051 microcontroller family. The RTX51 real-time kernel simplifies the system design, programming, and debugging of complex applications where fast reaction to time critical events is essential. The kernel is fully integrated into the C51 Compiler and is easy to use. Task description tables and operating system consistency are automatically controlled by the BL51 linker/locator.
C51 Optimizing C Cross Compiler
The Keil C51 Cross Compiler is an ANSI C Compiler that was written
specifically to generate fast, compact code for the 8051 microcontroller family.
The C51 Compiler generates object code that matches the efficiency and speed
of assembly programming.
Using a high-level language like C has many advantages over assembly language
programming:
Knowledge of the processor instruction set is not required. Rudimentary knowledge of the memory structure of the 8051 CPU is desirable (but not necessary).
Details like register allocation and addressing of the various memory types and data types is managed by the compiler.
Programs get a formal structure (which is imposed by the C programming language) and can be divided into separate functions. This contributes to source code reusability as well as better overall application structure.
The ability to combine variable selection with specific operations improves program readability.
Keywords and operational functions that more nearly resemble the human thought process may be used.
Programming and program test time is drastically reced.
The C run-time library contains many standard routines such as: formatted output, numeric conversions, and floating-point arithmetic.
Existing program parts can be more easily included into new programs because of molar program construction techniques.
The language C is a very portable language (based on the ANSI standard) that enjoys wide popular support and is easily obtained for most systems.
Existing program investments can be quickly adapted to other processors as needed.
Code Optimizations
The C51 Compiler is an aggressive optimizing compiler that takes numerous steps to ensure that the code generated and output to the object file is the most efficient (smallest and/or fastest) code possible. The compiler analyzes the generated code to proce the most efficient instruction sequences. This ensures that your C program runs as quickly and effectively as possible in the least amount of code space.
The C51 Compiler provides nine different levels of optimizing. Each increasing level includes the optimizations of levels below it. The following is a list of all optimizations currently performed by the C51 Compiler.
General Optimizations
Constant Folding: Constant values occurring in an expression or address calculation are combined as a single constant.
Jump Optimizing: Jumps are inverted or extended to the final target address when the program efficiency is thereby increased.
Dead Code Elimination: Code that cannot be reached (dead code) is removed from the program.
Register Variables: Automatic variables and function arguments are located in registers whenever possible. No data memory space is reserved for these variables.
Parameter Passing Via Registers: A maximum of three function arguments
may be passed in registers.
Global Common Subexpression Elimination: Identical subexpressions or address calculations that occur multiple times in a function are recognized and calculated only once whenever possible.
Common Tail Merging: Common instruction blocks are merged together using jump instructions.
Re-use Common Entry Code: Common instruction sequences are moved in front of a function to rece code size.
Common Block Subroutines: Multiple instruction sequences are packed into subroutines. Instructions are rearranged to maximize the block size.
中文译文
Keil C 简介
Keil Software 的8051开发工具提供以下程序,你可以用它们来编译你的C源码,汇编你的汇编源程序,连接和重定位你的目标文件和库文件,创建HEX文件,调试你的目标程序。
Windows应用程序uVision2是一个集成开发环境,它把项目管理,源代码编辑,程序调试等集成到一个功能强大的环境中。
C51美国标准优化C交叉编译器从你的C源代码产生可重定位的目标文件。
A51宏汇编器从你的8051汇编源代码产生可重定位的目标文件。
BL51连接/重定位器组合你的由C51和A51产生的可重定位的目标文件,生成绝对目标文件。
LIB51库管理器组合你的目标文件,生成可以被连接器使用的库文件。
OH51目标文件到HEX格式的转换器从绝对目标文件创建Intel HEX 格式的文件。
RTX-51实时操作系统简化了复杂和对时间要求敏感的软件项目。
软件开发流程
当你使用Keil Software工具时,你的项目开发流程和其它软件开发项目的流程极其相似。
1. 创建一个项目,从器件库中选择目标器件,配置工具设置。
2. 用C语言或汇编语言创建源程序。
3. 用项目管理器实现你的应用。
4. 修改源程序中的错误。
5. 测试,连接应用。
uVision2 IDE
uVision2 集成开发环境集成了一个项目管理器,一个功能丰富、有错误提示的编辑器,以及设置选项,生成工具,在线帮助。利用uVision2创建你的源代码并把它们组织到一个能确定你的目标应用的项目中去。uVision2自动编译,汇编,连接你的嵌入式应用,并为你的开发提供一个单一的焦点。
C51编译器和A51汇编器
源代码由uVision2 IDE创建,并被C51编译或A51汇编。编译器和汇编器从源代码生成可重定位的目标文件。Keil C51编译器完全遵照ANSI C语言标准,支持C语言的所有标准特性。另外,直接支持8051结构的几个特性被添加到里面。Keil A51宏汇编器支持8051及其派生系列的全部指令集。
LIB51 库管理器
LIB51库管理器允许你从由编译器或汇编器生成的目标文件创建目标库。库是一种被特别地组织过并在以后可以被连接重用的对象模块。当连接器处理一个库时,仅仅那些被使用的目标模块才被真正使用。
BL51 连接器/定位器
BL51 连接器/定位器利用从库中提取的目标模块和由编译器或汇编器生成的目标模块创建一个绝对地址的目标模块。一个绝对地址目标模块或文件包含不可重定位的代码和数据。所有的代码和数据被安置在固定的存储器单元中。此绝对地址目标文件可以用来:
写入EPROM或其它存储器件。
由uVision2调试器使用来模拟和调试。
由仿真器用来测试程序。
uVision2 调试器
uVision2源代码级调试器是一个理想地快速,可靠的程序调试器。此调试器包含一个高速模拟器,能够让你模拟整个8051系统,包括片上外围器件和外部硬件。当你从器件库中选择器件时,这个器件的特性将自动配置。
uVision2调试器为你在实际目标板上测试你的程序提供了几种方法:
安装MON51目标监控器到你的目标系统并且通过Monitor-51接口下载你的程序。
利用高级的GDI(AGDI)接口,把uVision2调试器绑定到你的目标系统。
Monitor-51
uVision2调试器支持用Monitor-51进行目标板调试。此监控程序驻留在你的目标板的 存储器里,它利用串口和uVision2调试器进行通信。利用Monitor-51,uVision2调试器 可以对你的目标硬件实行源代码级的调试。
RTX51实时操作系统
RTX51实时操作系统是一个针对8051系列的多任务核。RTX51实时内核从本质上简化了对实时事件反应速度要求高的复杂应用系统的设计,编程和调试。RTX51实时内核是完全集成到C51编译器中的,从而方便使用。任务描述表和操作系统的连接由BL51连接器/定位器自动控制。
C51优化的C语言交叉编译器
Keil C51交叉编译器是一个基于ANSI C标准的针对8051系列MCU的C编译器,生成的可执行代码快速、紧凑,在运行效率和速度上可以和汇编程序得到的代码相媲美。
和汇编语言相比,用C语言这样的高级语言有很多优势,比如:
对处理器的指令集不必了解,8051 CPU的基本结构可以了解,但不是必须的。
寄存器的分配以及各种变量和数据的寻址都由编译器完成。
程序拥有了正式的结构(由C语言带来的),并且能被分成多个单独的子函数。这使整个应用系统的结构变得清晰,同时让源代码变得可重复使用。
选择特定的操作符来操作变量的能力提高了源代码的可读性。
可以运用和人的思维很接近的词汇和算法表达式。
编写程序和调试程序的时间得到很大程度的缩短。
C运行连接库包含一些标准的子程序,如:格式化输出,数字转换,浮点运算。
由于程序的模块结构技术,使得现有的程序段可以很容易的包含到新的程序中去。
ANSI 标准的C语言是一种丰常方便的,获得广泛应用的,在绝大部分系统中都能够很容易得到的语言。
因此,如果需要,现有的程序可以很快地移植到其他的处理器上,节省投资。
代码优化
C51是一个杰出的优化编译器,它通过很多步骤以确保产生的代码是最有效率的(最小和/或最快)。编译器通过分析初步的代码 产生最终的最有效率的代码序列,以此来保证你的C语言程序占用最少空间的同时运行的快而有效。
C51编译器提供9个优化级别。每个高一级的优化级别都包括比它低的所有优化级别的优化内容。以下列出的是目前C51编译器提供的所有优化级别的内容:
常量折叠:在表达式及寻址过程中出现的常量被综合为一个单个的常量。
跳转优化:采用反转跳转或直接指向最终目的的跳转,从而提升了程序的效率。
哑码消除:永远不可能执行到的代码将自动从程序中剔除。
寄存器变量:只要可能,局部变量和函数参数被放在CPU寄存器中,不需要为这些变量再分配存储器空间。
通过寄存器传递参数:最多三个参数通过寄存器传递。
消除全局公用的子表达式:只要可能,程序中多次出现的相同的子表达式或地址计算表达式将只计算一次。
合并相同代码:利用跳转指令,相同的代码块被合并。
重复使用入口代码:需要多次使用的共同代码被移到子程序的前面以缩减代码长度。
公共块子程序:需要重复使用的多条指令被提取组成子程序。指令被重新安排以最大化一个共用子程序的长度。
❸ 求单片机参考文献,中文的有相应的外文翻译
[1]杨十元.模拟系统故障诊断与可靠性设计,清华人学出版社,2004
[2]童诗白.模拟电子技术基础,高教出版社,2006
[3]周航慈.单片机应用程序设计技术,北京航空航大大学出版社,2005
[4]李刚.ADuC812系列单片机原理和应用技术,北京航空航天山版社,2005
[5]胡诞康.在线测试技术的发展与展望,计量与测试技术,2001
[6]星河科技开发公司,印刷电路板在线测试系统的发展与应用,电子标准化与测量,2003
[7]季华.PCB测试技术的综合利用,电子产品世界,2007-12
[8]鲜坛.组装测试技术应用前景分析,世界电子元器件,2008-1
[9]张金敏.基于单片机控制的智能电阻电容在线测试仪,甘肃科技,2006
[10]庄绍雄王济浩张迎春.智能阻容在线测试技术,山东工业大学学报,
[11]陈国顺陈春沙王格芳等.通用电路板在线测试仪设计与开发,仪器仪表学报,2001
[12]Nancy Hplland.Automated Instruments Smooth Rapid Test System Development.Test & Measurement World,AUGUST 2001
[13]卢育强.如何设定ICT的上下限,电子生产设备,2003 142-143
[14]赵悦 沈青松 终玉军.路板的测试技术,辽宁工学院学报,2008-1
[15]程亚黎 曾周末.电路故障自动测试与诊断系统,中国仪器仪表,2007
❹ 求基于单片机的全自动洗衣机外文翻译
Abstract :This engineering design is to regard AT89C2051 as the key component , because there are few pins of AT89C2051, the memory is not big in capacity, so, the function of the washing machines controlled has certain restriction , but, because the basic function of the washing machine is to the washing of the clothes, so, the key lies in carrying on the control of the laundry procere. Proceed from this angle, analyse , the main function of the automatic washing machine designed has the following seven items to the function of the washing machine : Have strong , weak washing functions; Four laundry working routine, already standardization program , economic procere, procere drain off water procere enter , drainage system trouble diagnose the function automatically alone; Safe protection while dehydrating and defending the vibration function; Drive way of the
intermittence ; Suspend the function; The sound only shows the function.
Key word: AT89C2051, full-automatic washing machine, engineering design , control circuit
❺ 急急急急!!!单片机外文翻译
单片机论文
--------------------------------------------------------------------------------
文:admin 发表时间2008-9-26 11:29:00
单片机论文:单片机是一种嵌入式系统仿真方法,通过一种特殊设计的指令集仿真器ISS将软件调试器软件Keil uVision2和硬件语言仿真器软件Modelsim连接起来,实现了软件和硬件的同步仿真。
关键词:BFM,TCL,Verilog,Vhdl,PLI,Modelsim,Keil uVision2,ISS,TFTP,HTTP,虚拟网卡,Sniffer,SMART MEDIA,DMA,MAC,SRAM,CPLD
缩略词解释:
BFM:总线功能模块。在HDL硬件语言仿真中,BFM完成抽象描述数据和具体的时序信号之间的转换。
PLI:Verilog编程语言接口,是C语言模块和Verilog语言模块之间交换数据的接口定义。
TCL:字面意思是工具命令语言,是一种解释执行语言,流行EDA软件一般都集成有TCL。使用TCL用户可以编写控制EDA工具的脚本程序,实现工具操作自动化。
ISS:CPU指令集仿真器,可以执行CPU的机器码。
TFTP:简单文件传输协议,Windows的tftp.exe既是该协议的客户端实现。
SMART MEDIA:一种存储卡,常用于数码相机、MP3。
DMA:直接内存访问。用于外部设备之间高速数据转移。
MAC:媒体接入控制器。本文中是指网卡芯片。
前言
传统的嵌入式系统中,设计周期、硬件和软件的开发是分开进行的,并在硬件完成后才将系统集成在一起,很多情况下,硬件完成后才开始进行实时软件和整体调试。软硬件联合仿真是一种在物理原型可用前,能尽早开始调试程序的技术。
软硬件联合仿真有可能使软件设计工程师在设计早期着手调试,而采用传统的方法,设计工程师直到硬件设计完成才能进行除错处理。有些软件可在没有硬件支持的情况下完成任务的编码,如不涉及到硬件的算法。与硬件相互作用的编码在获得硬件之前编写,但只有在硬件上运行后,才能真正对编码进行调试。通过采用软硬件联合仿真技术,可在设计早期开始这一设计调试过程。由于软件的开发通常在系统开发的后段完成,在设计周期中较早的开始调试有可能将使这一项目提早完成,该技术会降低首次将硬件和软件连接在一起时出现意外而致使项目延期完成所造成的风险。
在取得物理原型前,采用软硬件联合仿真技术对硬件和软件之间的接口进行验证,将使你不会花太多的时间在后期系统调试上。当你确实拿到物理原型开始在上面跑软件的时候,你会发现经过测试的软件部分将会正常工作,这会节省项目后期的大量时间及努力。
软硬件联合仿真系统由一个硬件执行环境和一个软件执行环境组成,通常软件环境和硬件环境都有自己的除错和控制界面,软件通过一系列由处理器启动的总线周期与硬件的交互作用。本文以一个Mini Web卡的开发介绍一种软硬件联合仿真系统。
该方案的核心是采用一个51单片机仿真引擎GoldBull ISS51(以下简称ISS51),ISS51是51单片机开发环境Keil uVision2的一个插件,ISS51具有连接Keil和硬件仿真环境Modelsim的接口,可以实现软硬件同步仿真。在该系统中,Keil作为软件调试界面,Modelsim作为硬件仿真和调试界面,ISS51负责软件执行、监控软件断点、单步执行、内存和寄存器数据返回给Keil、CPU总线时序产生和捕获、内部功能模块(如定时器,串口)的运行等功能。
Mini Web卡介绍
Mini Web卡是一个运行在单片机上的Web服务器,提供网口连接,有大容量文件系统,提供TFTP和HTTP服务。尽管软件系统比较复杂,但优化编译后,执行代码还不足25K,为后续升级留下了足够空间。51CPU采用SST89系列,这种CPU具有ISP功能,可以通过RS232串口,直接将目标码下载到CPU。
DMA控制逻辑是一个可编程逻辑器件,采用的是ALTERA的CPLD EPM240,主要功能是实现外围器件之间的DMA传递。因为51CPU进行IO访问是很低效的,需要24个时钟周期才能进行一次IO访问,在外围设备之间转移数据则需要更多的时钟周期,使用DMA控制逻辑可以达到3个时钟周期就能转移一个字节。本系统中处理多种网络协议,需要大量报文收发和文件系统访问,采用DMA可以极大地提高51单片机的数据处理速度。DMA通道主要有MAC芯片与RAM之间的数据块转移,SMART MEDIA和RAM之间的数据块转移。
网卡芯片采用的是AX88796,主要的优点是可以和51CPU方便地接口;支持100M以太网,速度高;有较大的接收报文缓存,能够平滑网络流量,减少因51CPU处理速度慢导致的报文丢弃和重发。
SMART MEDIA是一个移动存储卡,主要用于存储文件,Mini Web卡支持8M到256M的SMD卡。
文件系统是Mini Web卡的新开发模块,文件系统的测试主要通过TFTP来进行,为此Mini Web卡上的TFTP服务程序进行了特殊设计,支持格式化SMART MEDIA,获取剩余空间,获取文件名列表,上传、下载和删除文件。
软硬件联合仿真的必要性:
Mini Web卡软件模块多,软件开发风险较大。软件对硬件的依赖较强,FLASH存储器的访问驱动、网卡驱动、DMA驱动,需要软硬件协同调试。
文件系统的开发,在仿真环境下更容易和快捷。比如在仿真结束时,可以将SMART MEDIA仿真模型中的数据倒换到磁盘文件中,在仿真开始时,将磁盘文件中的数据加载到SMART MEDIA仿真模型中,在定位文件系统的问题时,这一个功能很有用。
采用软硬件联合仿真,便于系统前期设计。51单片机的外部RAM访问效率较低,内存拷贝、外部器件之间的数据块转移很浪费时间。将大量数据的拷贝操作或数据块校验、比较操作在CPLD内实现,可以大大改进51单片机处理数据的能力。通过软硬件联合仿真,可以评估CPLD处理数据对性能的改进。
Mini Web卡软硬件联合仿真系统:
软硬件联合仿真主要解决的问题是系统功能设计与验证
,它不解决电源、滤波电容、总线电平兼容问题。
做系统仿真,首先要对硬件系统建模。我们关注的是系统设计的正确性和可执行性。
系统中的串口只是用来支持ISP下载软件,软件部分没有对串口做任何操作,所以系统仿真可以不必考虑。
网卡芯片AX88796,厂商没有提供仿真模型。它与CPU的接口符合ISA接口标准,软件对AX88796的操作是根据NE2000标准网卡芯片设计的,由此我们建立了一个网卡芯片的仿真模型。我们设计了一个MAC BFM来仿真网卡芯片的ISA接口,NE2000定义的寄存器在C模型中实现,MAC BFM与NE2000寄存器C模型通过PLI接****换数据。
SRAM仿真模型是很容易获取的,很多器件生产商都提供Verilog仿真模型,但器件生产商提供的Verilog仿真模型都包含复杂的延时控制代码,这会影响仿真速度。根据经验,我们可以确保SRAM在单板设计中被正确应用,不会产生时序问题,所以我们可以采用一个简化的SRAM仿真模型,这是我们自己设计的,有效代码只有十几行。
51CPU BFM 负责单片机管脚时序的产生和捕获。51CPU BFM是与ISS51紧密捆绑的,由ISS51安装SMART MEDIA是三星公司提供的仿真模型,我们使用的也是三星公司的同类型存储卡。该模型可以用于验证软件操作SMART MEDIA的正确性和DMA Controller的接口时序。
DMA Controller是Mini Web卡硬件开发的一部分,将逻辑设计代码应用于仿真,既能检测逻辑设计的正确性,又能使整个仿真系统得以正常运转。
将上述硬件模型连接起来,产生下图所示硬件系统模型图:
图2. Mini Web卡硬件模块电路图
图2中U11为SMART MEDIA仿真模型,U4为DMA Controller模型。
虚拟网卡
做系统仿真,必须输入来自真实世界的激励,并将仿真系统的输出传递到真实世界。即便是不能连接到真实世界,也应该提供模拟真实世界的输入,并对仿真系统的输出进行检测和分析。
对于Mini Web卡来说,它和真实环境是通过网口连接的。使用虚拟网卡技术,能够将图3中的MAC C Model与虚拟网卡进行通讯。
对于运行在Windows系统上的应用程序来说,它并不知道网卡是虚拟的还是真实的,应用程序通过虚拟网卡收发数据,事实上是与仿真系统在进行网络通信。
这样就可以使用TFTP向Mini Web卡仿真系统传递网页文件,使用IE浏览Mini Web卡仿真系统中的网页,Mini Web卡的所有功能都能够被检验。
使用网络臭探器Sniffer可以监控虚拟网卡的报文流,方便协议调试。
仿真加速技术
软硬件联合仿真,影响仿真速度的瓶颈在HDL代码部分的仿真。如果不设法提高HDL代码部分的仿真速度,软件调试就非常低效。
提高硬件仿真速度的方法之一是软件硬件仿真采用事件同步,只在CPU访问IO时保持软件和硬件是同步的。
仿真加速方法之二是硬件仿真系统时钟休眠。对于Mini Web卡来说,只有DMA Controller是受时钟控制的,软件没有操作DMA Controller的期间,DMA Controller的运作是毫无意义的,所以可以在非DMA操作期间,对时钟进行休眠;ISS51在每次IO访问时,给出与上次IO访问的时间差,这个时间差经过处理可以作为时钟休眠的时间段。如果ISS51连续进行IO访问,就不会产生时钟休眠了。DMA Controller工作于查询方式,可以采用时钟休眠技术,而不会导致仿真与真实结果的不一致。方法之三是,缩短SMART MEDIA仿真模型中的一些长延时的时间参数。因为在等待SMART MEDIA进入就绪状态时,CPU必须连续查询IO,影响仿真速度。我们主要用于软件功能验证,这种修改也是可以接受的。
方法之四,在软件设计上,谨慎使用外部中断,因为一旦中断启动,ISS51需要在每个机器周期查询是否有中断信号,导致软件仿真和硬件仿真在每个指令上都进行同步,影响仿真速度。如果一定要使用外部中断,建议用C模型代替Verilog模型,这样可不影响仿真速度;或者由用户根据外部模块产生外部中断的时机,使用ISS51的控制命令,在恰当时刻使能ISS在一个普通PC (CPU为AMD速龙1000,SDRM512M 133),运行Mini Web卡仿真系统,使用PING命令测试Mini Web卡仿真系统的响应速度:
Reply from 10.10.112.76: bytes=32 time=64ms TTL=128
使用IE打开Mini Web卡仿真系统中的网页文件,感觉和拨号上网的速度差不太多。创建多个TFTP连接,同时向仿真系统传递或下载网页文件,同时使用IE进行网页浏览,都无响应中断现象出现。
总结
使用软硬件联合仿真,Mini Web卡不需要硬件就能进行全部功能的仿真,增强了系统设计成功的信心。软硬件联合仿真方便系统设计调整,可以在设计前期评估性能,方便软件和硬件的debug,是一个值得推广的技术。
已经发你邮箱了