Electronic card and detecting method thereof

An electronic card and a detecting method are provided. The electronic card includes a connector. The detecting method detects whether an output signal from a host is received by Pin 41, Pin 43, Pin 47 and Pin 49 of the connector, or Pin 29, Pin 31, Pin 35 and Pin 37 of the connector, or Pin 17, Pin 19, Pin 23 and Pin 25 of the connector, or Pin 5, Pin 7, 11 and Pin 13 of the connector. According to the detecting result and the output signal, the electronic card judges the communication protocol of the host is a SATA communication protocol, a PCIe communication protocol or a USB3.0 communication protocol.

FIELD OF THE INVENTION

The present invention relates to an electronic device and a detecting method, and more particularly to an electronic card and a detecting method for detecting a communication protocol of a host and automatically executing a firmware unit corresponding to the communication protocol.

BACKGROUND OF THE INVENTION

Generally, the connectors of electronic cards have to comply with a Mini PCI-Express standard, an mSATA standard or an M.2 standard. The connector complying with the Mini PCI-Express standard supports the PCIe communication protocol. The connector complying with the mSATA standard supports the SATA communication protocol. The connector complying with the M.2 standard, formerly known as the Next Generation Form Factor (NGFF), supports the SATA communication protocol, the PCIe communication protocol and the USB 3.0 communication protocol. As known, the connector complying with the M.2 standard has many benefits such as small size, low power consumption and fast transmission speed and is able to support the above three communication protocol. Consequently, the connector complying with the M.2 standard becomes the mainstream.

As mentioned above, the connector complying with the M.2 standard can support the SATA communication protocol, the PCIe communication protocol and the USB 3.0 communication protocol. However, since each of the electronic card and the host (e.g., a motherboard) is designed to support a single communication protocol, some drawbacks occur. That is, the host is only able to support one of SATA communication protocol, the PCIe communication protocol and the USB 3.0 communication protocol, and the electronic card is only able to support one of the SATA communication protocol, the PCIe communication protocol and the USB 3.0 communication protocol. Moreover, it is difficult for the user to realize the communication protocol of the host. While the electronic card and the host handshake with each other to exchange data packets through an out-of-band (OOB) signal, if the communication protocol of the host and the communication protocol of the electronic card are different, the data packets cannot be accurately exchanged. Under this circumstance, the host and the electronic card cannot be in communication with each other. That is, the user has to change the electronic card until the electronic card complies with the communication protocol of the host. Even if the connector complying with the M.2 standard can support different communication protocols, the electronic card with the M.2 connector is not convenient. Moreover, while the electronic card and the host handshake with each other through the OOB signal, the electronic card with the M.2 connector and the host exchanges data packets only if the electronic card complies with the communication protocol of the electronic card. When the electronic card is coupled with the host, the electronic card cannot automatically detect the communication protocol of the host and select the corresponding communication protocol. In other words, the conventional electronic card with the M.2 connector is not user-friendly.

Therefore, there is a need of providing an improved electronic card and a detecting method in order to solve the above drawbacks.

SUMMARY OF THE INVENTION

An object of the present invention provides an electronic card and a detecting method. As previously described, the conventional electronic card is not user-friendly because it only supports a single communication protocol. The firmware unit of the electronic card of the present invention is selectively executed according to the communication protocol of the host. Consequently, the electronic card of the present invention is more user-friendly.

In accordance with an aspect of the present invention, there is provided a detecting method for an electronic card. The electronic card has a connector complying with an M.2 standard. The electronic card receives an output signal from a host through at least one of plural pins of the connector. The detecting method includes the following steps. Firstly, a step (a) is performed to detect whether the output signal is received by Pin 17, Pin 19, Pin 23 and Pin 25 or Pin 5, Pin 7, Pin 11 and Pin 13. In a step (b), if a detecting result of the step (a) is satisfied, a communication protocol of the host is judged as a PCIe communication protocol and the detecting method is ended. If the detecting result of the step (a) is not satisfied, a step (c) is performed to detect whether the output signal is received by Pin 41, Pin 43, Pin 47 and Pin 49. In a step (d), if a detecting result of the step (c) is satisfied, the communication protocol of the host is judged as the PCIe communication protocol or an SATA communication protocol according to the output signal, and the detecting method is ended. If the detecting result of the step (c) is not satisfied, a step (e) is performed to detect whether the output signal is received by Pin 29, Pin 31, Pin 35 and Pin 37. In a step (f), if a detecting result of the step (e) is satisfied, the communication protocol of the host is judged as the PCIe communication protocol or a USB 3.0 communication protocol according to the output signal and the detecting method is ended. If the detecting result of the step (e) is not satisfied, the detecting method is ended.

