Abstract:
A printer includes: a USB connector that is detachably connected to a USB interface forming a data communication channel through which data can be exchanged between the printer and an external device; a second connector that is constantly connected to a second interface that is provided independently of the USB interface and forms a data communication channel through which data can be exchanged between the printer and the external device; a USB connection detection section that detects whether the USB interface is connected to the USB connector; a signal channel selection section that receives a switch control signal from the USB connection detection section and switches a data communication channel from the data communication channel using the second interface through which data is exchanged between the printer and external device to a data communication channel using the USB interface; a signal conversion section that is provided between the signal channel selection section and second connector and coverts USB data signal into a data signal for the second interface and vice versa; and a USB controller that controls USB connection.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
       [0001]    This application is based upon and claims the benefit of priority from the prior Japanese Patent Application No. 2008-197798, filed on Jul. 31, 2008, the entire contents of which are incorporated herein by reference. 
       BACKGROUND OF THE INVENTION 
       [0002]    1. Field of the Invention 
         [0003]    The present invention relates to a printer that exchanges data with a host computer serving as an external device through data exchange channels of a plurality of different interfaces and a control method thereof. 
         [0004]    2. Description of the Related Art 
         [0005]    Conventionally, there is available a printer that is connected, using a plurality of interfaces (hereinafter, abbreviated as “I/F”) corresponding to a plurality of data exchange channels, to a host computer serving as an external device with which the printer exchanges data. 
         [0006]    When viewed from a point of view of a data exchange means, there is known a printer that is provided with both a wired data exchange means that communicates with a host computer using a communication cable and an infrared ray data exchange means that communicates with a host computer through an infrared ray. 
         [0007]    In a printer that is provided with two different data exchange means, in the case where a user selects one of the data exchange means for use in accordance with the connection environment of the host computer to be connected, he previously performs setting by using a DIP switch (setting switch) provided to the printer so as to activate one of the data exchange means based on information set by the DIP switch. As another example, known is a configuration in which switching between communication channels and communication means in the printer is automatically made based on whether an input communication switching signal is High level or Low level (refer to, e.g., Jpn. Pat. Appln. Laid-Open Publication No. 2000-158747). 
         [0008]    When viewed from a point of view of a data transmission method, a printer provided with a plurality of I/Fs has I/Fs corresponding to a plurality of buses. The I/Fs mentioned are, e.g., Ethernet®, USB (Universal Serial Bus), and IEEE1394. 
         [0009]    In this case, a user selects, from the plurality of I/Fs, a desired I/F based on the use state of the printer, and the print data from application software is transferred through a printer driver (refer to, e.g., Jpn. Pat. Appln. Laid-Open Publication No. 2003-076649). 
         [0010]    Generally, in a printer that is provided with a plurality of I/Fs, a user manually selects an I/F to be used after the printer enters a set-up mode on each occasion. 
         [0011]    In a printer provided with a plurality of I/Fs corresponding to a plurality of data transfer channels, in order to validate the content of user setting in a set-up mode that executes selection of a character generator to be used, the printer needs to be rebooted every time the I/F to be used is switched, thereby providing a user with troublesome work and causing errors in association with the troublesome work. 
       BRIEF SUMMARY OF THE INVENTION 
       [0012]    It is an object of the present invention to provide a printer provided with a plurality of I/Fs, including USB, corresponding to a plurality of data transfer communication and capable of automatically switching between the plurality of I/Fs by detecting the connection of a USB cable. 
         [0013]    In an aspect of the present invention, a printer includes: a USB connector that is detachably connected to a USB interface forming a data communication channel through which data can be exchanged between the printer and an external device; a second connector that is constantly connected to a second interface that is provided independently of the USB interface and forms a data communication channel through which data can be exchanged between the printer and the external device; a USB connection detection section that detects whether the USB interface is connected to the USB connector; a signal channel selection section that receives a switch control signal from the USB connection detection section and switches a data communication channel from the data communication channel using the second interface through which data is exchanged between the printer and external device to a data communication channel using the USB interface; a signal conversion section that is provided between the signal channel selection section and second connector and coverts USB data signal into a data signal for the second interface and vice versa; and a USB controller that controls USB connection. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0014]      FIG. 1  is a block diagram for explaining a printer and a control method thereof, which shows functions of a controller and a data communication section of the printer; 
           [0015]      FIG. 2  is a flowchart showing operation of I/F switch control in the present invention; and 
           [0016]      FIG. 3  is a flowchart showing operation of I/F switch control in the present invention. 
       
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
       [0017]    Throughout this description, the embodiments and examples shown should be considered as exemplars, rather than limitations on the apparatus and methods of the present invention. 
         [0018]    A preferred embodiment for practicing a printer and a control method thereof will be described below with reference to the accompanying drawings. 
         [0019]      FIG. 1  is a block diagram for explaining a printer and a control method thereof, which shows functions of a controller and a communication section of the printer. The present embodiment focuses on a data communication channel between a printer and a host computer and does not relate directly to a printing method of the printer or configuration of a printing section of the printer. That is, the printing method may be an impact method (wire-dot method, etc.) or non-impact method (ink-jet method, etc.). Further, a known configuration may be applied to the printing section irrelevant of the printing method employed. Thus, a description of a configuration of the printing section and the like of the printer is omitted. 
         [0020]    A control/communication section  1  of the printer roughly includes a USB connector  3 , an Ethernet connector  4 , a selector  5  that selects a signal channel, a signal conversion section  6 , a USB connection detection section  7 , and a USB controller  8 . 
         [0021]    The control/communication section  1  of the printer is connected to a host computer (not shown) which is an external device with which the printer exchanges data through communication cables  2   a  and  2   b.  One USB connector  3  and one Ethernet connector  4  (second connector) are provided in the control/communication section  1 . 
         [0022]    The communication cable  2   b  connected to the Ethernet connector  4  is an Ethernet cable. The Ethernet cable  2   b  is a bus type interface and is constantly connected to the printer through the Ethernet connector  4 . Thus, data communication state through a LAN between the host computer and the control/communication section  1  of the printer is always established. 
         [0023]    On the other hand, the USB connector  3  provided in the control/communication section  1  is a four-pin USB connector compliant with USB specification. According to USB specification, signals of Vbus, D+, D−, and GND are assigned to the four pins of the USB connector  3 , respectively. It goes without saying that one or more USB connector  3  may be provided. 
         [0024]    Vbus is used as a line for supplying power to the selector IC  5  or USB controller  8  that is activated by a USB signal, and the ground level thereof is GND. D+ and D− are lines for exchanging data on USB data communication. The D+ and D− each function as a differential signal having an amplitude of 3.3 V in FS mode and 400 mV in HS mode. 
         [0025]    In USB specification, there exist three data transfer rates: 1.5 Mbps, 12 Mbps, and 480 Mbps, which are referred to as LS mode, FS mode, and HS mode, respectively. According to the USB specification, D− is pulled up in LS mode, and D+ is pulled up in FS and HS modes. 
         [0026]    An output signal from the USB connector is input to the selector  5  as an X 1  signal. An output signal from the Ethernet connector  4  is input to the signal conversion section  6 . The input Ethernet signal is then converted into a USB signal by the signal conversion section  6 , followed by assignation of signals of Vbus, D+, D−, and GND to the USB signal. Then, the USB signal is input to the selector  5  as an X 2  signal. 
         [0027]    The signal conversion section  6  is a bi-directional signal device and is configured to convert an Ethernet signal into an USB signal and, conversely, in the case where information on the printer side needs to be transmitted to the host computer, convert an USB signal into an Ethernet signal. Thus, the signal conversion section  6  has a function of converting a signal into a signal conforming to a predetermined protocol. 
         [0028]    The Vbus signal which is one of the USB signals output from the USB connector  3  is input to an IO port of the USB connection detection section  7 . The USB connection detection section  7  detects whether the USB cable is connected to the USB connector  3 . More specifically, when the host computer and the control/communication section  1  are connected to each other by the USB communication cable  2   a,  the USB connection detection section  7  detects a change in the potential of Vbus. That is, the USB connection detection section  7  detects a change in the potential of Vbus to thereby determine whether the USB cable is connected to the USB connector  3 . 
         [0029]    Note that a USB device has a plug-and-play (PnP) function of automatically starting system configuration upon connection of the USB cable  2   a  to the USB connector  3 , thereby eliminating the need for a user to perform setting of the host in accordance with its peripheral device or restart the host. 
         [0030]    That is, when the host computer which is a host device and the control/communication section  1  of the printer which is a USB device are connected to each other, USB data is exchanged between USB terminals. At this time, the type of the USB device is recognized, and a driver corresponding to the recognized USB device type is loaded, whereby a system performing the USB data communication is established. After that, data communication is repeated as needed between the host device (host computer) and USB device (control/communication section  1  of the printer) as long as the data communication state is established. 
         [0031]    That is, by the operation that connects the USB cable  2   a  to the USB connector  3 , the plug-and-play operation is started and, whereby, the device is recognized. A set of protocols required at this time are defined by USB specification. 
         [0032]    The USB connection detection section  7  can be constituted by an ASIC (Application Specific Integrated Circuit). In this case, various control circuits are formed. Although not shown, examples of the various control circuits include an interruption control circuit for controlling various interruption processing, an encoder processing circuit for controlling an encoder that detects the position of a recording head (in the case of a printer of a type in which the recording head is moved), a bus control/DMA controller for controlling data transfer using DMA (Direct Memory Access), a motor control circuit for controlling drive of a motor for driving a paper feeding roller, an I/F control circuit for controlling a USB I/F connecting a computer with a peripheral device, a power control circuit for controlling a plurality of types of power supplies such as an AC power supply and USB power supply, and the like. 
         [0033]    An output signal from the IO port of the USB connection detection section  7  is input to the selector  5  as a selector switch control signal, whereby information on whether the USB cable is connected to the USB connector  3  is transmitted to the selector  5 . Upon reception of the selector switch control signal, the selector  5  performs switching between the X 1  signal output from the USB connector  3  and the X 2  signal which is a USB signal that has been converted from an Ethernet signal. 
         [0034]    An output signal from the selector  5  is input to the USB controller  8 . The USB controller  8  controls the host computer which is the USB host and the control/communication section  1  of the printer which is the USB device to control/process transmission/reception of a data communication signal according to a USB protocol. 
         [0035]    The USB controller  8  has a DIR terminal for a transmission/reception switch signal, a D+ terminal, and a D− terminal, as well as a Vbus terminal and a GND terminal. The USB controller  8  transmits/receives the USB data communication signal through the D+ terminal and D− terminal. 
         [0036]    Further, the USB controller  8  analyzes the USB data communication signal received through the D+ terminal and D− terminal to generate a control signal indicating the transmission direction of the USB data communication signal and, based on the generated control signal, controls the voltage of the DIR terminal. 
         [0037]    Note that  FIG. 1  is a functional block diagram and therefore the respective sections are shown in an independent manner. Actually, however, the selector  5  or the signal conversion section  6  may be incorporated in the printer or may be externally provided to the printer. Further, the USB connection detection section  7 , selector  5 , and USB controller  8  may be mounted in one package. 
         [0038]    Further, although Ethernet is used for LAN data communication in the above case, IEEE 1394 and the like may be used. 
         [0039]    Next, the I/F switch control in the control/communication section  1  of the printer having the above configuration will be described. 
         [0040]    First, a state where the USB cable  2   a  is connected to the USB connector  3  of the control/communication section  1  will be described. 
         [0041]      FIG. 2  is a flowchart showing a state where the USB cable  2   a  is connected to the USB connector  3  of the control/communication section  1 . 
         [0042]    It is determined at the IO port of the USB connection detection section  7  “whether Vbus, which is one of the output signals from the USB connector  3 , is ON” (step S 1 : connection determination step). 
         [0043]    When it is determined that “Vbus is ON”, it is determined “whether ON state continues for  500  ms” (step S 2 : connection time determination step). 
         [0044]    When it is determined in step S 1  that “Vbus is OFF”, the flow is ended. 
         [0045]    When it is determined by the USB connection detection section  7  that “ON state continues for 500 ms”, “selector switch control signal” is transmitted from the USB connection detection section  7  to the selector  5 . Then, the selector  5  performs “disconnection processing of USB signal from Ethernet side (X 2 )”. (step S 3 : switching step). 
         [0046]    When it is determined that “ON state does not continue for 500 ms”, the flow returns to step S 1 . 
         [0047]    Then, the selector  5  switches connection “from Ethernet side (X 2 ) to USB side (X 1 )” (step S 4 : switching step). 
         [0048]    Subsequently, USB connection processing to the USB side (X 1 ) is performed (step S 5 ). 
         [0049]    As a result, the USB side (X 1 ) is effective, and data communication state through the USB side (X 1 ) is established (step S 6 ). 
         [0050]    Next, a state where the USB cable  2   a  is not connected to the USB connector  3  of the control/communication section  1  will be described. 
         [0051]      FIG. 3  is a flowchart showing a state where the USB cable  2   a  is not connected to the USB connector  3  of the control/communication section  1 . 
         [0052]    It is determined by the USB connection detection section  7  “whether Vbus, which is one of the output signals from the USB connector  3 , is OFF” (step S 11 : connection determination step). 
         [0053]    When it is determined that “Vbus is OFF”, it is determined “whether OFF state continues for 500 ms” (step S 12 : disconnection time determination step). 
         [0054]    When it is determined in step S 11  that “Vbus is ON”, the flow is ended. 
         [0055]    When it is determined by the USB connection detection section  7  that “OFF state continues for 500 ms”, “selector switch control signal” is transmitted from the USB connection detection section  7  to the selector  5 . Then, the selector  5  performs “disconnection processing of USB signal from USB side (X 1 )” (step S 13 ). 
         [0056]    When it is determined that “OFF state does not continue for 500 ms”, the flow returns to step S 11 . 
         [0057]    Then, the selector  5  switches connection “from USB side (X 1 ) to Ethernet side (X 2 )” (step S 14 : switching step). 
         [0058]    Subsequently, USB connection processing to the Ethernet side (X 2 ) is performed (step S 15 ). 
         [0059]    As a result, the Ethernet side (X 2 ) is effective, and data communication state through the Ethernet side (X 2 ) is established (step S 16 ). 
         [0060]    With the above processing steps, the printer having a plurality of I/Fs including a USB corresponding to a plurality of data communication channels detects the connection of the USB cable and thereby automatically switching between the plurality of I/Fs. 
         [0061]    According to the present embodiment, it is possible to eliminate for an operator to perform additional setup work of a printer or restart of a printer. Thus, errors due to the additional setup work can be avoided. 
         [0062]    The present invention is not limited to the above embodiment but various modifications can be made within the scope of the present invention. Further, various inventions can be formed by appropriately combining a plurality of required constituent elements disclosed in the embodiment. For example, some required constituent elements may be omitted from all required constituent elements disclosed in the embodiment. Furthermore, required constituent elements across different embodiments may be appropriately combined.