资源预览内容
第1页 / 共134页
第2页 / 共134页
第3页 / 共134页
第4页 / 共134页
第5页 / 共134页
第6页 / 共134页
第7页 / 共134页
第8页 / 共134页
第9页 / 共134页
第10页 / 共134页
亲,该文档总共134页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
毕业论文辩论毕业论文辩论课题名称:真空镀膜机控制系统 的专用集成电路设计目录n引言n总体设计方案n单元电路设计n总体电路设计n外围接口电路n电路的硬件实现及调试n参考文献返回一、引言nEDA技术是电子系统(集成电路)自动化设计技术.它是由70年代的CAD和80年代的CAE开展而来的,是适应微电子技术到不断改进和可编程逻辑器件的复杂程度越来越高的要求而出现的.其特点是高层次设计自动化,引入了VHDL语言.n随着科技的不断开展、大规模集成电路的广泛应用,目前本课题选择了采用PLD可编程逻辑控制器件设计真空镀膜机的控制系统,采用PLD开发工具对芯片编程,直接将镀膜机工艺流程写入集成芯片中,再外加少许必要的外围电子元器件构成整个控制局部,选择标准的数据通讯接口就可实现数据的交换,从而实现对真空镀膜机工艺流程的全程监控,到达工程应用要求。采用FPGA设计的真空镀膜机控制系统的优点。返回选择CPLD/FPGA的理由优点:1真空镀膜机的控制系统设计趋于简单、开发周期相对缩短;2整个控制系统的集成度较高、保密性大大提高;3控制局部所需元器件少,所占的空间小;4数据通讯结构更趋于简单化;5系统的抗干扰性高,移植性好,维护更方便、快捷;6工程造价本钱大大降低;PLC设计本钱相对较高;单片机在恶劣的环境下抗干扰性能差,容易死机或进入死循环(时序指令控制).返回二、设计要求n本设计是关于太阳能真空集热管磁控溅射镀膜机自动控制系统的设计,太阳能真空集热管磁控溅射镀膜机主要用于真空太阳能集热管生产中镀制渐变的精确的化学配比氮化铝膜。如图2.1所示为镀膜机的自动操作流程图,它是自动控制系统的所要完成的对镀膜过程和镀膜工艺要求的控制,其中在“按设定工艺自动运行这一步,包括一个参数设定的过程。参数设定是指对镀膜的时间、氮气的流量、氩气的流量、靶电流以及靶的选择的设定,它是在自动控制复位的状态下根据工艺的要求由操作人员来完成的,设定后存储在存储器中以等待工艺运行的调用。n图2.2整体设计的原理框图。返回返回返回注释:注释:表2.2所示为参数设定的一个样本,层数是指镀膜的层数,也就是每一层所对应的不同工艺参数的设定,选靶设定的是靶的模式。返回层数时间(s)氩气(流量)氮气(流量)靶电流(A)选靶模式(备注)第一层56052401启动靶1第二层152041453启动靶3第三层302585557启动靶1、2、3第四层113737345启动靶1、3第五层651518476启动靶2、3图2.2整体设计的原理框图返回三、单元电路设计*工序流程控制模块设计*参数设置及调用模块设计*通讯模块设计返回1、工序流程控制模块设计*设计的原理及思路*设计的VHDL硬件描述*设计的功能仿真返回设计的原理及思路n“plate2是镀膜机自动运行的控制系统模块。其流程图如图2.1真空镀膜机自动操作控制流程图。此模块采用了Moor型有限状态机来描述的。其状态机的状态转换图如下图。这是一个17个状态的状态转换图,它包含了整个工序控制的流程。其中“count是一个计数器,在状态转换中作为定时器用;其他的都是作为状态之间转换的条件,在程序中已做了说明,没有标条件是一种“无条件的转换,即当前状态运行完成后直接把下一个状态作为当前状态;状态“NONE表示第一十七状态,由于所用的软件中最多只能编辑16个状态。返回返回设计的VHDL硬件描述nlibraryIEEE;nuseIEEE.STD_LOGIC_1164.ALL;n-useIEEE.STD_LOGIC_ARITH.ALL;nuseIEEE.STD_LOGIC_UNSIGNED.ALL;nentityplate2isnPort(clock:instd_logic;-时钟nreset:instd_logic;-复位natom_hand:instd_logic;-自动/手动nrunfin:instd_logic;-运行完毕ntakefin:instd_logic;-开门信号nvacuity2:instd_logic;-真空度2nairpressure:instd_logic;-真空度3返回nbuttvoltage:instd_logic;-靶电压n-craftautorun:instd_logic;nmachinpump:outstd_logic;-机械泵nbeforeluntvalve:outstd_logic;-预抽阀nprevalve:outstd_logic;-前级阀nhighvalve:outstd_logic;-高阀nmaintainvalve:outstd_logic;-维持阀nmaintainpump:outstd_logic;-维持泵nlightbarriervalve:outstd_logic;-光栏阀ncutvalve:outstd_logic;-截止阀nnitrogencontrol:outstd_logic;-氮气控制nargoncontrol:outstd_logic;-氩气控制nworkpiecerun:outstd_logic;-工件旋转nbuttrun:outstd_logic;-靶旋转nbuttcurrent1:outstd_logic;-靶电流返回ncraftrun:outstd_logic;-工艺自动运行nwarnin:outstd_logic;-报警naeratevalve:outstd_logic;-充气阀nonoffdoor:outstd_logic);-关门信号nendplate2;narchitectureBehavioralofplate2isntypestateis-状态的枚举定义n(state1,state2,state3,state4,state5,state6,state7,state8,state9,state10,state11,state12,state13,state14,nstate15,state16,state17);nsignalpresentstate:state;nsignalint,int0:integer;nsignalclk:std_logic;n-signalclock:std_logic;nbegin返回np0:process(clk,reset)-主控时序进程nvariablecount,count0:integer;nbeginnifreset=0thenncount:=0;count0:=0;npresentstatenifatom_hand=1thennpresentstatencount:=count+1;nifcount=3thenncount:=0;npresentstatencount:=count+1;nint=count;nifcount360andvacuity1=1thenncount:=0;npresentstatencount:=count+1;nifcount=2thenncount:=0;npresentstatecount:=count+1;nifcount=2thenncount:=0;返回npresentstatenpresentstatencount0:=count0+1;nint0=count0;nifcount02700andvacuity2=1thenncount0:=0;npresentstatenifairpressure=1thennpresentstatenifbuttvoltage=1then返回npresentstatenifrunfin=1thennpresentstatenpresentstatenpresentstatencount:=count+1;nifcount=2thenncount:=0;presentstatencount:=count+1;返回nifcount=2thenncount:=0;npresentstatencount:=count+1;nint65thenncount:=0;npresentstateniftakefin=1thennpresentstatenpresentstatepresentstate=360thennwarning0:=1;nendif;nelsifpresentstate=state4thennbeforeluntvalve0:=0;nelsifpresentstate=state5thennprevalve0:=1;nelsifpresentstate=state6thennhighvalve0:=1;返回nmaintainvalve0:=0;nelsifpresentstate=state7thennmaintainpump0:=0;nifint0=2700thennwarning0:=1;nendif;nelsifpresentstate=state8thennlightbarriervalve0:=1;ncutvalve0:=1;nnitrogencontrol0:=1;nargoncontrol0:=1;nelsifpresentstate=state9thennworkpiecerun0:=1;nbuttrun0:=1;buttcurrent10:=1;nelsifpresentstate=state10thenncraftrun0:=1;nelsifpresentstate=state11then返回nbuttcurrent10:=0;nlightbarriervalve0:=0;ncraftrun0:=0;ncutvalve0:=0;nnitrogencontrol0:=0;nargoncontrol0:=0;nbuttrun0:=0;nelsifpresentstate=state12thennhighvalve0:=0;nmaintainpump0:=1;nelsifpresentstate=state13thennmaintainvalve0:=1;nelsifpresentstate=state14thennprevalve0:=0;nelsifpresentstate=state15thennmachinpump0:=0;nifint=5then返回naeratevalve0:=1;nendif;nifint=65thennaeratevalve0:=0;nendif;nelsifpresentstate=state16thennonoffdoor0:=1;nelsifpresentstate=state17thennonoffdoor0:=0;nworkpiecerun0:=0;nendif;endif;nwarnin=warning0;nmachinpump=machinpump0;nbeforeluntvalve=beforeluntvalve0;nprevalve=prevalve0;nhighvalve=highvalve0;返回nmaintainvalve=maintainvalve0;nmaintainpump=maintainpump0;nlightbarriervalve=lightbarriervalve0;ncutvalve=cutvalve0;nnitrogencontrol=nitrogencontrol0;nargoncontrol=argoncontrol0;nworkpiecerun=workpiecerun0;nbuttcurrent1=buttcurrent10;ncraftrun=craftrun0;naeratevalve=aeratevalve0;nonoffdoor=onoffdoor0;nbuttrun=buttrun0;nendprocessp2;ncounter:process(clock)-32兆的分频器nvariablecount2:integer;nvariableclk0:std_logic;nbegin返回ifclockeventandclock=1thenncount2:=count2+1;nifcount2=16000000thennclk0:=0;nelsifcount2=32000000thenncount2:=0;nclk0:=1;nendif;nendif;nclkfin,b=fout1,c=ca,s=wrt);-“con2的映射nu2:con1portmap(x=cssz,y(0)=cs1,y(1)=cs2,y(2)=cs3,y(3)=cs4,ny(4)=cs5);-“con1的映射nu3:sram1portmap(cs=cs1,wr=wrt,adr=ca,din=dint,ndout=douts1,clk=clkj);-“sram1(时间)的映射nu4:sram1portmap(cs=cs2,wr=wrt,adr=ca,din=dint,ndout=doutb,clk=clkj);-“sram1(氩气)的映射nu5:sram1portmap(cs=cs3,wr=wrt,adr=ca,din=dint,ndout=doutc,clk=clkj);-“sram1(氮气)的映射nu6:sram1portmap(cs=cs4,wr=wrt,adr=ca,din=dint,ndout=doutd,clk=clkj);-“sram1(靶电流)的映射nu7:sram1portmap(cs=cs5,wr=wrt,adr=ca,din=dint,ndout=douts2,clk=clkj);-“sram1(靶数)的映射返回nu8:sconterportmap(dd=douts1,clk=clk1,f=fout1,nf0=fout,en=wrt,qq=douta);-“sconter(递减计数器)的映射nu9:con3portmap(m=douts2,n=yt,over=ov);-“con3的映射nu10:pulseportmap(en=wrt,clock=clkj,clk=clk1);-“pulse的映射nu11:decoderportmap(seg(3)=douta(7),seg(2)=douta(6),seg(1)=ndouta(5),seg(0)=douta(4),q3=douta1);-“decoder的映射nu12:decoderportmap(seg(3)=douta(3),seg(2)=douta(2),seg(1)=ndouta(1),seg(0)=douta(0),q3=douta2);nu13:decoderportmap(seg(3)=doutb(7),seg(2)=doutb(6),seg(1)=ndoutb(5),seg(0)=doutb(4),q3=doutb1);nu14:decoderportmap(seg(3)=doutb(3),seg(2)=doutb(2),seg(1)=ndoutb(1),seg(0)=doutb(0),q3=doutb2);返回nu15:decoderportmap(seg(3)=doutc(7),seg(2)=doutc(6),seg(1)=ndoutc(5),seg(0)=doutc(4),q3=doutc1);nu16:decoderportmap(seg(3)=doutc(3),seg(2)=doutc(2),seg(1)=ndoutc(1),seg(0)=doutc(0),q3=doutc2);nu17:decoderportmap(seg(3)=doutd(7),seg(2)=doutd(6),seg(1)=ndoutd(5),seg(0)=doutd(4),q3=doutd1);nu18:decoderportmap(seg(3)=doutd(3),seg(2)=doutd(2),seg(1)=ndoutd(1),seg(0)=doutd(0),q3=doutd2);nendstruct; 返回设计的功能仿真返回图参数设置及调用的译码功能仿真1返回图参数设置及调用的功能仿真2如图,不带译码器的参数设置及调用的功能仿真Pulse的VHDL硬件描述nlibraryIEEE;nuseIEEE.STD_LOGIC_1164.ALL;nuseIEEE.STD_LOGIC_ARITH.ALL;nuseIEEE.STD_LOGIC_UNSIGNED.ALL;nentitypulseisnPort(clock,en:instd_logic;nclk:outstd_logic);nendpulse;narchitectureBehavioralofpulseisnbeginncounter:process(clock,en)nvariablecount2:integer;nvariableclk0:std_logic;返回nbeginnifen=0thenncount2:=0;nclk0:=0;nelsifclockeventandclock=1thenncount2:=count2+1;nifcount2=16000000thennclk0:=1;nelsifcount2=32000000thenncount2:=0;nclk0:=0;nendif;endif;nclk=clk0;nendprocesscounter;nendBehavioral;返回图分频器仿真 返回con1的VHDL硬件描述nlibraryIEEE;nuseIEEE.STD_LOGIC_1164.ALL;nuseIEEE.STD_LOGIC_ARITH.ALL;nuseIEEE.STD_LOGIC_UNSIGNED.ALL;nentitycon1isnport(x:instd_logic_vector(3downto0);ny:outstd_logic_vector(4downto0);nendcon1;narchitectureoneofcon1isnbeginnwithxselectny=11110when0001,n11101when0010,返回n11011when0011,n10111when0100,n01111when0101,n11111whenothers;nendone;返回图 con1的仿真 返回Con2的VHDL硬件描述nlibraryIEEE;nuseIEEE.STD_LOGIC_1164.ALL;nuseIEEE.STD_LOGIC_ARITH.ALL;nuseIEEE.STD_LOGIC_UNSIGNED.ALL;nentitycon2isnport(a,b:instd_logic_vector(3downto0);ns:instd_logic;nc:outstd_logic_vector(3downto0);nendcon2;narchitectureoneofcon2isnbeginnprocess(s,a,b)nbeginnifs=0thenc=a;返回nelsencn=000;overn=001;overn=010;overn=100;overn=011;overn=101;overn=110;overn=111;overn=000;overn=000;nendcase;nendprocess;nendone;返回图的功能仿真 返回Sram1的VHDL硬件描述nlibraryIEEE;nuseIEEE.STD_LOGIC_1164.ALL;nuseIEEE.STD_LOGIC_ARITH.ALL;nuseIEEE.STD_LOGIC_UNSIGNED.ALL;nentitysram1isnport(wr,cs,clk:instd_logic;-读写控制,片选,时钟的定义nadr:instd_logic_vector(3downto0);-地址的定义ndin:instd_logic_vector(7downto0);-数据输入的定义ndout:outstd_logic_vector(7downto0);-数据输出的定义nendsram1;narchitecturebehavofsram1isnsubtypewordisstd_logic_vector(7downto0);-数组定义wordntypememoryisarray(0to15)ofword;返回nsignalsram:memory;nsignaladr_in:integerrange0to15;nbeginnadr_in=conv_integer(adr);-二进制转换为十进制的地址nwrite:process(wr,cs,adr_in,din,sram,clk)-写入sramnbeginnifclkeventandclk=1thennifcs=0andwr=0thennsram(adr_in)=din;nendif;nendif;nendprocess;nread:process(adr_in,wr,sram,clk)-读出sramnbeginnifclkeventandclk=1then返回nif(wr=1)thenndout=sram(adr_in);nelsendoutZ);nendif;nendif;nendprocess;nendbehav;返回图的功能仿真 返回Sconter的VHDL硬件描述nlibraryieee;nuseieee.std_logic_1164.all;nuseieee.std_logic_unsigned.all;nentitysconterisnport(clk,en:instd_logic;-时钟,复位ndd:instd_logic_vector(7downto0);-可预置输入nqq:outstd_logic_vector(7downto0);-递减的输出nf,f0:outstd_logic_vector(3downto0);-层数的输出nendsconter;narchitecturebehavofsconterisnbeginnprocess(en,clk)nvariablescnt:std_logic_vector(7downto0);返回nvariablesc,sc1:std_logic_vector(3downto0);nbeginnifen=0thenscnt:=00000000;-复位状态nsc:=0000;nsc1:=sc-1;f=sc;nelsif(clkeventandclk=1)thennifscnt=00000000then-置数计数状态nscnt:=dd;nsc1:=sc1+1;nf=sc1;nf0=sc1;nqq=scnt;nelsifscnt=“00010000thenscnt:=“00001001;qq=scnt;-输出层数n-译码器显示nelsifscnt=00100000thenscnt:=00011001;qq=scnt;返回nelsifscnt=00110000thenscnt:=00101001;qq=scnt;nelsifscnt=01000000thenscnt:=00111001;qq=scnt;nelsifscnt=01010000thenscnt:=01001001;qq=scnt;nelsifscnt=01100000thenscnt:=01011001;qq=scnt;nelsifscnt=01110000thenscnt:=01101001;qq=scnt;nelsifscnt=10000000thenscnt:=01111001;qq=scnt;nelsifscnt=10010000thenscnt:=10001001;qq=scnt;nelsescnt:=scnt-1;nqqq3q3q3q3q3q3q3q3q3q3q3=1111111;-0nendcase;nendprocess;nendBehavioral;返回图为“decoder的功能仿真返回3、通讯模块设计*UART的设计原理*UART的顶层映射的VHDL硬件描述*UART的顶层映射的功能仿真*Pulse的设计*R_UART的设计*T_UART的设计*Comparator的设计返回UART的设计原理n我们在这里是作为真空镀膜机的FPGA控制器同复合真空计的通信接口。图异步收发器的原理框图,分成四个子模块和一个总模块:波特率发生器、接收模块、发送模块、比较器,顶层映射模块。在这里采用了4800bps的波特率,在采样是采用了波特周期的1/8的时钟;接收的是六个八位的数据,因此每开始接收六帧的数据作为并行输出;发送机发送的是八位的握手信号30H。其UART的数据帧格式见表。n由于串行数据帧和接收机时钟是异步的,把逻辑1转为逻辑0作为一个数据帧的起始位。然而为了防止毛刺影响,能够得到正确的起始位,必须要求接收到的起始位在波特率时钟采样的过程中至少有一半都是属于逻辑0才认为接收到的是起始位。因此起始位需要至少4个连续波特时钟bclk周期的逻辑0被接收,才认为起始位接收到,接着数据位和奇偶校验位将隔8个连续bclk周期被采样一次,即将在每个位的中点处被采样。返回STARTD0D1D2D3D4D5D6D7PSTOP起始位数据位校验位停止位UART的数据帧格式 图异步收发器的原理框图 返回图异步收发器的映射原理图 返回UART顶层映射的VHDL硬件描述n此顶层映射的VHDL程序不包含比较器“comparator。nlibraryIEEE;nuseIEEE.STD_LOGIC_1164.ALL;nuseIEEE.STD_LOGIC_ARITH.ALL;nuseIEEE.STD_LOGIC_UNSIGNED.ALL;nentitytoprtisnPort(clk:instd_logic;-波特时钟nreset:instd_logic;-复位信号nrxd:instd_logic;-接收信号ntxd:outstd_logic;-发送信号nready0:outstd_logic;-准备信号nwarning1:outstd_logic;-报警提示nrout0:outstd_logic_vector(7downto0);-接收数据的输出nrout1:outstd_logic_vector(7downto0);返回nrout2:outstd_logic_vector(7downto0);nrout3:outstd_logic_vector(7downto0);nrout4:outstd_logic_vector(7downto0);nrout5:outstd_logic_vector(7downto0);nd_out:outSTD_LOGIC_VECTOR(6downto0);-提示信号输出nendtoprt;narchitectureBehavioraloftoprtisncomponentpulsetrnport(clk:instd_logic;nreset:instd_logic;nbclk:outstd_logic);nendcomponent;ncomponentt_uartnport(bclk,reset:instd_logic;nready:instd_logic;ntxd:outstd_logic);nendcomponent;返回ncomponentr_uartnport(reset,bclk:instd_logic;nrxd:instd_logic;nrout0:outstd_logic_vector(7downto0);nrout1:outstd_logic_vector(7downto0);nrout2:outstd_logic_vector(7downto0);nrout3:outstd_logic_vector(7downto0);nrout4:outstd_logic_vector(7downto0);nrout5:outstd_logic_vector(7downto0);nRxdInRegout:outstd_logic_vector(6downto0);nready,warning1:outstd_logic);nendcomponent;nsignalready,bclk:std_logic;nsignalRxdInRegout:std_logic_vector(3downto0);nbeginnu1:r_uartport返回nmap(reset,bclk,rxd,rout0,rout1,rout2,rout3,rout4,rout5,d_out,ready,warning1);nu2:t_uartportmap(bclk,reset,ready,txd);nu3:pulsetrportmap(clk,reset,bclk);nready0=ready;nendBehavioral;返回UART的顶层映射的功能仿真n图UART顶层映射的仿真图,它是整个RS232通信接口的仿制,在复位reset=1的情况下,接收机接收的数据以并行的格式输出即rtout=“01001101;rtclk为波特时钟,在这里输出只是为了仿真的方便和更加正确的分析仿真结果的精确性;zkout是发送机发出的握手信号30H,它以串行的格式发送到真空计的接收端,使得真空计确认后发送数据,在数据发送和接收时,它是置高电平即zkout=1。返回图UART顶层映射的仿真1返回图UART顶层映射的仿真2返回图UART顶层映射的仿真3返回Pulse的VHDL硬件描述nlibraryIEEE;nuseIEEE.STD_LOGIC_1164.ALL;nuseIEEE.STD_LOGIC_ARITH.ALL;nuseIEEE.STD_LOGIC_UNSIGNED.ALL;nentitypulsetrisngeneric(bitl:integer:=1;nn:integer:=8);nPort(clk:instd_logic;nreset:instd_logic;nbclk:outstd_logic);nendpulsetr;narchitectureBehavioralofpulsetrisnbegin返回nprocess(clk,reset)nvariablecount:integer;nvariablerclk:std_logic;nbeginnifreset=0thenncount:=1;nrclk:=0;nelsifclkeventandclk=1thennifcount=320000000/(bitl*n)thennrclk:=notrclk;ncount:=count+1;nelsifcount=320000000/(bitl*n*2)thennrclk:=notrclk;ncount:=1;nelse返回ncount:=count+1;nendif;nendif;nbclk=rclk;nendprocess;nnendBehavioral;返回如图分频器的功能仿真 返回R_UART的设计n图接收机R_UART的流程图。接收机根据UART的数据格式,也包括一位的起始位0、八位的数据位和一位的停止位1,在起始位到来之前,接收的数据都是1,处于高电平,当低电平0到来时,表示起始位到来,开始发送数据位,在数据位接收完后,对下一位停止位进行检测此处没有考虑校验位,当检测到停止位1时,表示接收的数据正确,此帧的数据发送接收完成,准备下一帧数据的接收。图接收机R_UART的状态转换图。返回返回图接收机R_UART的原理图 图接收机R_UART的状态转换图 返回R_UART的VHDL硬件描述nlibraryIEEE;nuseIEEE.STD_LOGIC_1164.ALL;nuseIEEE.STD_LOGIC_ARITH.ALL;nuseIEEE.STD_LOGIC_UNSIGNED.ALL;nentityR_UARTisngeneric(bitn:integer:=4;nn:integer:=8);nPort(reset,bclk:instd_logic;-复位信号、波特时钟nrxd:instd_logic;-接收信号nrout0:outstd_logic_vector(7downto0);-接收数据的输出nrout1:outstd_logic_vector(7downto0);nrout2:outstd_logic_vector(7downto0);nrout3:outstd_logic_vector(7downto0);返回nrout4:outstd_logic_vector(7downto0);nrout5:outstd_logic_vector(7downto0);nRxdInRegout:outstd_logic_vector(6downto0);-提示信号输出nready,warning1:outstd_logic);-准备信号、报警提示nendR_UART;narchitectureBehavioralofR_UARTisntypestatesis(pstart,rstart,rwait,rsample,rstop);nsignalcstate:states;nsignalint:std_logic_vector(0to2);nbeginnp0:process(bclk,reset,rxd)nSUBTYPEBYTEISSTD_LOGIC_VECTOR(7DOWNTO0);ntypeRAM_typeISARRAY(0TO7)ofbyte;nvariablesRAM:RAM_type;nvariablercntb,rcntd,rcnt,cnt:integerrange0to9;返回nvariablecnt1:std_logic_vector(3downto0);nvariablecount:integerrange0tointegerhigh;nvariabler0:std_logic;nvariablereg:std_logic_vector(15downto0);nvariableRxdInReg:std_logic_vector(3downto0);nbeginnifreset=0then-复位状态nreg:=0000000000000000;nrcntb:=0;nint=000;nrcntd:=0;nwarning1=0;ncstate=pstart;nRxdInRegout=0110000;nrout0=00000000;nrout1=00000000;nrout2=00000000;返回nrout3=00000000;nrout4=00000000;nrout5-预备开始状态nrcntb:=0;nSRAM(0):=00000000;nSRAM(1):=00000000;nSRAM(2):=00000000;nSRAM(3):=00000000;nSRAM(4):=00000000;nSRAM(5):=00000000;nRxdInRegout=0110000;ncnt:=0;返回nint=000;ncnt1:=0000;ncount:=0;nrcntd:=0;nr0:=0;nreg:=0000000000000000;nready=1;ncstate-开始状态nRxdInReg:=0000;nready=0;nifrxd=0thennifcnt=4thenncstate=rwait;返回ncnt:=0;nelsencnt:=cnt+1;nendif;nelsencstate=rstart;ncnt:=0;nendif;nr0:=0;n-rd-等待状态nifrcntb=6thennrcntb:=0;ncstateRxdInRegoutRxdInRegoutRxdInRegoutRxdInRegoutRxdInRegoutRxdInRegoutRxdInRegoutRxdInRegoutRxdInRegoutRxdInRegoutRxdInRegout=0110000;nendcase;nendif;nrcntb:=rcntb+1;返回cstate-采样状态nreg(conv_integer(cnt1):=rxd;nifcnt1=8thenncstate=rstop;ncnt1:=0000;nelsencstate-停止状态nifreg(8)=0thennifrcnt=2thennwarning1=1;nrcnt:=0;返回nint=000;nelsencstate=5THENnint=000;nifcount=0thennrout0=SRAM(0);nrout1=SRAM(1);nrout2=SRAM(2);nrout3=SRAM(3);nrout4=SRAM(4);nrout5=SRAM(5);返回nendif;nifcount=bitn*n/2then-分频等待0.5秒ncstate=pstart;count:=0;nelsencstate=rstop;ncount:=count+1;nendif;nelsenint=int+1;nCSTATEcstate=pstart;nendcase;endif;nendprocessp0;nendBehavioral;返回图为接收机R_UART的仿真图1返回图为接收机R_UART的仿真图2返回T_UART的设计原理及思路图为发送机的状态转换图 返回T_UART的VHDL硬件描述nlibraryIEEE;nuseIEEE.STD_LOGIC_1164.ALL;nuseIEEE.STD_LOGIC_ARITH.ALL;nuseIEEE.STD_LOGIC_UNSIGNED.ALL;nnentityt_uatrisnPort(bclk,reset:instd_logic;-波特时钟、复位信号nready:instd_logic;-接收机发出的准备信号ntxd:outstd_logic);-握手信号30H输出nendt_uatr;narchitectureBehavioraloft_uatrisntypestatesis(tidle,twait,tshift);nsignalcstate:states;返回nbeginnp0:process(reset,ready,bclk)nvariablehandsign:std_logic_vector(9downto0);nvariablettout:std_logic;nvariabletcnt:std_logic_vector(3downto0);nvariabletcntd:integerrange0to9;nbeginnifreset=0then-复位状态ncstate-空闲状态nttout:=1;返回ntcntd:=0;txd=ttout;nhandsign:=1001100000;nifready=1thenncstate=tshift;nelsencstate-等待状态niftcnt=6thenncstate=tshift;ntcnt:=0000;tcntd:=tcntd+1;nelsentcnt:=tcnt+1;ncstate-发送数据状态nttout:=handsign(tcntd);ntxd=ttout;niftcntd=9thenncstate=tidle;ntcntd:=0;nelsencstate=twait;nendif;n-txd=ttout;nendcase;nendif;nendprocess;nendBehavioral;返回图为发送机的仿真图 返回Compare的VHDL硬件描述nlibraryIEEE;nuseIEEE.STD_LOGIC_1164.ALL;nuseIEEE.STD_LOGIC_ARITH.ALL;nuseIEEE.STD_LOGIC_UNSIGNED.ALL;nentitycompareisnPort(cutvalve:instd_logic;nDin1:instd_logic_vector(7downto0);nDin2:instd_logic_vector(7downto0);nDin3:instd_logic_vector(7downto0);nv1:outstd_logic;nv2:outstd_logic;nv3:outstd_logic);nendcompare;返回narchitectureBehavioralofcompareisnsignalDin:std_logic_vector(15downto0);nbeginnDin=Din1&Din2;nprocess(Din,Din3,cutvalve)nbeginnifcutvalve=0andDin=x8909thennv1=1;nelsenv1=0;endif;nif cutvalve=0 and Din=2thennv2=1;nelsenv2=x8300 and (Din3(7)=1and Din3(6downto0)=1)orDin3(7)=0)thennv3=1;nelsenv3=0;nendif;nendprocess;nnendBehavioral;返回图3.3.5.4.1compare的功能仿真 返回四、总体电路设计图4.1总体电路系统设计的映射原理图 返回五、外围接口电路*先进的HMI触摸屏*复合真空计*质量流量计*恒流源电路*报警器及保护电路 返回先进的HMI触摸屏n触摸显示器是将触摸屏和显示器集成于一体的触摸显示设备,是最简单、方便、自然的人机交互设备。有CRT触摸显示器和LCD触摸显示器。主要应用于办公室、家庭、会议场所和培训中心等,以及用于触摸查询一体机的制造。n目前的触摸屏有:日本三菱、富士、欧姆龙,韩国LG公司,台湾EasyView等品牌,本课题所使用的触摸屏是台湾EasyView公司。n图为本设计的触摸屏工程控制模拟显示。返回图触摸屏工程控制模拟显示 返回复合真空计n复合真空计是由一个热偶计和一个宽量程的复合真空计构成的真空测量仪器。.本复合真空计是采用单片机技术的智能化仪器,在这里对其结构原理不做阐述,仅对其功能与FPGA控制器的通讯过程做一个具体的说明。在本设计中它就是完成三个真空度的测量,并且把测量的结果传输给FPGA控制器。在FPGA控制器的通讯模块中的比较器中,通过与设定真空度值的比较产生“1或“0的信号给镀膜机的FPGA控制器的流程控制以到达整个FPGA控制的目的。返回质量流量计n质量流量控制器MFC用于对气体的质量流量进行精密测量和控制。此设计中采用了D07系列质量控制器,它具有精密度高、重复性好、响应速度快,软启动、稳定可靠、工作压力范围宽等特点,其操作使用方面,可任意安装,并便于与计算机连接实现自动控制。其主要是对镀膜机中气体氮气、氩气质量流量的控制。它直接与FPGA控制器相连,其通过一个D/A转换把FPGA控制器中参数设定及调用模块中的设定参数传输给质量流量控制器,质量流量控制器完成流量的控制。下面是对质量流量控制器的工作原理、接线图及气体质量流量转换系数的表达。n,质量流量控制器的原理图。返回图质量流量控制器原理 返回恒流源电路n在真空镀膜机的镀膜工艺中,具有三个靶电源靶1、靶2、靶3的选择,根据不同的工艺要求,所加的靶电源不同,至少有一个靶工作,也可能两个同时工作。而在FPGA控制器中,只能是对“1或“0信号的控制,也就是一种开关向量的控制,因而对所控制的被控设备就有一种信号与数据转换的过程和转换的器件。恒流源就是通过FPGA来控制的电源输出。如图5.4是靶电源的原理框图。A、B、C三端是输入的三相电源,通过三相全控桥式整流器及其反响回路到达调压的目的;反响回路是实际上是对三相全控桥式整流器调节电压的控制,在三相全控桥式整流器的输出端,通过霍尔电流传感器与霍尔电压传感器对输出的电流、电压进行检测,然后把测得的电流送到电流比较器,FPGA控制器设定的电流值通过D/A转换器后也送到电流比较器,一起进行比较;三相移相触发器就是通过比较的差值来控制三相全控桥式整流器增大或减小输出的电压。R1、R2、R3、C1、C2、C3是一个桥式保护电路,C4、C5、L1是对三相全控桥式整流器输出电压滤波作用。下面是对各局部的表达。返回5.4靶电源的原理框图 返回报警器及保护电路n在真空度膜机装置中,为了镀膜机正常工作以及出现故障的预知性,保护外围器件,报警、保护电路是必要的外围电路。在FPGA控制器中,在对真空度1、真空度2的抽取中有一个时间的限制,对于真空度1,当抽取了6分钟后其压强还大于9.9Pa;对于真空度2,当抽取了45分钟后其压强不能到达小于1.0*10-2Pa,FPGA控制器就会提示出错,预抽超时报警提示。对于扩散泵炉温、靶进水温度、靶出水温度、扩散泵进水温度、扩散泵出水温度,当他们的温度超过一定的设定值时,会自动关断靶电源和扩散泵电源,并发出报警的提示信号。这些都是对镀膜机正常工作的保证及其装置器件的保护。图5.5是报警及保护电路原理框图。返回图5.5报警及保护电路的原理 返回六、电路的硬件实现及调试*工序控制流程的调试*参数设置及调用的调试*通讯模块的调试返回工序控制流程的调试n设计的实现包括程序设计的映射、布局、布线。我们在此设计主要是通过软件的仿真及电路验证来完成设计的测试的。在设计的软件实现编译,综合成功后,首先进行软件的仿真,我们是使用XiLinx公司的ISE.2编辑软件Modelsim5.3的仿真软件。选用了SpartanII系列的XC2S200芯片。XiLinx提供了基于静态存储器单元的FPGA器件,属于SRAM-查找表类型,他们允许内连得模式在器件被制造以后,再被加载和修改,因而具有在编辑和系统内再编程的性能。但是由于决定器件逻辑功能和互连关系的配置程序是存储在其中的,掉电时静态存储器(SRAM)的内容会丧失,因此每次加电是要把配置程序重新加载进芯片中。n图3.1.3.1.1,图3.1.3.1.2,图3.1.3.2是工序控制流程的功能访真图。返回参数设置及调用的调试n表是第一组参数设置的调试数据。在这里我们把不显示的氩气全部设为0。在测试的显示结果中出现了时间错层,运行的时间延时。n表是第二组参数设置的调试数据。其中第五层是结束层,它不作为工艺要求的参数,只是为了观察参数设置及调用过程完毕,发出结束信号给工序控制器进行到下一个状态。n表是第三组参数设置的调试数据。它是同工序控制流程一起做的顶层映射的测试。工艺运行的参数是在工序运行之前完成的。在调试中,自动运行时,我们无法看到工艺自动运行中设定参数变化的过程,也就好似很快就到达了运行完成状态。返回表第一组参数设置的调试数据层数时间(s)氮气(流量)氩气(流量)靶电流(A)选靶的模式15400351215500253330550272420450677表第二组参数设置的调试数据层数时间(s)氮气(流量)氩气(流量)靶电流(A)选靶模式115300402217250504330600803425450456510008返回表第三组参数设置的调试数据层数时间(s)氮气(流量)氩气(流量)靶电流(A)选靶模式15600401215200453330250557411370345510008返回通讯模块的调试n为了明确真空计同FPGA控制器的通讯模块的正确性,到达调试测试的目的,我们用一个C语言程序的PC机通讯同我们的UART进行测试。返回n通讯模块调试的C测试程序:n#includestdio.hn#includebios.hn#includetime.hnvoidsport(intdata)nnwhile(!bioscom(3,0,0)&0x2000);/*Thesendregisterisempty.*/nprintf(%dn,data);/*Outputthedatawhatisgoingtobesended.*/nif(bioscom(1,data,0)&0x8000)/*Sendthedata*/nprintf(Timeover.n);nexit(1);nnnintrport()返回nninta;nprintf(Ifyouwantexitpleaseinput*.n);nwhile(!(bioscom(3,0,0)&0x100)/*receverisready.*/nif(kbhit()&(getch()=*)nexit(1);na=bioscom(2,0,0)&0x00ff;nreturn(a);nnmain()nnintrdata=0,sdata,i=0;ncharfilename20;nFILE*fp;nbioscom(0,0xc3,0);返回nwhile(1)nprintf(Pleaseinputfilenamethatyouwanttosend!n);nscanf(%s,filename);nfp=fopen(filename,r);nif(fp=NULL)nprintf(Thefileyouwanttosendisntexit!nPleaserepeat(r)orexit.n);nif(getch()=r)ncontinue;nelsenexit(1);nbreak;nwhile(!feof(fp)n/*fscanf(fp,%d,&sdata);nsport(sdata);*/返回nrdata=rport();nif(rdata=0x30)nwhile(i6&!feof(fp)nfscanf(fp,%d,&sdata);nsport(sdata);ni+;ni=0;nnelsenprintf(Thehandshakesignalisnotright!nIfyouwanttoexitpleasetype*.n);nif(getch()=*)nfclose(fp);nexit(1);ncontinue;返回参参 考考 文文 献献n1黄正谨,徐坚,章小丽等.?CPLD系统设计技术入门与应用?M.北京.电子工业出版社:2002年3月第一版第一次印刷n2赵俊超等.?集成电路设计VHDL教程?M.北京.北京希望电子出版社.:2002年8月1日第一版第一次印刷n3高书莉,罗朝霞等.?可编程逻辑设计技术与应用?M.北京.人民邮电出版社:2001年9月第一版第一次印刷n4StefanSjoholmLennartLindh等,边计年薛宏熙译.?用VHDL设计电子线路?M.北京.清华大学出版社:2002年4月第一版n5潘松,黄继业等.?EDA技术实用教程?M.北京.科学出版社:2002年10月第一版2003年3月第一次印刷n6胡振华等.?VHDL与FPGA设计?M.北京.中国铁道出版社:2003年1月第一版第一次印刷n7可编程逻辑器件中文网站.?Quartus用户指南?.n8可编程逻辑器件中文网站.?ISE4.1i快速入门?.n9张昌凡,龙永红,彭涛.?可编程逻辑器件及VHDL设计技术?M.广州.华南理工大学出版社:2001年7月第一版n10蔡英武.?利用MATLAB增强MAX+PLUS的仿真功能?.n11陈胜功,宋子善.?容错系统中的自校验技术及实现方法?.n12李维英,陈育斌,李建东.?FPGA在多进制正交扩频通信系统中的应用?.n13唐晓泉,黄益庄.?基于SRAM和可重配置电路?n14可编程逻辑器件中文网站.?EnhancedPLLFeaturesinAPEX?.n15?DesigningSafeVerilogStateMachineswithSynplify?.返回n16DannyMok.?TheTenCommandmentsofExcellentDesign?.n17?HowtoimplementthecircuitinEABwithinVHDLcoding?.n18RaySchouten.?AWhitepaperonSRAMFPGAsecurity?.n19侯志雄,熊有伦.?CPLD在IGBT驱动设计中的应用?.n20刘伟,孟宪元.?利用FPGA小型声纳的片上系统集成?.n21王敏,陆必应,汪海波等.?基于DSP和CPLD的宽带信号源的设计?J.?电子工程师?.2002年第28卷第8期n22陈敏,王存华.?真空镀膜机的原理及故障分析?.?光电子技术?n23吴代方,童强.?双靶磁控溅射镀膜机及镀膜工艺?.?核聚变与等离子体物理?n24卜忍安,王文江,张劲涛.?多功能镀膜机的研制?J.?真空电子技术?:1999年第6期n25邓志杰.?新型真空镀膜机开关量控制机硬软件设计?J.?兰州铁道学院学报?:1997年第12期n26胡晓辉,范多旺.?新型真空镀膜机监控管理软件设计?J.?兰州铁道学院学报?返回敬敬 请请 指指 导导谢谢!谢谢!
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号