In accordance with another aspect of the present invention, there is provided a detecting method for an electronic card. The electronic card has a connector complying with an M.2 standard. The electronic card receives an output signal from a host through at least one of plural pins of the connector. The detecting method includes the following steps. In a step (a), a first detecting operation, a second detecting operation and a third detecting operation are defined. When the first detecting operation, the second detecting operation or the third detecting operation is performed, the electronic card detects whether the output signal is received by the corresponding pins of the connector. When the first detecting operation is performed, the electronic card detects whether the output signal is received by Pin 5, Pin 7, Pin 11 and Pin 13 or Pin 17, Pin 19, Pin 23 and Pin 25 of the connector11, and the communication protocol of the host is judged as the PCIe communication protocol if a detecting result of the first detecting operation is satisfied. When the second detecting operation is performed, the electronic card detects whether the output signal is received by Pin 41, Pin 43, Pin 47 and Pin 49, and the communication protocol of the host is judged as the PCIe communication protocol or the SATA communication protocol if a detecting result of the second detecting operation is satisfied. When the third detecting operation is performed, the electronic card detects whether the output signal is received by Pin 29, Pin 31, Pin 35 and Pin 37, the communication protocol of the host is judged as the PCIe communication protocol or the USB3.0 communication protocol if a detecting result of the third detecting operation is satisfied. In a step (b), any detecting operation of the first detecting operation, the second detecting operation and the third detecting operation is performed. If the communication protocol of the host is recognized, the detecting method is ended. In a step (c), if the communication protocol of the host is not recognized in the step (b), another detecting operation of the first detecting operation, the second detecting operation and the third detecting operation is performed. If the communication protocol of the host is recognized, the detecting method is ended. In a step (d), if the communication protocol of the host is not recognized in the step (c), a remaindering detecting operation of the first detecting operation, the second detecting operation and the third detecting operation is performed, and then the detecting method is ended.

In accordance with a further aspect of the present invention, there is provided an electronic card. The electronic card is in communication with a host. The electronic card includes a first firmware unit, a second firmware unit, a third firmware unit, a connector and a switching control unit. When the first firmware unit is executed, the electronic card supports a SATA communication protocol. When the second firmware unit is executed, the electronic card supports a PCIe communication protocol. When the third firmware unit is executed, the electronic card supports a USB 3.0 communication protocol. The connector complies with an M.2 standard, and serves as a communication medium between the electronic card and the host. The electronic card receives an output signal from the host through at least one of plural pins of the connector. The switching control unit is electrically connected with the plural pins. The first firmware unit, the second firmware unit or the third firmware unit is selectively executed by the switching control unit according to a communication protocol of the host.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

FIG. 1schematically illustrates the relationship between an electronic card and a host according to an embodiment of the present invention. An example of the electronic card1includes but is not limited to a solid state drive (SSD) or a non-volatile memory module. The electronic card1is detachably coupled with an insertion slot of a motherboard of the host2. When the electronic card1is coupled with host2, the host2issues an output signal to the electronic card1. According to the output signal, the host2and the electronic card1are in communication with each other to exchange data. In an embodiment, the electronic card1comprises a connector11, a first firmware unit12, a second firmware unit13, a third firmware unit14and a switching control unit15. The connector11complies with the M.2 standard. Moreover, the connector11can be plugged to the host2. The connector11is a communication medium between the electronic card1and the host2. In addition, the connector11comprises plural pins. When the electronic card1and the host2are coupled with each other, the pins of the electronic card1and the corresponding pins of the host2are electrically connected with each other. In addition, the electronic card1receives the output signal from the hot2through at least one pin of the plural pins.

