You are on page 1of 4

COMPIM Serial Port Model

Introduction Traditionally, 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 !MPIM 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 P" or "#$T model appears at the P %s physical !M port. The !MPIM model also provides for baud rate translation, and for optional hardware or software handsha&ing on both the physical and virtual sides of the device. This allows any real world hardware e'uipped with a serial port to interact with a VSM simulation. (or e)ample, 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. #lternatively, a monitor debugger running on one P can be used to debug a simulated design running within VSM. The !MPIM model can also be used for some simple digital I*!+ the TS, ,S$, , , and $I lines on the physical serial port can act as rudimentary digital inputs from e)ternal stimulus, such as switches- the $TS and ,T$ lines on the physical serial port can act as rudimentary outputs. .ear in mind that these signals may need addition physical signal conditioning, depending on application and port type. Device Layout !MPIM has eight pins+ T/,, $/,, TS, $TS, ,S$, ,T$, , , and $I. T/,, $TS and ,T$ are inputs to the device and become outputs on the physical port. $/,, TS, ,S$, , , and $I are inputs from the physical port that become outputs on the device.

This means that the !MPIM represents a , 0 on the schematic. .y contrast, the VT0$M model 1being a terminal2 is wired as a ,T0. The physical !M port itself is wired as a ,T0 1T/, is an output2. When a simulation is initiated, the terminals of the ,.34 connector inside the !MPIM device symbol become indicators. The T/, and $/, terminalss indicate activity on the corresponding physical port pins. The indicators for TS, $TS, ,S$, ,T$, , , and $I show the state of the

physical port pins. Two further s'uare indicators are present, either side of the word %0$$!$%. 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 ,.34 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. 5andsha&ing Modes (low 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 !MPIM and the operating system. This means that although flow control may be accepting or bloc&ing 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 handsha&ing is enabled, the $TS input pin of the !MPIM will cease to have any direct effect on the $TS line of the !M port. This behaviour is correct and by design. .uffering The !MPIM model provides buffering for both incoming and outgoing data. #s well as covering the situation where the VSM simulation fails to &eep up with real time, the input buffering wor&s even when the simulation is paused. This feature can be remar&ably 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 !M port actually transmitted it. The output buffering is most relevant where the baud rate in the virtual circuit e)ceeds that being used to communicate with the physical device. Properties The !MPIM model supports the following properties+ 6ame Property ,efault ,escription Physical port P7P!$T !M8 Specifies which physical serial device the model is to connect to. Physical .aud $ate P7.#",$#T0 49:: Specified the baud rate the physical port should be set at. The bounds for this are ;: to 8:::::: baud, though your hardware may place additional limits on the permitted values. Physical ,ata .its P7,#T#.ITS < Specifies the number of data bits used on the physical port. = and < data bits are presently supported. Physical Parity P7P#$IT> 6!60 Specifies the parity used on the physical port. This can be 6!60, !,,, 0V06, M#$? and SP# 0. Physical Stop .its P7ST!P.ITS 8 Specifies the number of stop bits used on the physical

port. 8 and @ stop bits are presently supported. Physical /!6*/!(( flow control P7S!(T(A!W : Specifies if /!6*!(( flow control is to be used on the physical serial port. Physical $TS* TS flow control P75#$,(A!W : Specifies if hardware $TS* TS flow control handsha&ing is to be used on the physical serial port. Physical /!6 character P7/!6 5#$ 8= Specifies the /!6 character used on the physical interface. Physical /!(( character P7/!(( 5#$ 84 Specifies the /!(( character used on the physical interface. Virtual .aud $ate V7.#",$#T0 49:: Specifies the baud rate of the virtual port. The bounds for this value are from ;: to 8:::::: baud. Virtual ,ata .its V7,#T#.ITS< Specifies the number of data bits on the virtual port. = and < data bits are presently supported. Virtual Parity V7P#$IT> 6!60 Specifies the parity used on the virtual serial port. This value can be 6!60, !,,, 0V06, M#$? and SP# 0. Virtual Stop .its V7ST!P.ITS 8 Specifies the number of stop bits on the virtual serial port. 8 and @ stop bits are presently supported. Virtual /!6*/!(( flow control V7S!(TSA!W : Specifies if /!6*/!(( flow control is used on the virtual serial port. Virtual $TS* TS flow control V75#$,(A!W : Specifies that hardware $TS* TS handsha&ing is to be used on the virtual port. Virtual /!6 character V7/!6 5#$ 8= Specifies the /!6 character used the virtual interface. Virtual /!(( character V7/!(( 5#$ 84 Specifies the /!(( character used on the virtual interface, SiBe of data input buffer I6P"T7."((0$7SIC0 9;;D9 Indicates the upper bound on the siBe of the serial input buffer, from physical interface to virtual interface, in bytes. The minimum being 8, the ma)imum E84ED:E. SiBe of data output buffer !"TP"T7."((0$7SIC0 9;;D9 Indicates the upper bound on the siBe of the serial output buffer, from virtual interface to physical interface, in bytes. The minimum being 8, the ma)imum E84ED:E. #dditional notes # &nown problem with Windows 4;*4<*M0 serial port #PI 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, conse'uently the $I line gets stuc& high until the simulation is stopped. 6o matter what the values of I6P"T7."((0$7SIC0 and !"TP"T7."((0$7SIC0 the operating system and hardware carries out some limited buffering. Aimitations in the way the WinD@ serial port #PI reports a line brea& condition mean that !MPIM has to infer the end of a line brea& by other activity occurring on the physical serial port. This means that a line brea& condition may continue to be active on the virtual port after the condition has been removed from the physical port.

The indicators on the !MPIM device try to reflect the state of the physical port, however, the operating system and hardware perform some buffering before !MPIM.,AA has a chance to e)amine the data, which means the indication may possibly lag the true state of the physical port.

You might also like