南理工电科专业毕业设计外文资料 单片机数据采集器
外文文献翻译- 基于单片机的频率计设计本科学位论文

原文:This design take at MCS-51 monolithic integrated circuit as the core full use hardware source design's one kind of frequency meter, this frequency meter will be measured first that signal enlargement reshaping processing, turns satisfies TTL/which the monolithic integrated circuit I/O mouth accepts the CMOS compatible signal from monolithic integrated circuit's T1 input port input direct summation pulse number, the monolithic integrated circuit interior timer fixed time is 1S, by now accumulated the pulse number namely for is measured the signal the frequency. Finally passes through monolithic integrated circuit processing to deliver to the lcd liquid crystal display monitor demonstration.Central Processing Unit DesignsThe CPU is the key component of a digital computer. Its purpose is to decode instruction received from memory and perform transfers, arithmetic, logic, and control operations with data stored in internal registers, memory, or I/O interface units. Externally, the CPU provides one or more buses for transferring instructions, data, and control information to and from components connected to it. In the generic computer at the beginning of chapter 1, the CPU is a part of the processor and is heavily shaded. CPUs, however, may also appear in computers. Small, relatively simple computers called microcontrollers are used in computers and in other digital systems to perform limited or specialized tasks. For example, a microcontroller is present in the keyboard and in the monitor in the generic computer; thus, these components are also shaded. In such microcontrollers, the CPU may be quite different from those discussed in this chapter. The word lengths may be short (say, four or eight bits),the number of registers small, and the instruction sets limited. Performance, relatively speaking, is poor, but adequate for the task. Most important, the cost of these microcontrollers is very low, making their use cost effective.In the following pages, we consider two computer CPUs, one for a complex instruction set computer (CISC) and the other for a reduced instruction set computer (RISC). After a detailed examination of the designs, we compare the performance of the two CPUs and present a brief overview of some methods used to enhance that performance. Finally, we relate the design ideas discussed to general digital system design.1、T he complex instruction set computerThe first design we present is for a complex instruction set computer with a non-pipelined datapath and microprogrammed control unit. We begin by describing the instruction set architecture, including the CPU register set, instruction formats, and addressing modes. TheCISC nature of the instruction set architecture is demonstrated by its memory-to-memory access for data manipulation instructions, eight addressing modes, two instruction format lengths, and instructions that require significant sequences of operations for their execution.We design a datapath for implementing the CISC architecture. The datapath is based on the one initially described in Section 7-9 and incorporated into a CPU in section 8-10. modifications are made to the register file, the function unit, and the buses to support the present instruction set architecture.Once the datapath has been specified, a control unit is designed to complete the implementation of the instruction set architecture. The design of the control unit must involve a coordinated definition of both the hardware organization and the microprogram organization. In particular , dividing the microprogram into microroutines, while at the same time designing the sequencer with which they interact, is a key part of the design. Even the instruction fields and opposed are tied to this coordinated effort. Following the definition of the hardware and microcode organizations, we detail essential parts of the microcode and the microroutines for representative operations.Instruction set architectureFigure 10-1 shows the CISC register set accessible to the programmer. All registers have 16 bits. The register file has eight registers, R0 though R7.R0 is a special register that always supplies the value zero when it is used as a source and discards the result when it is used as a destination.In additional to the register file, there is a program counter PC and stack pointer SP. The presence of a stack pointer indicates that a memory stack is a part of the architecture . the final register is the processor status register PSR, which contains information only in its rightmost the five bits; the remainder of the register is assumed to contain zero. The PSR contains thefour stored status bit values Z,N,C,and V in positions 3 through 0, respectively. In additional, a stored interrupt enable bit EI appears in position 4.Table 10-1 contains the 42 operations performed by the instructions. Each operation has a mnemonic and a carefully selected oppose. The operations are divided into four groups based on the number of explicit operands and whether the operation is branch. In addition, the status bits affected by the operation are listed.Figure 10-2 gives the instruction formats for the CPU. The generic instruction format has five fields. The first, OPCODE, specifies of the operation. The next two, MODE and S , are used to determine the addresses of the operands. The last two fields, SRC and DST, are the 3-bit source register and destination register address fields, respectively. In addition, there is an optional second word W that appears with some instructions as an operand or an address, but not with others.The first two bits of OPCODE, IR(15:14), determine the number of explicit operands and how the fields of the format are used. When these bits are 00,either no operand is required or the location of the operand is implied by OPCODE. Only the OPCODE field is needed, as shown in figure 2(b).the four rightmost OPCODE bits can specify up to 16 operands or with implied operand addresses.If IR(15:14) is 01, the instruction has one operand and is a data transfer or data manipulation instruction. Since there is an operand, the MODE field specifies the addressing mode for obtaining it. The single address may involve the DST register address in its formation, so the DST field is also present. The S field and SRC field relate to the presence of two operands and so are not used for the typical single operand instructions. but, the shift instructions require a shift amount to indicate how many bits to shift. For maximum flexibility,this shift amount is treated just like a source operand. As a consequence, the SHA and S fields is a full 16-bit operand, but only values 0 through 15 are meaningful. There are sufficient OPCODE bits for 16 instructions with a single operand.Table 10-2 gives the addressing modes specified by the MODE field. The first two bits of MODE specify four different types of addressing: register, immediate, indexed, and relative to the PC. The third bit of MODE specifies whether the address generated by these modes is used as an indirect address. The one exception to this is direct addressing, which is obtained by applying indirection to the immediate type. Otherwise, if the third bit equals 0, indirect addressing does not apply whereas, if it equals 1, indirect addressing does apply. For the register type of instruction, MONE(2:1)=00 and the W word is not needed. Since the operand or address comes from a register. The third column of the table provides register transfer statements for each of the addressing modes for the one-operand instructions.If IR(15:14) is equal to 10, then the instruction has two addresses used for true operands. All fields of the generic instruction, including S and SRC, are used for this case for all instructions. one of addresses, either the source or the destination, uses the addressing modes. If S=0, then the source uses the addressing mode specified by MODE, and the source is a register. If S=1, then the destination uses the addressing mode, and the source is a register. Register transfer descriptions of the resulting addresses are given in the fourth and fifth columns of Table 2. Again, depending on the contents of the MODE field, the second instruction word W, which is an address or an immediate operand, may or may not be present.Instructions with IR(15:14)=11 are branches. Aside form the S field and the SHA field for shifts, the format is the same as for IR(15:14)=01. For all instructions of this type, the destination address (not the operand) becomes the new address placed in the program counter PC. As a consequence, the register mode is invalid for branch instructions.Before proceeding to the next step, which defines the datapath to support the instruction set architecture, we will briefly note the characteristics of the architecture that define it as CISC or RISC. Most of the operations given in Chapter 9 are included in the instruction set. A number of operations that do not appear are redundant. The same actions can be achieved by using proper addressing modes with instructions that do appear. For example, LD, ST, IN, and OUT can all be achieved by using MOVE instructions in a memory-mapped structure. By looking at the formats for the instructions, we find that most of the instructions can operate directly on operate directly on operands from memory. There are eight addressing modes and two different lengths of instruction formats. In addition, some of the instructions perform complex operations which can be viewed as operations that are likely to take more than one clo ck cycle for the execution step. These characteristics clearly identify this as a CISC architecture.Datapath organizationRather than beginning from scratch, we will reuse the non-pipelined datapath employed with the microprogrammed control in section 8-10, with modifications. That datapath was shown in section 8-10, and the new, modified datapath based on it is given in Figure 10-6. we treat each modification in turn, beginning with the register file.In section 8-10, register R8 was used as a temporary storage location. In the new microprogrammed architecture, there are complex instructions spanning many clock cycles and performing complicated operations. Thus, more temporary storage is needed for use by the microprograms. To meet this need, we expand the register file from 9 registers to 16. the first 8 registers, R0 through R7, are visible to the computer programmer. The second 8 registers, R8 though R15 , are used as temporary storage for the microprogram operands and are hidden from the programmer. Figure 10-3 provides a map of the expanded register file with the temporary registers shaded. As indicated previously, register R0 supplies the constant 0. registers R1 through R7 are available to the programmer for use, and registers R8 through R15 provide general temporary storage for use by microprograms, the last four registers, R12 though R15, have special uses: to keep the microcode simple, standard locations are essential for storing the operands and addresses used by execution microcode for most instructions. thus ,R12 is the location for the source address(SA), R13 for the source data (SD), R14 for the destination address(DA), and R15 for the destination data(DD).We cannot access the eight temporary registers based on the 3-bit register address available in the instruction. To deal with this problem, we provide, first, 4-bit register address from the microinstruction, and second, a microinstruction bit to choose between these addresses and those from the instruction. In addition, the flexibility to allow the register addressed by DST to be a source and by SRC to be a destination is needed to permit results ofoperations to be placed directly in memory. To accomplish these goals, we modify the register file by adding the logic shown in Figure 10-4(a). the instruction set architecture uses two addresses, one for a source a operand and the other for the other source as well as the destination. The register file uses the B address for a source, and the A and D addresses on the file are connected together, giving the same address for the other source and the destination. Although this reduction from three to two addresses is not essential at the mincroinstruction level, it decrease the number of bits needed for register addresses in the microinstruction and matches the use of the register fields in the instruction formats.A quad 2-to-1 multiplexer is attached to each of the two address inputs to the register file, to select between an address from the microinstruction and an address from the instruction. There is a 5-bit field in the microinstruction for the combined destination and source address DSA, in addition to a 5-bit field for theB address SB. The first bit of each of the these fields selects between the register file address in the microinstruction(0) and the register file address in the instruction(1). If an instruction address is selected, whether it is DST or SRC is determined by an additional quad 2-to-1 multiplexer. This multiplexer is controlled by the second bit of the DSA or SB fields, depending on which of them has 1 in the first bit in any microinstruction, thereby ensuring that the proper second bit is used to determine the register address. A 0 is appended to the left of the 3-bit fields DST and SRC to cause them to address R0 through R7. the addition to the first bit, which selects the address source, the addresses from the microinstruction contain four bits so that all 16 registers can be reached. The final change to the register file is to replace the storage elements for R0 in the file with open circuits on the lines that were their inputs and with constant zero valves on the lines that were their outputs. A symbol for the resulting register file is show in Figure 10-4(b).We find that, based on the eight shift instructions provided, the shifter from section 8-10, needs to be modified. The modifications involve the end bits of the shift logic. For logical shifts, a 0 is inserted, as before. For the right arithmetic shift, she sign bit is the incoming bit, and for the left arithmetic shift, 0 is the incoming bit. Rotates require that the bit from the opposite end of the shifter be fed around. Finally, rotates with carry require that the carry flip-flop output be provide as an input on both ends of the shifter.2.SummaryIn this paper.we examined two CPU designs: the CISC and RISC.The CISC control unit includes a stack pointer in addition to the program counter.Control microprograms reside in ROM.and a combination of a multi.plexer and a ROM provides fast instruction decoding.The control unit also has extensive{ump andconditional branching capabilities,including one level of microsubroutines.The microprogram for the control is modularized to permit many microsubroutines to be shared in implementing the microprogram for the instructions.The RISC control unit is pipelined and has special hardware added to deal with branches. Pipelined CPUs have both data and control hazard problems.We examined one of each type of hazard,as well as software and hardware solutions for each.After discussing CISC and RISC performance,we touched on some advanced concepts, including parallel execution units, a combination of microprogrammed control with a pipeline,superpipelined CPUs, superscalar CPUs,and predictive and speculative techniques for high-performance.Finally, we related the design techniques in this paper to more general digital system design.原文翻译:本设计以MCS-51单片机为核心充分利用硬件资源设计的一种频率计,该频率计首先将被测信号放大整形处理,变成满足单片机I/O口接受的TTL/ CMOS 兼容信号从单片机的T1输入口输入直接累加脉冲数,将单片机内部定时器定时为1S,这时累加的脉冲数即为被测信号的频率。
毕业设计(论文)-基于fpga的数据采集器[管理资料]
![毕业设计(论文)-基于fpga的数据采集器[管理资料]](https://img.taocdn.com/s3/m/bb5557377f1922791788e838.png)
引言数据采集是获取信息的基本手段。
数据采集技术作为信息科学的一个重要分支,是以传感器、信号测量与处理、微型计算机等技术为基础而形成的一门综合应用型技术。
数据采集作为现代测控技术的基础,己经广泛应用于工业生产、科学研究的诸多领域。
在工业生产中,应用数据采集系统可以得到工业现场的温度、湿度、电压、电流等技术参数,所得结果可以反馈给用户和控制系统,为提高产品质量、降低成本提供信息;在科学研究方面,数据采集可以提供大量的现场信息,成为探索科学奥秘的重要手段[1]。
如何对信号进行实时采集、实时存储,保证信号不丢失,以满足工业现场的需要,一直是数据采集系统研究的一个重要方向。
国外方面[2][3][4],随着国外微电子技术、计数机技术、测控技术和数字通信技术的发展,目前国外数据采集技术已经较初期有了很大的发展。
从近来国外公司展示的新产品可以看出,主要的发展可以概括为功能多样,体积减小和使用方便等三个方面。
国外在研制和使用数据采集系统方面发展迅速,基于MedWin技术的数据采集器也发展较深,在体积和性能具有很大优势得采集器多以FPGA为平台,但价格相对来说就不具有竞争力。
成本较低的数据采集系统多以单片机为主芯片,但是在性能和速度方面就不具有优势。
目前国外的数据采集方面的研究主要着重于传感器,高精度、高速度的传感器层出不穷而且在价格上有了很大进步。
比如美国尼高力仪器技术公司08年生产的2700型数据采集器,完美地将数据记录仪、程控开关与数字表的优势集于一身,是一款高精度、多功能、使用方便的多路数据采集器。
同年惠普公司生产的HP34970A 型数据采集器具有6/12位分辨率,0.004%基本直流精确度和高达250通道/秒的扫描率,非易失性存储器可保存多达50000个带有时间标记的读书,可测包括直流电压、交流电压等等数据。
虽然这些数据采集器的功能无比强大,但是成本都较昂贵。
国内方面[5][6][7],国内数据采集器与目前国外数据采集器相比,在技术上仍然存在着一定的差距,主要表现在:①由于受国内振动等传感器水平的限制,分析频率范围不宽,在工业方面给一些低速的机器或轴承的诊断等带来了一定的困难;②由于数据采集器的内存不大,数据采集器本身的信号处理功能不强,在现场只能做一些简单诊断,精密诊断需要离线到计算机上去做,现场精密诊断功能较弱;○3设备的软件水平,仍在设备维修管理和基本频谱分析上徘徊,机器故障诊断专家系统还需完善,软件人机界面有待改进④设备的性能与成本的协调还缺乏一定的优势。
基于单片机的数据采集系统设计本科生

基于单片机的数据采集系统设计本科生摘要:数据采集系统是信息技术广泛应用于各个领域的一项重要技术。
本文介绍了基于单片机的数据采集系统的设计过程和实施方法。
该系统使用单片机作为主控芯片,通过传感器采集环境中的数据,并通过通信接口将数据传输给上位机进行分析和处理。
本文详细介绍了系统的硬件设计和软件实现,同时对系统的性能进行了测试和分析。
实验结果表明,该系统具有较高的数据采集效率和较好的稳定性,可以在各个领域中广泛应用。
1.引言随着科技的不断发展,数据采集系统已经被广泛应用于各个领域,如工业自动化、环境监测、医疗健康等。
数据采集系统的设计对于实现数据的准确采集、处理和分析具有重要意义。
基于单片机的数据采集系统由于其成本低、体积小和易于实现等特点被广泛应用。
本文主要介绍了一种基于单片机的数据采集系统的设计和实施过程。
2.系统硬件设计2.1主控芯片的选择本系统使用单片机作为主控芯片,根据具体的应用需求选择合适的单片机。
主控芯片需要具备较强的处理能力、丰富的接口和良好的稳定性。
常见的单片机有AVR单片机和51单片机等,本文选择AVR单片机进行设计。
2.2传感器的选择与接口设计根据实际应用需求,选择合适的传感器,并设计相应的接口电路连接到主控芯片。
传感器可以是光电传感器、温湿度传感器、气体传感器等。
通过传感器可以实时采集环境中的各种数据,并通过接口电路将数据传输给主控芯片。
2.3数据存储和传输设计为了实现数据的存储和传输,需要设计相应的存储器和通信接口。
可以使用EEPROM作为数据存储介质,通过串口通信或无线通信将数据传输给上位机进行后续处理。
同时,为了保证数据的稳定传输和防止数据丢失,可以设计相应的纠错机制和重发机制。
3.系统软件实现3.1系统初始化在系统初始化过程中,需要对主控芯片和传感器进行初始化,包括引脚设置、时钟配置、中断设置等。
3.2数据采集和处理在数据采集和处理过程中,主控芯片通过接口电路和传感器进行数据采集,并对采集到的数据进行预处理和滤波处理,以确保数据的准确性和可靠性。
单片机数据采集课程设计

单片机数据采集课程设计一、课程目标单片机数据采集课程设计旨在让学生掌握以下知识目标、技能目标和情感态度价值观目标:1. 知识目标:(1)理解单片机的原理和功能,掌握其内部结构和基本工作原理;(2)了解数据采集的基本概念,掌握常用传感器的工作原理和接口技术;(3)掌握单片机与传感器之间的数据传输和处理方法。
2. 技能目标:(1)能够运用所学知识设计简单的数据采集系统,完成传感器与单片机的连接和编程;(2)具备分析数据采集过程中出现的问题,并提出解决方案的能力;(3)能够使用相关软件对数据采集系统进行调试和优化。
3. 情感态度价值观目标:(1)培养学生对单片机及数据采集技术的兴趣,激发其探索精神;(2)培养学生团队协作意识,提高沟通与协作能力;(3)使学生认识到单片机数据采集技术在工程实践中的应用价值,增强其社会责任感。
本课程针对高年级学生,他们在前期课程中已具备一定的电子技术和编程基础。
课程性质为理论与实践相结合,注重培养学生的实际操作能力和解决问题的能力。
在教学过程中,教师需关注学生的个体差异,提供针对性的指导,确保学生能够达到预期的学习成果。
通过本课程的学习,学生将能够独立完成单片机数据采集系统的设计、搭建和调试,为后续相关课程和实际应用打下坚实基础。
二、教学内容根据课程目标,教学内容主要包括以下几部分:1. 单片机原理与结构- 教材章节:第1章 单片机基础- 内容:单片机的基本概念、内部结构、工作原理及指令系统。
2. 常用传感器及其接口技术- 教材章节:第2章 传感器与接口技术- 内容:温度传感器、湿度传感器、光敏传感器等的工作原理及接口技术。
3. 数据采集系统设计- 教材章节:第3章 数据采集与处理- 内容:数据采集的基本概念、模数转换器(ADC)的原理与应用、数据传输与处理方法。
4. 单片机编程与调试- 教材章节:第4章 单片机编程与调试- 内容:单片机编程语言(C语言)、编程技巧、程序下载与调试方法。
单片机数据采集系统设计(仅供参考)

镇江高专ZHENJIANG COLLEGE毕业设计(论文)单片机数据采集系统设计The data acquisition system based on the single chip computer系名:电子与信息系专业班级:学生姓名:学号:指导教师姓名:朱本坤指导教师职称:教授2012年5月20日前言单片微型计算机简称单片机,又称为微控制器(MCU),它的出现是计算机发展史上的一个重要里程碑,它以体积小、功能全、性价比高等诸多优点而独具特色,在工业控制、尖端武器、通信设备、信息处理、家用电器等嵌入式应用领域中独占鳌头。
51系列单片机是国内目前应用最广泛的一种8位单片机之一。
经过20多年的推广与发展,51系列单片机形成了一个规模庞大、功能齐全、资源丰富的产品群。
随着嵌入式系统、片上系统等概念的提出和普遍接受及应用,51单片机的发展又进入了一个新的阶段。
许多专用功能芯片的内核集成了51单片机,与51系列单片机兼容的微控制器以IP核的方式不断地出现在FPGA的片上系统中。
而随着时代的发展单片机的应用主要表现在以下5个领域:1. 单片机在智能仪器仪表中的应用;2. 单片机在工业测控中的应用;3. 单片机在计算机网络和通讯技术中的应用;4. 单片机在日常生活及家电中的应用;5. 单片机在办公自动化方面。
目前单片机渗透到我们生活的各个领域,几乎很难找到哪个领域没有单片机的踪迹。
导弹的导航装置,飞机上各种仪表的控制,计算机的网络通讯与数据传输,工业自动化过程的实时控制和数据处理,广泛使用的各种智能IC卡,民用豪华轿车的安全保障系统,录象机、摄象机、全自动洗衣机的控制,以及程控玩具、电子宠物等等,这些都离不开单片机。
更不用说自动控制领域的机器人、智能仪表、医疗器械了。
因此,单片机的学习、开发与应用将造就一批计算机应用与智能化控制的科学家、工程师。
因此,学习好单片机对我们来说是一件很重要的事情!单片机数据采集系统设计专业班级:学生姓名:指导教师:朱本坤职称:教授摘要:本设计采用了MCS-51系列单片机较为经典的AT89C51芯片,根据系统需求,设计了以AT89C51为核心芯片的硬件电路,系统扩展了8155、程序存储器、数据存储器和A/D转换器等,其中,ADC0809转换器将模拟信号转换成数字信号,由单片机采集这些信号,并存储到数据存储器中,同时送到显示器,在显示器上显示采集信号的结果。
基于STM32单片机的存储式数据采集系统设计

Vo 1 . 21 No . 1 7
电子设 计工 程
El e c t r o n i c D e s i g n En g i n e e r i n g
2 0 1 3年 9月
S e p .2 01 3
ห้องสมุดไป่ตู้
基于 S T M3 2单 片机 的存储 式数据 采集 系统设计
的 信 号 进 行放 大 , 利用s T M3 2单 片 机 的 片 内 A D C将 采 集 数 据 进 行 M D转 换 后 , 对数据进行软件 滤波 。 然后 保 存 到 片 内存储 器 中 ; 当数 据 达 到 一 定 量 之 后 。 将 转 换 数 据 转 移 至 外存 储 器 中 。 为 了 实现 体 积微 小 型 化 , 系统 采 用片 内 A D C实
me mo  ̄. I n o r d e r t o a c h i e v e t h e v o l u me o f mi c r o - mi n i a t u iz r a t i o n ,t h e s y s t e m u s e d c h i p ADC i n A/ D c o n v e te r r t o mi n i mi z e t h e
Ab s t r a c t :I n o r d e r t o S o l v e t h e p r o b l e m o f u n a b l e t o c o l l e c t t h e s i g n a l i n l e a d me a s u r e me n t ,d e s i g n,t h e d e s i g n o f a d a t a
d a t a i s s a v e d t o t h e me mo  ̄c h i p . Wh e n he t d a a t r e a c h e s a c e r t a i n a mo u n t ,t he c o n v e r t e d d a t a i s t r a n s f e r r e d t o t h e e x t e r n a l
毕业设计---基于单片机的数据采集系统设计

摘要本文提出了一种基于多个MCU通信的实时数据采集系统方案,该系统由监控计算机单元,数据处理单元,总线隔离器单元,接收单片机,数据采集单元组成。
数据处理单元与多个现场采集器为点对点的串行通信方式,在数据处理单元内部,各个通道的数据以双CPU并行通行方式进行处理,处理的结果以串行方式送入监控主机;同时在采集单元与处理单元,处理单元与计算机之间采用RS-485总线进行数据的传送;对于采样的数据,通过可编程键盘/显示接口8279芯片对数据进行显示,筛选,转存。
实际运用证明,该方案具有良好的实时性。
[关键词] 数据采集处理系统;单片机(MCU);串行通信;并行通信单片机数据采集系统AbstractThe text brings forward a sort of real-time data collecting system scheme,which is based on multi-MCU corresponding. The system consists of supervising computer cell, data processing cell, overall-insulating cell, incepting SCM and data collection cell. The data processing cell and the multi-field collectors are serial communication which are one point opposite one point. Within the data processing cell, every passage data are processed in double CPU merge-capable transmission fashion. Then, the processing results enter the supervising host computer in strand-capable fashion. At the same time,we transmit data with adopting RS-485 bus between the collection cell and the processing cell, and also between the processing cell and the computer. As to the sampling data, we display the data by programming keyboard /displaying 8279 CMOS chip, as well as filtrating and depositing the data with transferring fashion. Practicality mobilization proves this project has favorable real-time character..Key words: data acquisition and processing system ; Microcontroller unit ;serial data communication ; parallel data communication目录摘要 (I)Abstract (II)目录 (III)CATALOG (IV)第一章引言 .................................................................. 11.1 数据采集系统的组成 ......................................................... 11.2 数据采集系统的应用领域及发展前景............................................ 1第二章概述 ................................................................. 32.1 单片机的组成 ............................................................... 32.2 单片机的分类 ............................................................... 32.3 单片机的特点 ............................................................... 52.4 单片机的应用 ............................................................... 62.5 单片机的发展 ............................................................... 6第三章数据采集系统的硬件组成 ................................................... 103.1 集散式数据采集系统的结构.................................................. 103.2 数据处理器 ............................................................... 133.3 3-8译码器................................................................ 173.4 74LS244 隔离器 ........................................................... 193.5 RS-485总线............................................................... 193.6 键盘/显示控制器8279 ...................................................... 213.7 键盘,显示器工作原理 ..................................................... 23第四章数据采集系统的软件实现 ................................................... 264.1 数据接收器接收,发送数据.................................................. 264.2 数据处理器接收数据 ....................................................... 294.3 主处理器执行中断 ......................................................... 294.4 键盘显示电路 ............................................................. 32结束语 ........................................................................ 39参考文献: .................................................................... 40致谢 ........................................................................... 41附图 ............................................................. 错误!未定义书签。
(完整版)单片机实时数据采集显示系统设计毕业设计

南阳理工学院本科生毕业设计(论文)学院:电子与电气工程学院专业:电气工程及其自动化学生:赵晓婷指导教师:朱清慧完成日期2014年 5 月南阳理工学院本科生毕业设计(论文)单片机实时数据采集显示系统设计Design of Real Time Data Acquisition and DisplaySystemUsing MCU总计:29 页表格:2 个插图:18 幅南阳理工学院本科毕业设计(论文)单片机实时数据采集显示系统设计Design of Real Time Data Acquisition and DisplaySystemUsing MCU学院:电子与电气工程学院专业:电气工程及其自动化学生姓名:赵晓婷指导教师(职称):朱清慧(教授)评阅教师:完成日期:南阳理工学院Nanyang Institute of Technology单片机实时数据采集显示系统设计电气工程及其自动化专业赵晓婷[摘要]本文介绍了单片机控制的实时数据采集系统的硬件和软件设计与仿真过程。
硬件部分设计采用单片机AT89C51、字符液晶显示器(HD44780控制器)、图形液晶显示器(KS0108控制器)以及AD转换器AD1674等组成一个完整的单片机控制系统,并且使用8255A芯片对AT89C51的IO口进行了扩展。
系统程序采用模块化的编程思路,通过C 语言进行编程设计,主要程序为AD转换模块和液晶显示模块。
最后,在Proteus平台上进行了软件与硬件交互仿真,实现了系统各项性能指标要求。
[关键字]实时数据采集;AT89C51;液晶显示;C语言Design of Real Time Data Acquisition and DisplaySystemUsing MCUElectrical Engineering and Automation Specialty ZHAO Xiao-tingAbstract: This paper introduces the design and simulation of system controlled by single chip microcomputer.The uses a single chip AT89C51, character liquid crystal display (HD44780 controller), LCD display (KS0108 controller) and AD converter AD1674 to form a complete microcomputer control system, and using the 8255A chip concept, through the C programming language, the main program for the AD conversion module and liquid crystal display module. Finally, system conducts the software and on the Proteus platform,realizing the requirements of performance indicators about the system.Key words:Real time data acquisition;AT89C51;LCD;C language目录1引言..................................................................2 系统方案设计 ..........................................................2.1 系统设计框图.....................................................2.2 器件的选择.......................................................3 系统硬件组成及接口电路设计.............................................3.1 系统硬件组成.....................................................3.2 系统接口电路设计 (1)3.2.1 AD1674与AT89C51的接口电路 (1)3.2.2 8255A与AT89C51的接口电路 (1)3.2.3 KS0108与8255A的接口电路 (1)3.2.4 HD44780与8255A的接口电路 (1)4 系统软件设计 (2)4.1 系统主程序 (2)4.2 AD1674转换程序 (2)4.3 LCD12864显示程序 (2)4.3.1 温度曲线显示程序 (2)4.3.2 汉字显示程序 (2)4.4 LCD1602字符显示程序 (2)5系统仿真 (2)5.1 软件介绍 (2)5.2 Proteus仿真 (2)结束语 ................................................. 错误!未定义书签。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
First Experience with the Scalable CoherentInterfaceH.MüllerECP Division, CERN, CH 1211 Geneva 23SwitzerlandandA.Bogaerts 1,J.Buytaert 1,R.Divià 1 , A.Ivanov 2 , R.Keyser 1, F.Lozano-Alemany 3 , G.Mugnai 1 ,D.Samyn 1,B.Skaali 4RD24 Collaboration, CERN, CH 1211 Geneva 23, Switzerland Abstract:The research project RD24 [11] is studying applications of the Scalable Coherent Interface (IEEE-1596) standard for the large hadron collider (LHC). First SCI node chips from Dolphin were used to demonstrate the use and functioning of SCI’s packet protocols and to measure data rates. We present results from a first,two-node SCI ringlet at CERN, based on a R3000 RISC processor node and DMA node on a MC68040 processor bus. A diagnostic link analyzer monitors the SCI packet protocols up to full link bandwidth. In its second phase, RD24 will build a first implementation of a multi-ringlet SCI data merger.I. BASICS of SCISCI [1] provides bus like features between SCI nodes in a ringlet.Point-to-point links interconnect the inputs and outputs of SCI nodes (fig1). These transmit incoming packets either to the output link, or direct them into an input FIFO. Packets which are generated by user-logic on the Cbus [2] side are queued in an output FIFO until the bypass FIFO is empty. In this way, several nodes in a ringlet may be receiving and transmitting simultaneously at the intrinsic node-chip speed to achieve a ringlet bandwidth which is significantly higher than the node chip bandwidth SCI links transport packets as shown schematically in fig 2. A flag signal delimits packets which are composed of data or control symbols, clocked at every transition of the SCI clock. The 16 bit wide link of a GaAS NodeChip™ [3] from Dolphin transmits one 16 bit symbol every 2 ns, resulting in a raw link bandwidth of 1 Gbyte/s. SCI packets are framed by a header, containing address and command fields, and a CRC trailer. Transactions consist of two subactions: during the request subaction a packet containing address, command and optionally data is sent to a responder node. After it’s intrinsiclatency, the responder starts the response subaction, which in case of a read transaction returns data via a response packet. Typical transactions, implemented in the first node chips are: read/write cached or noncached 64 byte, read/write 1 to 16 byte noncached, and move 64 byte transactions. SCI uses 64 bit addresses. The upper 16 bits specify the node-identifier within a 64K node address space.1. CERN, Geneva Switzerland2. IHEP Protvino, Russia3. Universidad Politecnica de Madrid, Spain4. University of OSLO,Physics Department, NorwayFigure 1: Nodes and RingletsFigure 2: Signals and PacketsThe remaining 48 bits are the internal byte address in that node. SCI complies fully with the IEEE 1212 CSR standard [4].II. A PREVIEW of SCI for DATA ACQUISITIONData acquisition systems in High Energy Physics experiments are faced with increasing demands in size and data rates. New approaches are being investigated [5] within a series of research projects. The project RD24 has demonstrated that SCI can be used to build systems which scale in size and performance beyond the limits of conventional bus systems. The first experience gained with the construction of a multi-node SCI ringlet system, including the design of prototype SCI processor and memory nodes allows us to preview the possibility to build large and uniform SCI systems with the following advantages: • Data rates beyond 100 Mbyte/s per individual channel• Link speeds at 1 Gbyte/s• Simultaneous (split) transactions between nodes• Shared memory or data-driven systems• Short and long distances• VLSI chips with both requester and responder protocols• Optional use of caches and cache-coherency to reduce latencies and avoid event copies As a first SCI implementor, RD24 investigates in several project phases, the applicability of SCI to key areas of Data Acquisition Systems. The areas of interest for application of SCI in a typical Data Acquisition system are shown in fig 3:1) Access to numerous data buffers after first reduction and compression processors, typically dual ported memories2) High rate data collection over distance using optical fibers3) Crossover network to coherently build events from randomly distributed event fragmentsFigure 3: Data Acquisition areas for SCIA. Multiple Ringlet DAQ SystemSeveral physical SCI implementations are becoming available shortly to allow design of multi-ringlet SCI systems for data collection (merging ) of high rate data over distance (fig 4). High rate HEP experiments can use SCI ringlets to merge SCI data streams over optical SCI fibers from distributed detector sources. CPU farms, investigating event by event in real time, can be interfaced via SCI-processor interfaces. Data from the detector’s digitizing stages can be connected via CMOS SCI ringlets. These low cost nodechips [2], initially capable of 100 MByte/s, roughly match the 1.4 Gigabit/s speed of already existing GiGa chips [9] for serial encoding of 16/17 bit data over coaxial cables or optical fibers. In order tobuild a first, multi-ringlet SCI data merger, RD24 has designed prototypeSCI nodes with the following characteristics:• SCI to memory node• DMA node for dual ported memories• I/O node via a firmware driven RISC processorFigure 4: SCI Data MergerFor a complete implementation in experiments at CERN, work in RD24is continuing with the following design projects:• optical SCI-Fiber ringlet• SCI -Fiber to copper bridges• transparent processor interfaceB. Bandwidth exploitation of SCI ringletsThe bandwidth of an SCI ringlet has an upper limit given by a saturation at around 1.5 times the link bandwidth of a nodechip. In practice, the ratio of packet overhead to packet data reduces the available thoughput,depending on the packet protocols in use (table 1). A high bandwidth SCI data merger makes best use of SCI using the move protocols. For instance, the dmove64 protocol uses 64 byte packets which, unlike most other SCI transactions, have no response subaction. The implementation of a data driven DAQ system, based on dmove64 write transactions, generated by SCI nodes at the data sources is an obvious goal of RD24. We have so far successfully designed a DMA node using the dmove protocols and achieved data transfer rates in excess of 100 Mbyte/s .TABLE 1. Bandwidth percentage of different SCI transactions C. InterfacingBoth transparent and I/O optimized interfaces are required for the online data processing architectures of Data Acquisition Systems. RD24 decided to keep it’s first interface design projects as flexible as possible and to take a firmware approach which can be easily extended or modified. In order to compensate for speed losses due to this software approach, we used a RISC processor as programmable state machine between an SCI node chip and an application bus.D. SCI links The transfer over parallel SCI copper cables is limited in distance due to skew requirements in the sub-nanosecond range. The twin-coaxial cables 1 used for the GaAs ringlet at CERN are manufactured with a PCB design correction of skew times and allow for a length of 10-12 meters, staying within the 250 ps skew requirements of SCI. Ringlets with distances beyond 12 m can however be implemented via a serialization of SCI, i.e. transmission over either coaxial cable or optical fibers (fig.5 ). The 17 bit mode of the 1.4 Gbaud HDMP [7] receiver/transmitter GiGa chips,connected to 17 link signals of a parallel SCI link of a node chip is a first two-chip approach to implement long distance SCI ringlets with a performance at around 100 Mbyte/s. The direct output of the GiGa-chipscan drive single-ended 50 Ohm lines. The use of high quality single mode lasers allows to extend SCI ringlets up to 10 Km. RD24 has started a design project of a long distance optical ringlet to investigate a shared memory application between two distant VMEbus crates III. FIRST SCI RINGLET DESIGN The 1 GByte/s Dolphin GaAs NodeChip™ [2] transmits packets over 16 ECL signal pairs at 500 MHz and allows to achieve araw link bandwidth of 1 Gbyte/s per node. RD24 has used early engineering samples of these chips for a first SCI ringlet design. We used SCI at 1/2 of the nominal link speed, such that all our figures need to be corrected accordinglyfor a final version of the Dolphin GaAS chips. The NodeChip™ is mounted on a VME-sized mezzanine board, including DC-DC converters and initialization hardware. RD24 used commercial VME processor cards from CES [8,9] to interface the mezzanine nodechip cards to a R3000 RISC processor board (RIO) and a MC68040 processor board (FIC) .Figure 5: Physical SCI links1. WL Gore & Associates, UKE. Design environmentThe CERN Cadence/Verilog 2 CAE design environment on Sun stationswas used for both the R3000 node interface and the DMA/68040 interface. We used a Verilog model for the Cbus [2], (the application-side protocol of Dolphin nodechips) and behavioral libraries for the 68040 bus 3 Consistent logical behavior of the interfaces was simulated prior to building hardware. For our prototypes, we used the ABEL HDL language and conventional programmable PAL logic. In a following stage we plan to move the designs into compact, field programmable logic array chips.F. R3000 RIO I/O node The design of the R3000 based SCI node was started before the details of the NodeChip™ were fully known. It’s main design goal was therefore flexibility. We have opted for a firmware solution for the followingreasons:•The complexity of some SCI protocols requires state machines which are too complex to implement in hardware without use of ASIC technology.•We wanted to be able to easily adapt the design to more advanced second-generation node chips.This firmware approach gives us flexibility through software emulation,at the price of some performance loss. It also allows us to study all SCI protocols implemented in the first version of node chips. An input-output processor, the RIO 8260 from CES [8], was chosen to implement the firmware and to carry the interface. This VME-board is equipped with a R3051 embedded RISC processor (25MHz), 4MB of DRAM and both a VME master and slave port, used for downloading software during development. Nooperating system is running on this board. The MIPS 3000 bus (32 bits @ 25MHz) is connected to the synchronous Cbus of the NodeChip (64 bits @ 32 MHz) via a set of four FIFO chips(fig 6):request-out and response-in for the requester part, request-in and response-out for the responder part. This approach allows the node to act simultaneously as a requester and responderFigure 6: R3000 Firmware node2. Cadence Design Systems, Inc, Lowell, MA, USA3. SmartModel™, Logic Automation, Beaverton, OR 97075, USA The FIFOs are 256 x 32 bits, with synchronous ports running at 40 MHz on the Cbus side and 25MHz on the processor side. A mailbox is used to control sending of FIFO packets to the Cbus Firmware formats the data as it arrives on the MIPS R3000 businto SCI packets and unpacks data packets from SCI before returning it via the R3000 bus. Address mapping is also done in firmware. This results in aflexible design: data can be formatted into any of the SCI packet formats which Cbus supports. Data rates of 6 Mbyte/s have been obtained with a non optimized version of the firmware. Throughputs greater than 10 Mbyte/s are expected with further optimization. The interface provides a bi-directional I/O connection between SCI, memory, VMEbus and other devices which can be interfaced to the MIPS R3000 bus. It is also used a research tool to test the cache coherency option of SCI. The functionalityof a coherent SCI cache and memory controller can be emulated in the firmware to test the “typical set” of SCI coherency protocols as implemented in the NodeChip.G. DMA node A dual port interface to the 68040 bus was designed to allow generation of data block movement in excess of 100 MByte/s under control of a 68040 processor.Figure 7: DMA nodeThe DMA uses a sequence of fast dmove64 packet protocols with wsb (write selected byte) synchronization protocols at the start and end of 64 byte data boundaries. The 16 Kbyte deep dual port memory can also be addressed via SCI as a simple memory node, mapped into the 68040 address space and therfore represents a first implementation of a SCI memory node. The performance achieved with this interface was measured as an average latency of 560 ns per dmove64 packet,corresponding to a data rate of 114 Mbyte/s.H. Test setup The test ringlet at CERN consists of two SCI nodes, mounted on VMEbus modules and controlled from a SUN hostcomputer though VMEbus. The DMA node, based on the 68040 FIC module allows for fast block transfers. The node based on the R3000 RIO module is driven by firmware and implements all SCI transactions of the nodechip at a substancially lower speed. The SCI diagnostic tracer, inserted as passive device, is used to display SCI packets on the screen of a Tektronix DAS 9200 logic state analyzer. Firmware is cross-developed on the SUN host and downloaded through the PT SBS-915 SBUS to VME interface, to the nodes.Figure 8: RD24 SCI test ringletI. Test and servers software During the development of the two nodeinterfaces, several test packages have been written to validate hardware and software. A terminal-driven diagnostic package can be executed either on the R3000 or on the SUN host. More complicated client/server state machines have been written to debug the first SCI hardware. Millions of SCI transactions have been validated on each node. In a further step,the two nodes have been examined for communication between each other, again without problems in data or protocol consistency Our next step will be the verification of a more flexible R3000 server, capable of transactions between SCI, VMEbus and a planned TURBOchannel interface,optionally via SCI coherent protocols.J. Diagnostics As part of its product suite, Dolphin is developing an SCI Tracer for debugging and diagnosis of SCI systems. The SCI Tracer is a special logic analyzer which can acquire and analyze SCI symbols from an active SCI link at the speed of 1 GByte/s. The hardware is implemented in a multi-board VME module. It consists of: an SCI board, a map board with memory maps for trigger patterns to control the tracing process and a storage board with 256 KByte of memory. Different types of triggers can be recognized and used as the basis for storing sequences of SCI packets. During the project, the first version of the SCI Tracer the LinkProbe™ -has been made available as a product [10] This is a front-end to a logic analyzer (such as the Tektronix DAS 9000), and is upgradable to a complete SCI Tracer.IV. CONCLUSIONFirst SCI protocol chips have been successfully used to design HEP specific nodes for an SCI ringlet at CERN. The speed of a CERN designed DMA node achieved more than100 Mbyte/s and will scale up by a factor of two for the final NodeChip™. Our firmware approach to control an SCI RISC node in a flexible and re-programmable way was succesful and allowed generation of a large set of SCI transaction for validation of SCI protocols. We used an SCI tracer module from Dolphin to monitor SCI protocols and packet content directly at the link.V. ACKNOWLEDGMENTThis project has been funded by the DRDC Committee from CERN, the Norwegian Research Council, the Physics Department of the University of OSLO, Creative Electronic Systems CES) in Geneva, the DEC Joint Project at CERN and APPLE Computer Inc. in Cupertino.VI. REFERENCES[1] IEEE Std 1596-1992. Scalable Coherent Interface Logical, Physical and Cache Coherence Specifications Draft 2.0, November 18, 1991 (draft available on public server sunsci.cern. ch)[2] Cbus specification V 2.0, August 1992, Dolphin SCI Technology P.O Box 52, Bogerud, N-0621 OSLO, Norway August 1992, (draft onanonymous ftp server sunsci.cern.ch) [3] DST501A GaAs NodeChip Functional Specification V 1.3, August 1992 and DST501A GaAs NodeChip Electrical Specification V 0.3,January 1993 Dolphin SCI Technology, P.O Box 52, Bogerud, N-0621 OSLO, Norway[4] IEEE Std 1212, CSR Architecture (draft on anonymous ftp server sunsci.cern.ch)[5] New buses and links for Data Acquisition, H.Müller, A. Bogaerts, D.Linnhöe R.McLaren, C.Parkman, Nucl.Instr.and Meth.in Physics Research A315 (1992) 478-482[6] LSI Logic Corporation, Milpitas, California 95035, USA[7] HDMP-1000 Tx/Rx Pair, Technical Data Sheet Hewlett Packard Co.,Palo Alto, California 94304,USA[8] RIO 8260 RISC I/O Processor User manual Creative Electronic Systems S.A., CH-1213 Geneva[9] FIC 8234 Twin 68040 processor User Manual, Creative Electronic Systems S.A., CH-1213 Geneva[10] SCI Tracer Specification, Preliminary version 2.0 I. Birkeli, DolphinSCI Technology, P.O Box 52, Bogerud, N-0621 OSLO, Norway[11] RD24 Status Report, CERN/DRDC 93-20, May 5, 93。