When the first firmware unit12is executed, the electronic card1supports the SATA communication protocol. Consequently, the electronic card1and the host2exchange data through the connector11according to the SATA communication protocol. When the second firmware unit13is executed, the electronic card1supports the PCIe communication protocol. Consequently, the electronic card1and the host2exchange data through the connector11according to the PCIe communication protocol. When the third firmware unit14is executed, the electronic card1supports the USB3.0 communication protocol. Consequently, the electronic card1and the host2exchange data through the connector11according to the USB3.0 communication protocol.

The switching control unit15is electrically connected with the plural pins of the connector11. For example, the switching control unit15is a microcontroller. According to the communication protocol of the host2, the switching control unit15executes the first firmware unit12, the second firmware unit13or the third firmware unit14to support the SATA communication protocol, the PCIe communication protocol or the USB3.0 communication protocol. Consequently, the host2and the electronic card1exchange data according to the same communication protocol.

As mentioned above, the first firmware unit12, the second firmware unit13or the third firmware unit14of the electronic card1is selectively executed to support the SATA communication protocol, the PCIe communication protocol or the USB3.0 communication protocol according to the communication protocol of the host2. Consequently, the host2and the electronic card1exchange data according to the same communication protocol. As previously described, the conventional electronic card is not user-friendly because it only supports a single communication protocol. Since the firmware unit of the electronic card1of the present invention is selectively executed according to the communication protocol of the host2, the electronic card1is more user-friendly.

Moreover, the connector11of the electronic card1has one of three key types, e.g. a B key type, an M key type or a B+M. The key type of the connector11is selected according to the communication protocol. That is, the pin definitions of the connector11are determined according to the key type.

FIG. 2schematically illustrates the pin definitions connector of the M.2 connector of the electronic card ofFIG. 1according to the SATA communication protocol. When the electronic card1and the host2are in communication with the host2according to the SATA communication protocol, Pin 41, Pin 43, Pin 47 and Pin 49 receive the output signal from the host2. Consequently, the electronic card1is in communication with host2through Pin 41, Pin 43, Pin 47 and Pin 49.

FIG. 3schematically illustrates the pin definitions connector of the M.2 connector of the electronic card ofFIG. 1according to the PCIe communication protocol. When the electronic card1and the host2are in communication with each other according to the PCIe communication protocol, Pin 41, Pin 43, Pin 47 and Pin 49 receive the output signal from the host2, or Pin 29, Pin 31, Pin 35 and Pin 37 receive the output signal from the host2, or Pin 17, Pin 19, Pin 23 and Pin 25 receive the output signal from the host2, or Pin 5, Pin 7, Pin 11 and Pin 13 receive the output signal from the host2. Consequently, the electronic card1is in communication with the host2through Pin 41, Pin 43, Pin 47 and Pin 49, or Pin 29, Pin 31, Pin 35 and Pin 37, or Pin 17, Pin 19, Pin 23 and Pin 25, or Pin 5, Pin 7, Pin 11 and Pin 13.

FIG. 4schematically illustrates the pin definitions connector of the M.2 connector of the electronic card ofFIG. 1according to the USB 3.0 communication protocol. When the electronic card1and the host2are in communication with each other according to the USB 3.0 communication protocol, Pin 29, Pin 31, Pin 35 and Pin 37 receive the output signal from the host2. Consequently, the electronic card1is in communication with host2through Pin 29, Pin 31, Pin 35 and Pin 37.

Moreover, Pin 41, Pin 43, Pin 47 and Pin 49 are differential signal pairs according to the SATA communication protocol. Moreover, Pin 41, Pin 43, Pin 47 and Pin 49, or Pin 29, Pin 31, Pin 35 and Pin 37, or Pin 17, Pin 19, Pin 23 and Pin 25, or Pin 5, Pin 7, Pin 11 and Pin 13 are differential signal pairs according to the PCIe communication protocol. Moreover, Pin 29, Pin 31, Pin 35 and Pin 37 are differential signal pairs according to the USB 3.0 communication protocol. The differential signal pairs are used to receive the output signal (i.e. a differential signal) from the host2.

As mentioned above, the switching control unit15executes the first firmware unit12, the second firmware unit13or the third firmware unit14to support the SATA communication protocol, the PCIe communication protocol or the USB3.0 communication protocol according to the communication protocol of the host2. For judging the communication protocol of the host2, the switching control unit15further performs a detecting method.

