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頁
全文預覽已結束

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領

文檔簡介

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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論