Proteus 串口资料COMPIM Serial Port Model.doc_第1页
Proteus 串口资料COMPIM Serial Port Model.doc_第2页
Proteus 串口资料COMPIM Serial Port Model.doc_第3页
Proteus 串口资料COMPIM Serial Port Model.doc_第4页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

COMPIM Serial Port ModelIntroductionTraditionally, simulation systems have had no direct connection to the physical world around them. This meant that if you wanted to simulate part of a much bigger system of interconnected units, one had to either create simulations of the other units, or create files containing test data.The Virtual System Modelling capabilities of Proteus VSM allow the creation of models that can actually interact with the physical world. We call such models Physical Interface Models or PIMs for short.The COMPIM model is a Physical Interface Model of a serial port. Incoming serial data is buffered and presented to the circuit as a digital signal, whilst serial digital data generated by a CPU or UART model appears at the PCs physical COM port. The COMPIM model also provides for baud rate translation, and for optional hardware or software handshaking on both the physical and virtual sides of the device.This allows any real world hardware equipped with a serial port to interact with a VSM simulation. For example, you could use it to develop a program for a microprocessor within Proteus VSM that would operate a real physical modem, perhaps as part of a security or home automation system. Alternatively, a monitor debugger running on one PC can be used to debug a simulated design running within VSM.The COMPIM model can also be used for some simple digital I/O: the CTS, DSR, DCD and RI lines on the physical serial port can act as rudimentary digital inputs from external stimulus, such as switches; the RTS and DTR lines on the physical serial port can act as rudimentary outputs. Bear in mind that these signals may need addition physical signal conditioning, depending on application and port type.Device LayoutCOMPIM has eight pins: TXD, RXD, CTS, RTS, DSR, DTR, DCD and RI. l TXD, RTS and DTR are inputs to the device and become outputs on the physical port. l RXD, CTS, DSR, DCD and RI are inputs from the physical port that become outputs on the device.This means that the COMPIM represents a DCE on the schematic. By contrast, the VTERM model (being a terminal) is wired as a DTE. The physical COM port itself is wired as a DTE (TXD is an output).When a simulation is initiated, the terminals of the DB-9 connector inside the COMPIM device symbol become indicators. The TXD and RXD terminalss indicate activity on the corresponding physical port pins. The indicators for CTS, RTS, DSR, DTR, DCD and RI show the state of the physical port pins.Two further square indicators are present, either side of the word ERROR. These indicators show red whenever an error is detected on either the virtual port or the physical port. The indicator nearest the pins flags an error on the virtual port. The indicator under the DB-9 terminals flags that an error occurred on the physical port. The errors indicated include framing and parity errors. The simulation log window may give more information as to the nature of the error.Handshaking ModesFlow control signals, if active, do not directly pass through from the physical to virtual port, or vice versa, they instead interact with high and low thresholds on the data buffers that are in COMPIM and the operating system. This means that although flow control may be accepting or blocking data at one physical/virtual port, the other virtual/physical port may not necessarily propagate this state, unless the buffers become close to overflowing or under flowing.Put another way, if either Physical or Virtual hardware handshaking is enabled, the RTS input pin of the COMPIM will cease to have any direct effect on the RTS line of the COM port. This behaviour is correct and by design.BufferingThe COMPIM model provides buffering for both incoming and outgoing data. As well as covering the situation where the VSM simulation fails to keep up with real time, the input buffering works even when the simulation is paused. This feature can be remarkably useful since the VSM debugging tools may be used to single step the processing of the data long after the physical hardware device attached to the COM port actually transmitted it.The output buffering is most relevant where the baud rate in the virtual circuit exceeds that being used to communicate with the physical device.PropertiesThe COMPIM model supports the following properties:NamePropertyDefaultDescriptionPhysical portP_PORTCOM1Specifies which physical serial device the model is to connect to.Physical Baud RateP_BAUDRATE9600Specified the baud rate the physical port should be set at. The bounds for this are 50 to 1000000 baud, though your hardware may place additional limits on the permitted values.Physical Data BitsP_DATABITS8Specifies the number of data bits used on the physical port. 7 and 8 data bits are presently supported.Physical ParityP_PARITYNONESpecifies the parity used on the physical port. This can be NONE, ODD, EVEN, MARK and SPACE.Physical Stop BitsP_STOPBITS1Specifies the number of stop bits used on the physical port. 1 and 2 stop bits are presently supported.Physical XON/XOFF flow controlP_SOFTFLOW0Specifies if XON/OFF flow control is to be used on the physical serial port.Physical RTS/CTS flow controlP_HARDFLOW0Specifies if hardware RTS/CTS flow control handshaking is to be used on the physical serial port.Physical XON characterP_XONCHAR17Specifies the XON character used on the physical interface.Physical XOFF characterP_XOFFCHAR19Specifies the XOFF character used on the physical interface.Virtual Baud RateV_BAUDRATE9600Specifies the baud rate of the virtual port. The bounds for this value are from 50 to 1000000 baud.Virtual Data BitsV_DATABITS8Specifies the number of data bits on the virtual port. 7 and 8 data bits are presently supported.Virtual ParityV_PARITYNONESpecifies the parity used on the virtual serial port. This value can be NONE, ODD, EVEN, MARK and SPACE.Virtual Stop BitsV_STOPBITS1Specifies the number of stop bits on the virtual serial port. 1 and 2 stop bits are presently supported.Virtual XON/XOFF flow controlV_SOFTSLOW0Specifies if XON/XOFF flow control is used on the virtual serial port.Virtual RTS/CTS flow controlV_HARDFLOW0Specifies that hardware RTS/CTS handshaking is to be used on the virtual port.Virtual XON characterV_XONCHAR17Specifies the XON character used the virtual interface.Virtual XOFF characterV_XOFFCHAR19Specifies the XOFF character used on the virtual interface,Size of data input bufferINPUT_BUFFER_SIZE65536Indicates the upper bound on the size of the serial input buffer, from physical interface to virtual interface, in bytes. The minimum being 1, the maximum 4194304.Size of data output bufferOUTPUT_BUFFER_SIZE65536Indicates the upper bound on the size of the serial output buffer, from virtual interface to physical interface, in bytes. The minimum being 1, the maximum 4194304.Additional notesA known problem with Windows 95/98/ME serial port API behaviour causes incorrect ring indicator operation. This appears to manifest itself as the ring indicator line correctly performing a low to high transition but never performing the high to low transition, consequently the RI line gets stuck h

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论