FIG. 5is a flowchart of a detecting method for an electronic card according to a first embodiment of the present invention. In a step M1, a first detecting operation, a second detecting operation and a third detecting operation are defined. When the first detecting operation is performed, the switching control unit15detects whether the output signal is received by Pin 5, Pin 7, Pin 11 and Pin 13 or Pin 17, Pin 19, Pin 23 and Pin 25 of the connector11. If the detecting result of the first detecting operation is satisfied, the switching control unit15judges that the communication protocol of the host2is the PCIe communication protocol. When the second detecting operation is performed, the switching control unit15detects whether the output signal is received by Pin 41, Pin 43, Pin 47 and Pin 49. If the detecting result of the second detecting operation is satisfied, the switching control unit15judges that the communication protocol of the host2is the PCIe communication protocol or the SATA communication protocol. When the third detecting operation is performed, the switching control unit15detects whether the output signal is received by Pin 29, Pin 31, Pin 35 and Pin 37. If the detecting result of the third detecting operation is satisfied, the switching control unit15continuously detects the output signal and judges whether the communication protocol of the host2is the PCIe communication protocol or the USB3.0 communication protocol.

In a step M2, any detecting operation of the first detecting operation, the second detecting operation and the third detecting operation is performed. If the communication protocol of the host2is recognized, the detecting method is ended. If the communication protocol of the host2is not recognized, the next step is performed.

In a step M3, another detecting operation of the first detecting operation, the second detecting operation and the third detecting operation is performed. If the communication protocol of the host2is recognized, the detecting method is ended. If the communication protocol of the host2is not recognized, the next step is performed.

In a step M4, a remaindering detecting operation of the first detecting operation, the second detecting operation and the third detecting operation is performed.

After the above detecting method is completed, the switching control unit15can judge which of the SATA communication protocol, the PCIe communication protocol and the USB3.0 communication protocol is the communication protocol of the host2. If the communication protocol of the host2is the SATA communication protocol, the switching control unit15executes the first firmware unit12to support the SATA communication protocol. If the communication protocol of the host2is the PCIe communication protocol, the switching control unit15executes the second firmware unit13to support the PCIe communication protocol. If the communication protocol of the host2is the USB 3.0 communication protocol, the switching control unit15executes the third firmware unit14to support the USB 3.0 communication protocol.

Moreover, if the detecting result of the second detecting operation indicates that the output signal is received by Pin 41, Pin 43, Pin 47 and Pin 49, the switching control unit15further judges whether the communication protocol of the host2is the PCIe communication protocol or the SATA communication protocol according to a first predetermined judging rule. In an embodiment, the first predetermined judging rule is based on the voltage difference of the output signal. For example, if the voltage difference of the output signal is in a first range, the switching control unit15judges that the communication protocol of the host2is the PCIe communication protocol. Whereas, if the voltage difference of the output signal is in a second range, the switching control unit15judges that the communication protocol of the host2is the SATA communication protocol. After the switching control unit15recognizes the communication protocol of the host2according to the first predetermined judging rule, the detecting method is ended.

In another embodiment, the switching control unit15of the electronic card1directly judges whether the communication protocol of the output signal from the host2is the PCIe communication protocol or the SATA communication protocol according to the signal definition of the physical layer (i.e., the voltage or the wavelength of the signal). That is, if the detecting result of the second detecting operation indicates that the output signal is received by Pin 41, Pin 43, Pin 47 and Pin 49, the switching control unit15can recognize which of the PCIe communication protocol and the SATA communication protocol is the communication protocol of the output signal according to the signal definition of the physical layer. Consequently, the communication protocol of the host2is realized. After the switching control unit15recognizes the communication protocol of the host2according to the signal definition of the physical layer, the detecting method is ended. The signal definitions of the physical layer for the SATA communication protocol, the PCIe communication protocol and the USB3.0 communication protocol are well known to those skilled in the art, and are not redundantly described herein.

