Background
Fig. 1 is a schematic diagram of a conventional electronic device connected to a memory card. The electronic device 10 (e.g., a desktop computer, a notebook computer, a tablet computer, a mobile phone, etc.) includes a processing unit 110, a memory card access unit 130 and a memory card slot 150. The processing unit 110 accesses the memory card 15 inserted in the memory card slot 150 through the memory card access unit 130. The transmission interface 120 between the processing unit 110 and the memory card access unit 130 is, for example, a common PCIe interface; the transmission interface 140 between the memory card access unit 130 and the memory card 15 is, for example, a common Secure Digital (SD) interface. The main function of the memory card access unit 130 is to provide data format conversion between the PCIe interface and the SD interface.
Since the PCIe interface is becoming mainstream, the memory card 15 may use the PCIe interface to communicate with the processing unit 110 directly (i.e. without going through the memory card accessing unit 130). However, during the transition period between the conversion of a new memory card (PCIe memory card) to an old memory card (SD memory card), it is highly likely that the manufacturer of the electronic device 10 will design the electronic device 10 to have the capability of reading the new and old memory cards. However, since the processing unit 110 only provides a limited number of PCIe channels (lanes), if the manufacturer of the electronic device 10 allocates the PCIe channels of the processing unit 110 to the SD memory card (accessed through the memory card access unit 130) and the PCIe memory card (directly accessed) for the card reading function, the support of the electronic device 10 to other peripheral devices, such as a display card, a wireless communication module (e.g., WIFI, Long Term Evolution (LTE), Bluetooth (Bluetooth), etc.), a wired communication module (e.g., ethernet, etc.), a storage device (e.g., a solid state disk, etc.), and a Universal Serial Bus (USB) control module, etc., will be sacrificed.
In addition, when the electronic device 10 supports both old and new memory cards, the user must distinguish the kind of the memory card before inserting the memory card, which causes inconvenience in use. Furthermore, when the processing unit 110 directly accesses the memory card 15, the performance of data transmission may be reduced or even access errors may occur due to poor contact between the memory card 15 and the memory card slot 150.
Disclosure of Invention
In view of the disadvantages of the prior art, an object of the present invention is to provide a memory card access module and a memory card access method.
The invention discloses an electronic device, which is coupled between a processing unit and a memory card slot and used for accessing a memory card. The device comprises a detection unit, a selection unit, a memory card access unit and a control unit. The detecting unit is used for detecting whether the memory card supports a PCI express interface. The selection unit is used for selecting a first data transmission path or a second data transmission path, wherein the second data transmission path allows the processing unit and the memory card to transmit data through the PCI express interface. The memory card access unit is used for accessing the memory card and providing data format conversion between a transmission interface and the PCI express interface. The control unit is used for controlling the selection unit to select the second data transmission path when the detection unit indicates that the memory card supports the PCI express interface, and controlling the selection unit to select the first data transmission path when the detection unit indicates that the memory card does not support the PCI express interface.
The invention also discloses a memory card access method, which is applied to an electronic device, a processing unit of the electronic device can access a memory card through a memory card slot, and the method comprises the following steps: detecting whether the memory card supports a PCI express interface; when the memory card does not support the PCI express interface, the processing unit accesses the memory card through a first data transmission path, and performs data format conversion between a transmission interface and the PCI express interface by using a memory card access unit located on the first data transmission path; and enabling the processing unit to access the memory card through a second data transmission path when the memory card supports the PCI express interface, wherein the second data transmission path allows the processing unit and the memory card to transmit data through the PCI express interface.
The present invention further discloses an electronic device, coupled between a processing unit and a socket, for selectively accessing a PCI express device directly. The device comprises a detection unit, a selection unit, a memory card access unit and a control unit. The detection unit is used for detecting whether a device connected with the slot is the PCI express device or not. The selection unit is used for selecting a first data transmission path or a second data transmission path, wherein the second data transmission path allows the processing unit and the PCI express device to transmit data through a PCI express interface. The storage card access unit is used for accessing a storage card and providing data format conversion between a transmission interface and the PCI express interface. The control unit is used for controlling the selection unit to select the second data transmission path when the detection unit indicates that the equipment is the PCI express equipment, and controlling the selection unit to select the first data transmission path when the detection unit indicates that the equipment is not the PCI express equipment.
The electronic device and the memory card access method can enable the electronic device to directly access PCIe equipment or indirectly access non-PCIe equipment by using the same PCIe interface, achieve the technical effect of sharing the PCIe interface, and reduce the usage amount of PCIe channels. When the interface is applied to the access of the PCIe memory card, the invention provides a user-friendly interface; in addition, the invention can also add the related circuit of the enhanced transmission signal to improve the efficiency when accessing the memory card and reduce the probability of access error. Compared with the complex circuit of the existing PCIe switch, the invention can achieve the purpose of sharing the PCIe interface by using a simple circuit, thereby not only saving the cost, but also reducing the difficulty of circuit design.
The features, implementations, and technical effects of the present invention are described in detail below with reference to the accompanying drawings.
Drawings
FIG. 1 is a diagram illustrating a conventional electronic device connected to a memory card;
FIG. 2 is a functional block diagram of an embodiment of a memory card access module according to the present invention;
FIGS. 3A-3D are flow charts illustrating an embodiment of a memory card accessing method according to the present invention;
FIG. 4 is a schematic diagram of the connection between the processing unit and the memory card access unit;
FIG. 5 is a functional block diagram of another embodiment of a memory card access module of the present invention;
FIGS. 6A-6C are detailed steps of a memory card access method corresponding to the memory card access module of FIG. 5; and
FIG. 7 is a diagram illustrating the sharing of coupling capacitors for the PCIe interface.
Description of reference numerals:
10. 20, 50 electronic device
15. 25 memory card
110. 210, 710 processing unit
120. 140, 220, 232, 234, 236, 536, 538 transfer interface
130. 233 memory card access unit
150 memory card slot
230. 530, 720, 770 memory card access module
250 slot
231 selection unit
235. 535 control unit
237 detection unit
410 coupling capacitor
420a, 420b switch
430a, 430b resistors
539 Signal optimization Unit
730 PCIe devices
740. 750, 780 capacitor group
S310 to S640
Detailed Description
The technical terms in the following description refer to the conventional terms in the technical field, and some terms are explained or defined in the specification, and the explanation of the some terms is based on the explanation or the definition in the specification.
The disclosure of the invention includes a memory card access module and a memory card access method. Since some of the components included in the memory card access module of the present invention may be known components alone, the following description will omit details of the known components without affecting the full disclosure and the feasibility of the invention of the device. In addition, the memory card access method of the present invention can be performed by the memory card access module of the present invention or its equivalent device, and the following description of the method invention will focus on the contents of steps rather than hardware without affecting the full disclosure and feasibility of the method invention.
FIG. 2 is a functional block diagram of an embodiment of a memory card access module according to the invention. The memory card access module 230 is implemented in the electronic device 20 and is coupled between the processing unit 210 of the electronic device 20 and the slot 250. The processing unit 210 is a System on Chip (SoC) or a Chip set (chipset) of the electronic device 20, such as a central processing unit, a microprocessor, and the like. Slot 250 may be for insertion of a memory card 25 or other device. The memory card access module 230 includes a selection unit 231, a memory card access unit 233, a control unit 235, and a detection unit 237. Transport interface 220, transport interface 232, and transport interface 236 are PCIe interfaces, and transport interface 234 is an SD interface. One of the main functions of the memory card access unit 233 is to provide data format transfer between the PCIe interface and the SD interface. The control unit 235 may be implemented, for example, in logic circuits or a microcontroller.
FIGS. 3A-3D are flow charts of an embodiment of a memory card accessing method of the present invention. The detecting unit 237 detects whether a memory card is inserted into the slot 250 (e.g., detecting a pin position by a card of a memory card slot) (step S310). When the control unit 235 knows that no memory card is inserted according to the control signal of the detecting unit 237, the control unit 235 controls the electronic device 20 to be in the preset state (step S320). In detail, the default state may be (1) the transmission interface 220 is in use, that is, the processing unit 210 and the memory card access unit 233 are connected through the transmission interface 220 and the transmission interface 232; or (2) transport interface 220 is not in use, i.e., processing unit 210 is not connected to any device via transport interface 220.
In the state (1), the control unit 235 controls the selection unit 231 to select the first data transmission path (including the transmission interface 232, the memory card access unit 233, and the transmission interface 234) (step S321 in fig. 3B), and controls the memory card access unit 233 to mount (load) the terminal resistor (termination resistor) (step S323 in fig. 3B). In the state (2), the control unit 235 may (a) control the selection unit 231 to select the first data transmission path (step S325 of fig. 3C) and control the memory card access unit 233 to unload (unload) the end resistor (step S327 of fig. 3C); or (B) the control selection unit 231 selects the second data transmission path (including the transmission interface 236) (step S329 in fig. 3D).
The details of the mount and unload terminal resistors are described below. Fig. 4 is a schematic diagram of the connection between the processing unit 210 and the memory card access unit 233, and exemplarily shows one channel of the PCIe interface. As shown, one channel includes a differential transmit pair Tx and a differential receive pair Rx (here, transmit and receive are for the memory card access unit 233). The differential transmit pair Tx and the differential receive pair Rx each comprise two transmission lines (transmission lines), each having a coupling capacitor 410. The memory card access unit 233 includes switches 420a, 420b and resistors 430a, 430 b. The mounted resistance means that the memory card access unit 233 controls the switches 420a and 420b to be turned on according to the control signal of the control unit 235, so that the resistors 430a and 430b are connected to the differential receiving pair Rx of the PCIe channel, and the unloaded resistance means that the memory card access unit 233 controls the switches 420a and 420b to be turned off according to the control signal of the control unit 235. Note that if the switches 420a and 420b are originally in the on state, the "on-resistance" operation means that the memory card access unit 233 does not perform any action (i.e., the step of "on-resistance" can be skipped), and the "off-resistance" operation is the same.
Returning to fig. 3A, after determining that the memory card is inserted into the slot 250 (yes in step S310), the detecting unit 237 further detects the type of the inserted memory card, that is, detects that the inserted memory card is a PCIe memory card (a memory card supporting a PCIe interface) or another memory card, for example, an SD memory card (a memory card supporting an SD interface) (step S330). The detection unit 237 can perform detection by the following two detection methods, but is not limited thereto. The first method is a detection method defined by the PCIe standard, that is, the detection unit 237 uses a periodic pulse to measure the charging time of the capacitor for determination. In particular, when the PCIe memory card is inserted into the slot 250, the parasitic capacitance on the slot 250 increases, which lengthens the charging time. The second method is to determine whether the voltage of the clock pin requirement (CLKRREQ #) of the PCIe interface is changed. Since the PCIe memory card is initialized when inserted into the slot 250, the PCIe memory card requires an external clock time during initialization. When the PCIe memory card requests a clock from the host (host) (i.e., the electronic device 20), the potential on the clock pin changes.
The control unit 235 determines that the memory card access module 230 is to operate in the non-PCIe device access mode or the PCIe device access mode according to the detection result of the detection unit 237. When the detecting unit 237 indicates that the memory card is a non-PCIe memory card (no in step S330), the control unit 235 controls the memory card access module 230 to operate in the non-PCIe device access mode (step S340), otherwise, controls the memory card access module 230 to operate in the PCIe device access mode (step S350). In the non-PCIe device access mode, the control unit 235 controls the selection unit 231 to switch to the memory card access unit 233 (step S342), and controls the memory card access unit 233 mount terminal resistance (step S344); that is, in this mode, the control unit 235 connects the processing unit 210 and the memory card access unit 233 and is capable of transferring data. In the PCIe device access mode, the control unit 235 controls the selection unit 231 to switch to the PCIe device (step S352); that is, in this mode, the control unit 235 enables the processing unit 210 to directly access the PCIe memory card through the transport interface 236.
FIG. 5 is a functional block diagram of another embodiment of a memory card access module according to the invention. The memory card access module 530 is implemented in the electronic device 50 and is coupled between the processing unit 210 of the electronic device 50 and the slot 250. The processing unit 210 is a system-on-chip or a chip set of the electronic device 50. The memory card access module 530 includes a selection unit 231, a memory card access unit 233, a control unit 535, a detection unit 237, and a signal optimization unit 539. Transport interface 536 and transport interface 538 are PCIe interface interfaces. Elements with the same number in fig. 2 and 5 have the same function and are not described again. The control unit 535 may be implemented, for example, in a logic circuit or a microcontroller.
Since the memory card 25 and the socket 250 may have poor contact or oxidized terminals to reduce the performance of data transmission or even cause access errors, the embodiment provides the signal optimization unit 539 to perform enhancement (e.g., driver) and/or retiming (timer) on the transmission signal between the memory card 25 and the processing unit 210, or add protocol analysis processes such as protocol aware (protocol aware) to adjust the protocol content. In response to this embodiment, steps S320 and S350 of fig. 3A are slightly adjusted.
For step S320, in state (1) (i.e. the transmission interface 220 is in use), the control unit 535 may (a) (corresponding to fig. 3B) control the selection unit 231 to select the first data transmission path (including the transmission interface 232, the memory card access unit 233, and the transmission interface 234) and control the mounting terminal resistance of the memory card access unit 233; or (B) (corresponding to fig. 6A), the selection unit 231 is controlled to select the second data transmission path (including the transmission interface 536, the signal optimization unit 539, and the transmission interface 538) (step S610), and the signal optimization unit 539 is controlled to mount the resistor (step S620). In state (2) (i.e., the transmission interface 220 is not in use), the control unit 535 may (a) (corresponding to fig. 3C) control the selection unit 231 to select the first data transmission path and control the memory card access unit 233 to unload the terminal resistor; or (B) (corresponding to fig. 6B), the selection unit 231 is controlled to select the second data transmission path (step S630), and the signal optimization unit 539 is controlled to unload the termination resistance (step S640).
For step S350 (corresponding to fig. 6C), after step S352, the control unit 535 further controls the signal optimization unit 539 to mount the resistor (step S534), so as to establish a connection with the processing unit 210 and the memory card 25. Note that the end of the signal optimization unit 539 connected to the processing unit 210 and the end connected to the memory card 25 each include a termination resistor (both on the receiving end for the signal optimization unit 539). Like the memory card access unit 233, the signal optimization unit 539 uses a switch mount/dismount terminal resistor. How the signal optimization unit 539 is, for example, a redrive (redriver) circuit and/or a retimer (retimer) circuit.
In summary, the memory card access module of the present invention integrates the transmission interface interfaces of the PCIe memory card and the non-PCIe memory card, so as to provide greater flexibility for manufacturers of electronic devices to plan PCIe channels of the processing unit (i.e., without sacrificing other PCIe devices or using many discrete components to integrate other interface interfaces in order to support two types of memory cards at the same time), and also provide more user-friendly operations for users (i.e., the two types of memory cards are inserted into the same memory card slot). In addition, the invention can further help manufacturers of electronic devices to save the number of coupling capacitors on the circuit, thereby reducing the cost and simplifying the design. In detail, as shown in fig. 7, before the PCIe interface is not shared (fig. 7A), the memory card access module 720 (providing the function of reading the non-PCIe memory card) and the PCIe device 730 each occupy one PCIe interface (which may include one or more channels) of the processing unit 710, and each interface includes one capacitor group 740 or 750. When the PCIe interface is shared (fig. 7B), that is, the memory card access module 770 supports both PCIe devices (including PCIe memory cards) and non-PCIe memory cards (such as the memory card access module 230 in fig. 3 or the memory card access module 530 in fig. 5), only one capacitor group 780 is needed, that is, the number of capacitors needed can be reduced by half.
The shared PCIe interface of the present invention is not limited to the PCIe memory card, and any other PCIe devices that can be connected to the electronic apparatus through the slot of the electronic apparatus belong to the embodiments of the present invention.
Because the details and variations of the disclosed method and invention can be understood by those skilled in the art from the disclosure of the disclosed apparatus and invention, the repetitive description is omitted herein for the avoidance of redundant details without affecting the disclosed requirements and the feasibility of the method and invention. It should be noted that the shapes, sizes, proportions, and sequence of steps of the elements and steps shown in the drawings are illustrative only and not intended to limit the invention, which is understood by those skilled in the art.
Although the embodiments of the present invention have been described above, the embodiments are not intended to limit the present invention, and those skilled in the art can make variations on the technical features of the present invention according to the explicit or implicit contents of the present invention, and all such variations may fall into the embodiments of patent protection sought by the present invention, in other words, the scope of patent protection of the present invention should be determined by the claims of the present specification.