Abstract:
A programmable data port interface adapter for a mobile data terminal is disclosed which provides selectable configuration of an external device data port connector for accommodating multiple types of data port devices. An RS-232 type data port may be configured to a J1708 type data port such that the mobile data terminal may communicate with RS-232 type devices in addition to J1708 type devices. Data port configuration and control is implemented by software thereby eliminating the need to upgrade of modify data port hardware to accommodate multiple data port type devices. Multiple data port connectors may be utilized in a multiple programmable combinations and configurations. Configuration information may be received by the mobile data terminal or through remote communications such as an RF or cellular network.

Description:
BACKGROUND OF THE INVENTION 
     The present invention relates to data port switching circuits in mobile data terminals and more particularly to a programmable data port interface adapter. 
     There are many applications in which it is desirable for a computer type device to be able to communicate with a variety of external devices. For example, in a public mass transit environment, it would be advantageous for a mobile data terminal having data ports for connecting with RS-232 peripheral devices (e.g., printers, bar code readers, etc.) to be able to also accommodate input from J1708 peripheral devices (e.g., ADA Annunciator systems or passenger counting systems). Typical prior data terminal systems having RS-232 ports do not accommodate J1708 devices. Further, if connection to both J1708 and RS-232 ports is desired, dedicated ports for each type of device is typically required which are mutually exclusive to the other type of data port. Devices designed for RS-232 ports would require costly and time consuming hardware configurations to accommodate J1708 ports. Further, standard hardware switching circuits would typically add to the complexity and cost of the mobile data terminal. 
     It is therefore an object of the invention to provide a programmable data port interface adapter allowing for one type of data port to be seamlessly converted to another type of data port in an interface adapter system. 
     It is another object of the present invention to provide a mobile data terminal having modifiable data ports without requiring hardware modifications of the data terminal. 
     It is yet a further object of the invention to provide an interface adapter having a reconfigurable data port that dynamically adjusts the data port type according to the attached peripheral device. 
     SUMMARY OF THE INVENTION 
     The present invention constitutes a programmable data port interface adapter that allows for multiple data port configurations for various peripheral devices. The data port type switching may be implemented via software control. No hardware modification is required to implement data port configuration switching. 
     In an exemplary embodiment, a mobile data terminal designed to connect to common RS-232 type devices may be programmably configured to accommodate and communicate with other types of peripheral devices such as J1708 type devices with the use of the interface adapter. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 illustrates a conceptual block diagram of the programmable data port interface in accordance with the present invention. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENT 
     Referring now to FIG. 1, a conceptual block diagram of the programmable data port interface adapter of the present invention is shown. A mobile data terminal (&#34;MOBILE DATA TERMINAL&#34;) 102 may be utilized as an in field data collection device for collecting information for subsequent processing and analysis. The mobile data terminal 102 communicates with a flexible interface adapter (&#34;INTERFACE ADAPTER&#34;) 104 which is utilized to provide interfacing functions between the mobile data terminal 102 and external peripheral devices. The interface adapter 104 includes a programmable conversion circuit (&#34;CONVERSION CIRCUIT&#34;) 106 which receives data communications from the mobile data terminal 102. 
     The conversion circuit includes standard serial port connectors (not shown) to which external devices may be connected to communicate with the mobile data terminal 102. The interface adapter 104 further includes a data port selection control (&#34;SELECT&#34;) 108 for controlling the selection of the type of data port to be configured. The interface adapter 104 connects to external devices such as J1708 device (&#34;J1708&#34;) 110 and RS-232 device (&#34;RS-232&#34;) 112. 
     The data port selection control 108 operates to switch the configuration of the interface adapter 104 to provide the correct data port configuration for the appropriate external device (110, 112). A data port connector may be utilized which provides physical data port connections for both RS-232 and J1708 devices such that both an RS-232 and a J1708 device may be connected to the mobile data terminal 102 simultaneously. One or the other of the devices may be selected by switching between the provided physical data port connections. All switching of the connections is implemented by the interface adapter 104 via software control. Multiple data ports connectors may be provided on the mobile data terminal. By software control with the interface adapter 104, each of the data ports may be configured to a particular data port type. Thus, any combination or mix of external devices may be simultaneously connected to and communicate with the mobile data terminal 102 according to any desired peripheral device utilization schema. 
     Further, by utilization of software reconfiguration of the data ports, new switching code may be added for the interface adapter as port type needs and configurations are changed for the data terminal 102. Further, for remote installations of the mobile data terminal, the data port configuration may be remotely implemented through a radio-frequency or cellular linkage from a base station or host computer. 
     The following source code written in &#34;C&#34; programming language includes three subroutines which may be implemented by the interface adapter to control data port configuration switching between a J1708 serial port configuration and an RS-232 serial port configuration. Further code may be utilized to integrate the interface adapter into a particular data terminal system. 
     
         __________________________________________________________________________/*---------------------------------------------------------------------------**      Typedefs**---------------------------------------------------------------------------typedef unsigned char UBYTE;         /* Unsigned 8 bit quantity *//*---------------------------------------------------------------------------**     Defines**---------------------------------------------------------------------------#define RS232.sub.-- 5       0x04 /* enable rs-232 on comm 5 */#define J1708.sub.-- 5       0x04 /* enable j-1708 on comm 5 */#define RS232.sub.-- 6       0x08 /* enable rs-232 on comm 6 */#define J1708.sub.-- 6       0x08 /* enable j-1708 on comm 6 */#defineON 1#define OFF 0extern volatile UBYTE SCC.sub.-- POS.sub.-- 2             /* Start Cntr Cmd, Set Output Port Pins */extern volatile UBYTE SCC.sub.-- POC.sub.-- 2;             /* Stop Cntr Cmd, Clr Output Port Pins*//*---------------------------------------------------------------------------**      Function Prototypes**---------------------------------------------------------------------------*/static void set.sub.-- rs232.sub.-- j1708( GENMSG *ptr);void en232.sub.-- 5( UBYTE on.sub.-- off);void en232.sub.-- 6( UBYTE on.sub.-- off);/*---------------------------------------------------------------------------** SUBROUTINE:   set.sub.-- rs232.sub.-- 1708**** Description: configures comm5 or comm6 for rs232 orj1708**** Returns:   void**** Special Notes: sends ack if port number is ok, else sends nak to mdt****---------------------------------------------------------------------------*/static void set.sub.-- rs232.sub.-- 1708( GENMSG *ptr )BUFFER *outptr;GENMSG *outmsgptr;UBYTE ack.sub.-- nak;ack.sub.-- nak = ACK;if ( ptr -&gt; msg.rs232.sub.-- 1708.port.sub.-- number == 5){en232.sub.-- 5( ptr -&gt; msg.rs232.sub.-- 1708.set.sub.-- reset);}else if ( ptr -&gt; msg.rs232.sub.-- 1708.port.sub.-- number == 6){en232.sub.-- 6( ptr -&gt; msg.rs232.sub.-- 1708.set.sub.-- reset);}else{/* bad port number in message */ack.sub.-- nak = NAK;}outptr = OutBufReq();outmsgptr = &amp;( outptr -&gt; message);setmem (&amp;( outmsgptr -&gt; msg.rs.sub.-- j.sub.-- ACK), 0, sizeof( outmsgptr-&gt;msg.rs.sub.-- j.sub.-- ACK ));outmsgptr -&gt; msg.rs.sub.-- j.sub.-- ACK.ack.sub.-- nak = ack.sub.-- nak;mdt.sub.-- ready.sub.-- ip.sub.-- msg( RS232.sub.-- J1708.sub.-- ACK.sub.-- MSG.sub.-- ID    outmsgptr,    sizeof( outmsgptr -&gt; msg.rs.sub.-- j.sub.-- ACK),    0,    FALSE);OSQPost( MDTLoPrioQPtr, outptr );}/*---------------------------------------------------------------------------** SUBROUTINE:   en232.sub.-- 5**** Description: enables RS232 or J1708 communications for COMM5**** Returns:   void**** Special Notes: 1 = RS232, 0 = J1708****---------------------------------------------------------------------------*/void en232.sub.-- 5( UBYTE on.sub.-- off){if(on.sub.-- off == ON){/* clear the bit in OPCR, which sets the bit at OPx */SCC.sub.-- POC.sub.-- 2 = RS232.sub.-- 5}else{SCC.sub.-- POS.sub.-- 2 = J1708.sub.-- 5;}}/*---------------------------------------------------------------------------** SUBROUTINE:   en232.sub.-- 6**** Description: enables RS232 or J1708 communications for COMM6**** Returns:   void**** Special Notes: 1 = RS232, 0 = J1708****---------------------------------------------------------------------------*/void en232.sub.-- 6( UBYTE on.sub.-- off){if( on.sub.-- off == ON){/* clear the bit in OPCR, which sets the bit at OPx */SCC.sub.-- POC.sub.-- 2 = RS232.sub.-- 6;}else{SCC.sub.-- POS 2 = J1708.sub.-- 6;}}__________________________________________________________________________ 
    
     The set --  rs232 --  j1708() subroutine may be utilized upon the interface adapter 104 receiving a message identification from the mobile data terminal 102 directing the configuration of either communication port 5 or 6. The subroutine deciphers the message and determines which communication port is to be configured and which type of data port is to be configured. The subroutine then calls either subroutine en232 --  5( ) or en232 --  6() to implement configuration of the data ports. 
     The en232 --  5() subroutine sets a discrete output, EN232-5, to either a logical zero value or a logical one value based upon whether an ON or OFF is received. In hardware, EN232-5 is a digital control signal used to set up the required logic that configures the conversion circuitry and is controlled by the contents of variables SCC --  POC --  2 and SCC --  POS --  2. When EN232-5 has a logical value of one, communication port 5 is configured as an RS-232 data port. When EN232-5 has a logical value of zero, communication port 5 is configured as a J1708 data port. 
     The en232 --  6() subroutine sets a discrete output, EN232 --  6, to either a logical zero value or a logical one value based upon whether an ON or OFF is received. In hardware, EN232-6 is a digital control signal used to set up the required logic that configures the conversion circuitry and is controlled by the contents of variables SCC --  POC --  2 and SCC --  POS --  2. When EN232-6 has a logical value of one, communication port 6 is configured as an RS-232 data port. When EN232-6 has a logical value of zero, communication port 6 is configured as a J1708 data port. 
     It is believed that the programmable data port interface adapter of the present invention and many of its attendant advantages will be understood by the foregoing description, and it will be apparent that various changes may be made in the form, construction and arrangement of the components thereof without departing from the scope and spirit of the invention or without sacrificing all of its material advantages. The form herein before described being merely an explanatory embodiment thereof. It is the intention of the following claims to encompass and include such changes.