状态机设计:8.1.1 数据类型定义语句TYPE语句的用法如下:TYPE 数据类型名IS 数据类型定义OF 基本数据类型;或TYPE 数据类型名IS 数据类型定义;TYPE st1 IS ARRAY ( 0 TO 15 ) OF STD_LOGIC ;TYPE week IS (sun,mon,tue,wed,thu,fri,sat) ; 8.1.1 数据类型定义语句TYPE m_state IS ( st0,st1,st2,st3,st4,st5 ) ;SIGNAL present_state,next_state : m_state ;TYPE BOOLEAN IS (FALSE,TRUE) ;TYPE my_logic IS ( '1' ,'Z' ,'U' ,'0' ) ;SIGNAL s1 : my_logic ;s1 <= 'Z' ;SUBTYPE 子类型名IS 基本数据类型RANGE 约束范围;SUBTYPE digits IS INTEGER RANGE 0 to 9 ;
标签: 状态
上传时间: 2013-11-05
上传用户:nem567397
基于PIC单片机的低功耗读卡器硬件设计:本文提出了一个完整的基于串口的智能读卡器子系统设计方案并将其实现。读卡器的设计突出了小型化的要求,全部器件使用贴片封装。为了减小读卡器的体积,设计中还使用了串口窃电的技术,使用串口信号线直接给读卡器供电。为此,读卡器使用了省电的设计,采用了省电的集成电路,并大胆简化了许多传统的设计电路。关键字: 读卡器, 单片机, 串口窃电 Abstract: This paper aims to put forward a complete design of Smart IC card reader based onSerial Port and propose the way of realizing it for the purpose of Network Security. SMD isadopted to make Smart IC reader smaller in this design. To reduce the volume of Smart ICreader, Serial Port powered technology is employed to get power from the signal line of Serial Port. For this reason, low-power consumption components are adopted in the design and some traditional designs are simplified to reduce the power consumption.Keywords: Card Reader; Single-chip Computer; Serial Port Powered IC 卡系统保存了加密算法所需要的工作密钥,供加密算法对网络上传输的数据加密使用,是整个系统网络安全的核心。在IC 卡子系统中,读卡器是一个重要的部分。它起着管理IC卡、在IC 卡和PC或网络计算机间传递数据的重要作用。本文以一片PIC单片机为核心完成了基于RS232 串口的读卡器的硬件设计。
上传时间: 2014-04-14
上传用户:wanghui2438
一种实用的微机自动配料秤系统:介绍一种由单片机构成的配料秤。叙述了秤的传感器、变送器、信号的变换、硬件原理、软件流程以及和DCS 系统构成的单回路调节系统,此系统可广泛地应用于各行业的配料控制中。关键词:配料秤 单片机 单回路调节系统 DCS 系统 Abstract :A proportioning weigher based on single chip computer is introduced. Sensors , transmitters , signal converting , principle of hardware ,software flowchart of proportioning weigher and single loop control system composed with DCS system are emphasized ,this system can be used in proportioning control of various trades extensively.Key Words :Proportioning Weigher ,Single Chip Computer ,Single Loop Control System ,Distributed Control System
上传时间: 2013-10-12
上传用户:zwei41
本章将介绍μ’nSP™系列单片机的应用领域,具体讲述SPCE061A单片机在通讯、语音领域里的应用,并详细给出了有关系统的电路原理图、程序流程图以及程序代码,供读者参考。 μ’nSP™家族产品具有电源电压范围和工作速率范围较宽、集成度高、性能价格比高以及功耗低等特点,故其有非常广泛的应用领域。μ’nSP™家族系列产品,涵盖了非常广泛的应用。包括:发音与语音识别的微控制器(SPCE系列)、通信来电辩识应用的微控制器(SPT660x系列)、以及通用型微控制器等等,主要体现在以下几个方面: 用于数字信号处理 用于开发研制便携式移动终端 用于开发嵌入式计算机应用系统 用于数字信号处理1. 数字滤波器 (Digital Filter)数字滤波器是一种计算处理或算法。借助于此,可以将输入的一种数字信号或序列变换为另一种序列输出。数字滤波器已被广泛地应用于数字语音、数字图像处理以及模式识别和频谱分析。数字信号处理器(DSP,Digital Signal Processor)的作用是通过一系列数字来表示信号及其信息,并借助数字计算方法变换和处理这些信号。为了构成DSP,必须有一种部件能够快速地完成两个数值的乘法运算并将乘积累加于寄存器。“快速”意味着乘和累加(MAC,Multiply & ACcumulate)较高的运算速度。若以16位数值进行乘和累加,其结果应为32位。显然,μ’nSP™的硬件结构与其指令系统的结合足以构成DSP应用的硬件MAC单元,因而很适用于一些DSP方面的应用。
上传时间: 2014-01-26
上传用户:qb1993225
Internal Interrupts are used to respond to asynchronous requests from a certain part of themicrocontroller that needs to be serviced. Each peripheral in the TriCore as well as theBus Control Unit, the Debug Unit, the Peripheral Control Processor (PCP) and the CPUitself can generate an Interrupt Request.So what is an external Interrupt?An external Interrupt is something alike as the internal Interrupt. The difference is that anexternal Interrupt request is caused by an external event. Normally this would be a pulseon Port0 or Port1, but it can be even a signal from the input buffer of the SSC, indicatingthat a service is requested.The User’s Manual does not explain this aspect in detail so this ApNote will explain themost common form of an external Interrupt request. This ApNote will show that there is aneasy way to react on a pulse on Port0 or Port1 and to create with this impulse an InterruptService Request. Later in the second part of the document, you can find hints on how todebounce impulses to enable the use of a simple switch as the input device.Note: You will find additional information on how to setup the Interrupt System in theApNote “First steps through the TriCore Interrupt System” (AP3222xx)1. It would gobeyond the scope of this document to explain this here, but you will find selfexplanatoryexamples later on.
上传时间: 2013-10-27
上传用户:zhangyigenius
All inputs of the C16x family have Schmitt-Trigger input characteristics. These Schmitt-Triggers are intended to always provide proper internal low and high levels, even if anundefined voltage level (between TTL-VIL and TTL-VIH) is externally applied to the pin.The hysteresis of these inputs, however, is very small, and can not be properly used in anapplication to suppress signal noise, and to shape slow rising/falling input transitions.Thus, it must be taken care that rising/falling input signals pass the undefined area of theTTL-specification between VIL and VIH with a sufficient rise/fall time, as generally usualand specified for TTL components (e.g. 74LS series: gates 1V/us, clock inputs 20V/us).The effect of the implemented Schmitt-Trigger is that even if the input signal remains inthe undefined area, well defined low/high levels are generated internally. Note that allinput signals are evaluated at specific sample points (depending on the input and theperipheral function connected to it), at that signal transitions are detected if twoconsecutive samples show different levels. Thus, only the current level of an input signalat these sample points is relevant, that means, the necessary rise/fall times of the inputsignal is only dependant on the sample rate, that is the distance in time between twoconsecutive evaluation time points. If an input signal, for instance, is sampled throughsoftware every 10us, it is irrelevant, which input level would be seen between thesamples. Thus, it would be allowable for the signal to take 10us to pass through theundefined area. Due to the sample rate of 10us, it is assured that only one sample canoccur while the signal is within the undefined area, and no incorrect transition will bedetected. For inputs which are connected to a peripheral function, e.g. capture inputs, thesample rate is determined by the clock cycle of the peripheral unit. In the case of theCAPCOM unit this means a sample rate of 400ns @ 20MHz CPU clock. This requiresinput signals to pass through the undefined area within these 400ns in order to avoidmultiple capture events.
上传时间: 2014-04-02
上传用户:han_zh
The 87C576 includes two separate methods of programming theEPROM array, the traditional modified Quick-Pulse method, and anew On-Board Programming technique (OBP).Quick Pulse programming is a method using a number of devicepins in parallel (see Figure 1) and is the traditional way in which87C51 family members have been programmed. The Quick-Pulsemethod supports the following programming functions:– program USER EPROM– verify USER EPROM– program KEY EPROM– program security bits– verify security bits– read signature bytesThe Quick-Pulse method is quite easily suited to standardprogramming equipment as evidenced by the numerous vendors of87C51 compatible programmers on the market today. Onedisadvantage is that this method is not well suited to programming inthe embedded application because of the large number of signallines that must be isolated from the application. In addition, parallelsignals from a programmer would need to be cabled to theapplication’s circuit board, or the application circuit board wouldneed to have logic built-in to perform the programming functions.These requirements have generally made in-circuit programmingusing the modified Quick Pulse method impractical in almost all87C51 family applications.
上传时间: 2013-10-21
上传用户:xiaozhiqban
//芯片资料请到www.elecfans.com查找 //DS1820 C51 子程序//这里以11.0592M晶体为例,不同的晶体速度可能需要调整延时的时间//sbit DQ =P2^1;//根据实际情况定义端口 typedef unsigned char byte;typedef unsigned int word; //延时void delay(word useconds){ for(;useconds>0;useconds--);} //复位byte ow_reset(void){ byte presence; DQ = 0; //pull DQ line low delay(29); // leave it low for 480us DQ = 1; // allow line to return high delay(3); // wait for presence presence = DQ; // get presence signal delay(25); // wait for end of timeslot return(presence); // presence signal returned} // 0=presence, 1 = no part //从 1-wire 总线上读取一个字节byte read_byte(void){ byte i; byte value = 0; for (i=8;i>0;i--) { value>>=1; DQ = 0; // pull DQ low to start timeslot DQ = 1; // then return high delay(1); //for (i=0; i<3; i++); if(DQ)value|=0x80; delay(6); // wait for rest of timeslot } return(value);} //向 1-WIRE 总线上写一个字节void write_byte(char val){ byte i; for (i=8; i>0; i--) // writes byte, one bit at a time { DQ = 0; // pull DQ low to start timeslot DQ = val&0x01; delay(5); // hold value for remainder of timeslot DQ = 1; val=val/2; } delay(5);} //读取温度char Read_Temperature(void){ union{ byte c[2]; int x; }temp; ow_reset(); write_byte(0xCC); // Skip ROM write_byte(0xBE); // Read Scratch Pad temp.c[1]=read_byte(); temp.c[0]=read_byte(); ow_reset(); write_byte(0xCC); //Skip ROM write_byte(0x44); // Start Conversion return temp.x/2;}
上传时间: 2013-11-03
上传用户:hongmo
数据处理与控制策略Data Processing & Control Strategy数字控制器的设计技术,数字滤波和数据处理,数控技术基础,数字PID控制算法常规控制方案,先进控制方案,计算机控制系统的设计是指在给定系统性能指标的条件下,设计出控制器的控制规律和相应的数字控制算法 大多数计算机控制系统是由处理数字信号的过程控制计算机和连续的被控过程组成的数字信号与连续信号并存的“混合系统” 数字控制器的分析和设计方法数字控制器的连续化设计技术数字控制器的离散化设计技术
上传时间: 2013-10-30
上传用户:yanming8525826
基于多点网络的水厂自动监控系统设计Design of MPI Based Automatic Monitoring and Control System in Water Works刘 美 俊(湖南工程学院,湘潭411101)摘要针对水厂工作水泵多、现场离控制站距离远的特点,提出了一种基于MPI多点网络的自动监控系统的设计方法,分析了系统的工作原理,介绍了系统中数据的采集与处理、主站与从站的通信原理以及系统软件的设计。由于这种系统的主、从站PLC之间采用MPI网络通信,具有运行可靠、性能价格比高的特点,所以适用于中小规模水厂的分布式监控场合。关键词多点网络主站从站监控系统Abstract Ina ccordancew ithth efe atuersof w aterw orks,i. e. ,manyp umpsin o perationa ndth ep umps, farfor mt hec ontrolst ation,th em ethodo fdesigninga na utomati(〕monitoringa ndc ontorlsy stemb asedo nM PIis p resented.Th eo perationalpr incipleo fth esy stemi san alyzed,th ed atac olection,data processing; communication between master station and slave station as wel as design and system software are discussed. Because MPI network communicationis used among master station, slave stations and PLC, the system is reliable and high cost-efective. It is, suitable for smal and mediumsized water works for distrbuted monitoring and control.Keywords MPI Masterst ation Slaves tation Monitoringa ndc ontorlsy stem 自来 水 厂 的自动控制系统一般分为两大部分,一对组态硬件要求较高,投资较大。相对而言,MPI网是水源地深水泵的工作控制,一是水厂区变频恒压供络速度可达187.5 M bps,通过一级中继器传输距离可水控制,两部分的实际距离通常都比较远。某厂水源达Ikm 。根据水厂的具体情况,确定以MPI方式组地有3台深井泵给水厂区的蓄水池供水。水厂区的成网络,主站PLC为S7-300系列的CPU3121FM,从任务是对水池的水进行消毒处理后,通过加压泵向管站为S7-200系列的CPU222。这样既满足了系统要路恒压供水。选用Siemens公司的S7系列可编程控求,又相对于Profibus网络节省了三分之一的成本,制器(PLC)和上位机组成实时数据采集和监控系统, 这种分布式监控系统具有较高的性能价格比。系统对深水泵进行远程控制,对供水泵采用变频器进行恒中PLC的物理层采用RS - 485接口,网络延伸选用压控制以保证整个水厂的电机设备安全、可靠地运带防雷保护的中继器,使系统的安全运行得到了保行。证。MPI网络的拓扑结构如图1所示。1 多点网络(NWI)监控系统的组成Sie me ns 公司S7系列PLC通常有MP」多点网络与Profibus现场总线网络两种组网方式。Profibus现场总线的应用目前较为普遍,通用性较好,它由Profibus一DP, Profibus一FMS, Profibus一PA组成。Profibus - DP型用于分散外设间的数据传输,传输速率为9.6kbps一12Mbps,主要用于现场控制器与分散1/0之间的通信,可满足交直流调速系统快速响应的时间要求,特别适合于加工自动化领域的应用;Profibus - FMS主要解决车间级通信问题,完成中等传输速度的循环或非循环数据交换任务,适用于纺织、楼宇自动化、可编程控制器、低压开关等;Profibus - PA型采用了OSI模型的物理层和数据链路层,适用于过程自动化的总线类型。
上传时间: 2013-10-09
上传用户:fac1003