Moreover, if the detecting result of the third detecting operation indicates that the output signal is received by Pin 29, Pin 31, Pin 35 and Pin 37, the switching control unit15further judges whether the communication protocol of the host2is the PCIe communication protocol or the USB 3.0 communication protocol according to a second predetermined judging rule. In an embodiment, the second predetermined judging rule is based on the voltage difference of the output signal. For example, if the voltage difference of the output signal is in the first range, the switching control unit15judges that the communication protocol of the host2is the PCIe communication protocol. Whereas, if the voltage difference of the output signal is in a third range, the switching control unit15judges that the communication protocol of the host2is the USB 3.0 communication protocol. After the switching control unit15recognizes the communication protocol of the host2according to the second predetermined judging rule, the detecting method is ended. The first range, the second range and the third range of the voltage difference of the output signal are determined according to experiments.

In another embodiment, the switching control unit15of the electronic card1directly judges whether the communication protocol of output signal from the host2is the PCIe communication protocol or the USB 3.0 communication protocol according to the signal definition of the physical layer (i.e., the voltage or the wavelength of the signal). That is, if the detecting result of the second detecting operation indicates that the output signal is received by Pin 29, Pin 31, Pin 35 and Pin 37, the switching control unit15can recognize which of the PCIe communication protocol and the USB 3.0 communication protocol is the communication protocol of the output signal according to the signal definition of the physical layer. Consequently, the communication protocol of the host2is realized. After the switching control unit15recognizes the communication protocol of the host2according to the signal definition of the physical layer, the detecting method is ended. The signal definitions of the physical layer for the SATA communication protocol, the PCIe communication protocol and the USB3.0 communication protocol are well known to those skilled in the art, and are not redundantly described herein.

In the above embodiment, the sequence of performing the first detecting operation, the second detecting operation and the third detecting operation is not restricted. In some other embodiments, the first detecting operation, the second detecting operation and the third detecting operation are performed according to a predetermined sequence. A detecting method of performing the first detecting operation, the second detecting operation and the third detecting operation according to the predetermined sequence will be described as follows.

FIG. 6is a flowchart of a detecting method for an electronic card according to a second embodiment of the present invention.

Firstly, in a step S1, the switching control unit15performs a first detecting operation to detect whether the output signal is received by Pin 17, Pin 19, Pin 23 and Pin 25 or Pin 5, Pin 7, Pin 11 and Pin 13 of the connector11.

Then, a step S2is performed. If the detecting result of the first detecting operation is satisfied, the switching control unit15judges that the communication protocol of the host2is the PCIe communication protocol and the detecting method is ended. If the detecting result of the first detecting operation is not satisfied, the next step is performed.

In a step S3, the switching control unit15performs a second detecting operation to detect whether the output signal is received by Pin 41, Pin 43, Pin 47 and Pin 49.

Then, a step S4is performed. If the detecting result of the second detecting operation is satisfied, the switching control unit15judges whether the communication protocol of the host2is the PCIe communication protocol or the SATA communication protocol according to the output signal. If the detecting result of the second detecting operation is not satisfied, the next step is performed.

In a step S5, the switching control unit15performs a third detecting operation to detect whether the output signal is received by Pin 29, Pin 31, Pin 35 and Pin 37.

Then, a step S6is performed. If the detecting result of the third detecting operation is satisfied, the switching control unit15judges whether the communication protocol of the host2is the PCIe communication protocol or the USB 3.0 communication protocol according to the output signal. If the detecting result of the third detecting operation is not satisfied, the detecting method is ended.

From the above descriptions, the present invention provides an electronic card and a detecting method. The electronic card comprises a first firmware unit, a second firmware unit and a third firmware unit. When the first firmware unit is executed, the electronic card supports the SATA communication protocol. When the second firmware unit is executed, the electronic card supports the PCIe communication protocol. When the third firmware unit is executed, the electronic card supports the USB3.0 communication protocol. By performing the detecting method, the electronic card automatically detects whether the communication protocol of the host is the SATA communication protocol, the PCIe communication protocol or the USB3.0 communication protocol and automatically executes the corresponding firmware unit. As previously described, the conventional electronic card is not user-friendly because it only supports a single communication protocol. Since the firmware unit of the electronic card of the present invention is selectively executed according to the communication protocol of the host, the electronic card is more user-friendly.