Patent Publication Number: US-2004049611-A1

Title: Flexible serial port configuration and method

Description:
FIELD  
       [0001] This invention relates to microprocessor-based system communication with preferred devices through standard serial connectors such as of the RS232C type and the like, and wherein communication may also be required with auxiliary devices such as standard laptop or handheld computers plugged into a port of the microprocessor, as for such purposes as maintenance or the like; the invention being more particularly concerned with the switching of the processor communication connections between the peripheral device and the auxiliary device upon such plug-in, and switching back upon disconnect thereof, and with the flexible requirement of processor knowledge as to which switching mode to be in.  
       BACKGROUND  
       [0002] The problem of flexibly switching the microprocessor communication between multiple devices as different devices are plugged in or disconnected from the microprocessor and with a priori knowledge provided as to which switching mode is to be used by the microprocessor, is admirably addressed by the present invention and for satisfying two sets of application requirements.  
       [0003] In the first application, the microprocessor normally communicates with a peripheral device via a standard RS 232 C serial connection as before mentioned; but at any time, a technician may plug a standard laptop or handheld computer or the like into a port of the microprocessor to conduct maintenance operations, at which time the microprocessor must notice the presence of the plugged-in device and switch over to communicating with it. When, moreover, the plugged-in device is disconnected, the microprocessor must notice its absence, also distinguishing it from just silence, and switch back to communicating with the peripheral device.  
       [0004] In the second application, the microprocessor does not communicate at all, but the technician may plug-in for the purpose of communicating directly with a peripheral device. In such event, the microprocessor must not intervene in their communication, but must notice the presence (e.g. for security reasons).  
       [0005] The principal aim of this invention is to meet these two requirements with a minimum of physical resources.  
       OBJECTS OF INVENTION  
       [0006] A primary object of the invention, accordingly, is to provide a new and improved method of and apparatus for enabling such multi-application flexible serial communication with peripheral devices by a microprocessor or the like, and with flexible accommodation for automatically switching either to communicate with a plugged-in auxiliary device when connected to a microprocessor port and then back to communicate with the peripheral device upon unplugging the auxiliary device, or to permit the auxiliary device directly to communicate with a peripheral device; and with the microprocessor knowing or being informed as to which switching mode to assume.  
       [0007] A further object is to provide such a novel flexible serial port-switching configuration that requires only a minimum of physical resources.  
       [0008] Other and further objects will be explained hereinafter and are more particularly defined in the appended claims.  
       SUMMARY  
       [0009] In summary, from one of its viewpoints, the invention embraces a method of enabling flexible switching of serial port communication amongst a microprocessor, an external peripheral device and an external auxiliary device optionally pluggable into the microprocessor and disconnectable therefrom for such purposes as maintenance, the method comprising, serially connecting the microprocessor to communicate with a peripheral device; upon the plugging into the microprocessor of an external auxiliary device, indicating such at the microprocessor and automatically effecting switching of the serial port communication with the microprocessor from the peripheral device to the auxiliary device; switching back to communication between the peripheral device and the microprocessor upon indication of the unplugging of the auxiliary device; indicating to the microprocessor when it is desired to establish serial port communication between the auxiliary device and the peripheral device, and thereupon automatically switching to serial port connection between the auxiliary device and the peripheral device and without involving communication with the microprocessor.  
       [0010] Preferred and best mode designs and configurations are later detailed.  
     
    
    
     DRAWINGS  
     [0011] The invention will now be explained in connection with the accompanying drawings,  
     [0012]FIG. 1 of which is a combined block and schematic circuit diagram illustrating a preferred implementation of the invention;  
     [0013]FIG. 2 is a modification of FIG. 1 which illustrates the signal paths implemented when the microprocessor communicates with a peripheral device;  
     [0014]FIG. 3 is a modification of FIG. 1 which illustrates the signal paths and connections implemented when an auxiliary device is connected to a later-explained header H 1  and communicates with the microprocessor; and  
     [0015]FIG. 4 is a further modification of FIG. 1 illustrating the signal paths and connections implemented when an auxiliary device is connected to a later-explained header H 2  and communicates directly with a peripheral device. 
    
    
     DESCRIPTION OF PREFERRED EMBODIMENT OF INVENTION  
     [0016] Referring to FIG. 1, the microprocessor-based housing is shown at B serially connectable to communicate with either an external peripheral device M or a plugged-in external auxiliary device such as a maintenance technician&#39;s handheld computer T, as previously described.  
     [0017] The invention entails, in preferred form, implementing a microprocessor P with a single on-chip UART (Universal Asynchronous Receiver/Transmitter)—the facility that enables it to conduct serial communications, and providing, for example, one 9-pin standard PC serial port connector C, and contriving to share these facilities as follows.  
     [0018] Two headers, H 1  and H 2 , are provided on the microprocessor PC board. The serial port connector C is wired through a connector C 1 , which can be placed on H 1  as shown in FIG. 3 for the first application, and on H 2  as shown in FIG. 4 for the second application above described.  
     [0019] Two RS232 driver/receiver chips DR 1  and DR 2  are also provided, each with two drivers and two receivers. The two drivers can be enabled and disabled by the microprocessor (as labeled). The two receivers (independently of the drivers) are similarly enabled and disabled, as labeled. The presence of an auxiliary device T is automatically indicated by the assertion of the Data Terminal Ready (DTR) signal on the hand-held computer&#39;s serial port.  
     [0020] One driver input from each of DR 1  and DR 2  is connected (wired) to the microprocessor transmit data output (TX DATA). Likewise, one receiver output from each is connected to the microprocessor receiver data input (RX DATA). The microprocessor sees to it that only one of the drivers and only one of the receivers is enabled at any given time, avoiding conflicts. The data signals of DR 2  are wired to the data pins of the peripheral device M, and the data signals of DR 1  are wired to the data pins of the auxiliary device T through H 1 . The processor can then exchange data with the peripheral device M through DR 2  and with the auxiliary device T, through DR 1 . The other of the DR 2  drivers is used to assert the DTR signal to the peripheral device M when the microprocessor P is communicating with it.  
     [0021] As shown in FIG. 4, a pin on H 2  is connected to the DTR output pin of the serial port of the auxiliary device T and, through diode D 1  to the DTR input of the peripheral device M and to the second (DTR) driver on DR 1 , and through diode D 2  to (DTR) receivers on DR 1  and DR 2 . The data pins of the serial port of the auxiliary device T are wired through H 2  to those of the peripheral device M. This arrangement enables the auxiliary device T to assert DTR to the peripheral device M and to be automatically noticed by the microprocessor on DR 1 , and thereby meet the requirements of the second application before discussed. DR 2  is never enabled in this application, so there is no conflict with H 2 . The diodes prevent the DTR driver on DR 2  from driving the DR 1  DTR receiver (or that of DR 2 , which shares a common connection with DR 1 ).  
     [0022] Since the pin on H 1  connected to the DTR of the auxiliary device T is wired to receivers on both DR 1  and DR 2 , the microprocessor P can then “see” the auxiliary device DTR signal, whichever of DR 1  and DR 2  it may be using at a given moment. As shown in FIG. 2, the diode D 1  allows the DR 2  DTR driver to drive the DTR input of the peripheral device M without interfering with the auxiliary device DTR output; while FIG. 3 shows that diode D 2  allows auxiliary device T to assert DTR to DR 1  and DR 2  through H 1  without interfering with the microprocessor DTR output to peripheral device M. This, therefore, serves to meet the requirements of the first application previously explained.  
     [0023] The headers H 1  and H 2  in the figure, moreover, may either be headers that, as before-described, allow a single case-mounted standard serial connector to be moved between the two serial I/O circuits on the microprocessor PC board, or they may be case-mounted serial connectors, allowing the technician&#39;s auxiliary device T to connect to either of the serial I/O circuits on the microprocessor PC board without the need to open the housing or physically move an internal connector.  
     [0024] In addition to the two application requirements previously described, moreover, that underlie the invention, the circuit of the invention also solves another problem. The microprocessor P normally communicates with the peripheral device M via a standard RS2332 serial connection as earlier stated. But the technician with the auxiliary device T must be able to plug a standard computer into one of two ports of the microprocessor P to communicate; for example, to conduct maintenance operations directly with either microprocessor P, as shown in FIG. 3, or the peripheral device M, as shown in FIG. 4.  
     [0025] In the solution provided by the invention, connecting T to either of the headers (which in this case could take the form of the previously mentioned 9-pin standard PC serial port connectors) will cause the microprocessor P to “see” DTR, suspend communications with the peripheral device M (disabling driver DR 2 ), and prepare to communicate with the auxiliary device T (enabling driver DR 1 ).  
     [0026] When the auxiliary device T is connected to header H 1 , the microprocessor P and the auxiliary device T can communicate; and when the auxiliary device T is connected to header H 2 , the peripheral device M and the auxiliary device T can communicate. Since the microprocessor P has disabled DR 2 , it will not cause any conflict. In such case, the microprocessor P could continue other programmed functionality while periodically polling to see if the auxiliary device T is attempting to initiate communications through header H 1 —since microprocessor P cannot otherwise determine to which header the auxiliary device T has connected.  
     [0027] When the auxiliary device T is disconnected or unplugged, and its connection to the microprocessor terminated, moreover, the microprocessor P detects the loss of DTR and returns to communicating with the peripheral device M, disabling driver DR 1  and enabling driver DR 2 .  
     [0028] Further modifications will also occur to those skilled in this art, and such are considered to fall within the spirit and scope of the invention as defined in the appended claims.