CN203858628U - USB (universal serial bus) and SD (secure digital) interface multiplexing circuit - Google Patents
USB (universal serial bus) and SD (secure digital) interface multiplexing circuit Download PDFInfo
- Publication number
- CN203858628U CN203858628U CN201420005605.5U CN201420005605U CN203858628U CN 203858628 U CN203858628 U CN 203858628U CN 201420005605 U CN201420005605 U CN 201420005605U CN 203858628 U CN203858628 U CN 203858628U
- Authority
- CN
- China
- Prior art keywords
- pin
- usb
- interface
- mcu
- flow process
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Lifetime
Links
- 238000001514 detection method Methods 0.000 claims description 14
- 238000003780 insertion Methods 0.000 claims description 4
- 230000037431 insertion Effects 0.000 claims description 4
- 230000006854 communication Effects 0.000 abstract description 33
- 238000004891 communication Methods 0.000 abstract description 31
- 238000000034 method Methods 0.000 description 51
- 230000008569 process Effects 0.000 description 49
- 230000004913 activation Effects 0.000 description 14
- 238000010586 diagram Methods 0.000 description 5
- 230000009471 action Effects 0.000 description 2
- 238000005538 encapsulation Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
Landscapes
- Information Transfer Systems (AREA)
Abstract
The utility model provides a USB (universal serial bus) and SD (secure digital) interface multiplexing circuit which can reduce the quantity of universal input-output pins and can realize the USB-SD communication switching function. The USB and SD interface multiplexing circuit comprises an MCU (microcontroller unit), a USB interface and an SD interface, wherein the MCU comprises four input-output (IO) interfaces, the USB interface and the SD interface are connected with an MCU main control chip by multiplexing the IO interfaces of the MCU, the MCU is used for multiplexing the functional combination of the IO interfaces in a time division manner through an embedded multiplexing control module, and the SD card communication function and the USB communication function are realized; while the application function of the MCU is enriched, the occupation of a USB and SD connection bus on the IO resource of the MCU main control chip can be reduced, and the production cost is reduced. The USB and SD interface multiplexing circuit can be applied to the communication switching field.
Description
Technical field
The utility model relates to a kind of multiplex circuit, relates in particular to a kind of USB and SD interface multiplexing circuit.
Background technology
In consumer electronics field, portable little audio amplifier, because volume is little, audio good, function is complete, the feature such as easy to use, is extensively subject to consumer's welcome.Portable little audio amplifier generally comprises analogue audio frequency input AUX, outside speaker, SD card interface, USB interface and button.In order to support these functions, the main control chip of portable little audio amplifier generally comprises 1 AUX input pin, 3 SD card interface pins, 2 USB interface pins, 1 DAC output pin, 1 button detection pin, 2 power pins, totally 10 pins.Common 16pin encapsulates this functional requirement, and redundancy seems.In order to save main control chip cost, when going to select 8pin encapsulation, cannot realize again the functional requirement of portable little audio amplifier completely.The annexation of the USB interface of current consumption electronic product and SD interface and MCU as shown in Figure 1.
Portable little audio amplifier in actual use, generally can not carry out USB simultaneously and communicate by letter with SD, just can select a communication.If the pin multiplexing of USB interface and SD interface can be got up, save 2 pins, realize portable little function of loudspeaker box with the master control of 8pin encapsulation so, will be a very valuable solution.
Utility model content
Technical problem to be solved in the utility model is to overcome the deficiencies in the prior art, provides a kind of and can reduce universal input output pin number and can realize USB communicate by letter with SD USB and the SD interface multiplexing circuit of handoff functionality.
The technical scheme that USB described in the utility model and SD interface multiplexing circuit adopt is: this circuit comprises MCU, USB interface and SD interface, described MCU comprises CPU, USB module, SD module, timer and level detection module, described USB interface comprises the first data pin USB_DM and the second data pin USB_DP, SD interface comprises command pin SD_CMD, clock pin SD_CLK, data pin SD_DAT and insertion detect pin SD_DET, described MCU also comprises the first pin IOA, the second pin IOB, the 3rd pin IOC and the 4th pin IOD, described clock pin SD_CLK is connected with described the first pin IOA, described data pin SD_DAT is connected with described the second pin IOB, described command pin SD_CMD is connected with described the 3rd pin IOC, described insertion detects pin SD_DET and is connected with the 4th pin IOD, described the first data pin USB_DM and described the second data pin USB_DP and described the first pin IOA, described the second pin IOB is connected with any two pins in described the 3rd pin IOC, in described MCU, also embed and have multiplexing control module, one end of described multiplexing control module respectively with described USB module, described SD module is connected with described level detection module, the other end respectively with described the first pin IOA, described the second pin IOB, described the 3rd pin IOC is connected with described the 4th pin IOD.
Further, described the first pin IOA, described the second pin IOB, described the 3rd pin IOC and described the 4th pin IOD are universal input output pin.
The beneficial effects of the utility model are: the utility model by configuring multiplexing control module control setting and universal input/output interface state in MCU, time-sharing multiplex the first pin IOA, the second pin IOB, the 3rd pin IOC and the 4th pin IOD, carry out usb communication or SD communication; SD equipment and USB device Plug Action and connection state, can not disturb the current USB device using or SD equipment.Compared with existing design, in not affecting MCU host applications function, reduce pin number demand, reduce the production cost of product.
Brief description of the drawings
Fig. 1 is existing USB/SD joint connecting structure schematic diagram;
Fig. 2 is syndeton schematic diagram of the present utility model;
Fig. 3 is the utility model USB/SD working state schematic representation;
Fig. 4 is that the utility model USB and SD interface detect switching flow figure;
Fig. 5 is the utility model SD communication flow diagram;
Fig. 6 is the utility model usb communication process flow diagram.
Embodiment
The utility model discloses a kind of USB and SD interface multiplexing circuit.In order to make the purpose of this utility model, technical scheme and advantage clearer, also describe by reference to the accompanying drawings the implementation procedure of the utility model specific embodiment below in detail as an example of portable little audio amplifier example.
As shown in Figure 2, in the application scheme of the portable little audio amplifier of the present embodiment, apply a kind of USB and SD interface multiplexing circuit, comprised MCU, USB interface and SD interface.Described MCU comprises CPU, SD module, USB module, timer, level detection module, universal input output pin: the first pin IOA, the second pin IOB, the 3rd pin IOC and the 4th pin IOD, multiplexing control module.USB interface comprises the first data pin USB_DM and the second data pin USB_DP; SD interface comprises command pin SD_CMD, clock pin SD_CLK, data pin SD_DAT and inserts and detect pin SD_DET.SD_CLK pin is connected with IOA pin, and SD_DAT pin is connected with IOB pin, and SD_CMD pin is connected with IOC pin, and SD_DET pin is connected with IOD pin; USB_DM pin is connected with IOA and two pins of IOB respectively with USB_DP pin.
Described multiplexing control module is for the state-detection result to USB interface and SD interface according to described level detection module, connection status to described USB interface and described SD interface and described MCU is switched, make MCU carry out USB or SD communication, wherein, described USB interface and described SD interface only have a state effective at one time., described multiplexing control module is for controlling the annexation of SD module, USB module, level detection module and universal input output pin IOA, IOB, IOC, IOD; SD module, by multiplexing control module, is connected with universal input output pin IOA, IOB, IOC; USB module, by multiplexing control module, is connected with universal input output pin IOA, IOB; Level detection module, by multiplexing control module, is connected with universal input output pin IOA, IOB, IOD.
The utility model, in implementation process, mainly comprises 6 USB interface states to USB and SD method for multiplexing interface, 6 SD Interface status and 3 workflows.
Interface status as shown in Figure 3.
6 USB interface states: USB off-line state, USB presence, USB suspended state, USB state of activation, USB idle condition and usb communication state.USB off-line state and same time of USB presence only have a state effective, and USB presence is the precondition of USB suspended state and USB state of activation.USB suspended state and same time of USB state of activation only have at most a state effective, and USB state of activation is the precondition of USB idle condition and usb communication state.USB idle condition and same time of usb communication state only have at most a state effective.
6 SD Interface status: SD off-line state, SD presence, SD suspended state, SD state of activation, SD idle condition and SD communications status.SD off-line state and same time of USB presence only have a state effective, and SD presence is the precondition of SD suspended state and SD state of activation.SD suspended state and same time of SD state of activation only have at most a state effective, and SD state of activation is the precondition of SD idle condition and SD communications status.SD idle condition and same time of SD communications status only have at most a state effective.
USB state of activation and same time of SD state of activation only have at most a state effective.
As shown in Figure 4, the utility model utilizes CPU, SD module, USB module, timer, level detection module, the hardware configurations such as universal input output pin IOA, IOB, IOC and IOD and multiplexing control module, coordinate software operation flow process, realize USB and SD interface and detect switching flow.
Illustrate specific implementation process of the present utility model and step below.
While supposing energising start, do not insert SD card and USB flash disk, after start, first insert SD card and play, then insert USB flash disk and play.
After start, USB interface and SD interface are all in off-line state.Software setting enables the every 50ms of timer and produces once interruption.CPU enters after Interruption subroutine, detects the connection of USB interface and SD interface by set flow process.According to the result detecting, the state of USB interface and SD interface is set.
Insert after SD card, timer produces Interruption, and CPU carries out following detection and setting steps (as the flow process in Fig. 4):
1) flow process a detects " whether USB is in communications status ".USB, not at communications status, enters flow process b;
2) flow process b detects " whether SD is in communications status ".SD card, not at communications status, enters flow process c;
3) flow process c detects " whether USB is in idle condition ".USB, not in idle condition, enters flow process d;
4) flow process d detects " whether SD is in idle condition ".SD, not in idle condition, enters flow process e;
5) flow process e detects " whether SD is in suspended state ".SD, not in suspended state, enters flow process o;
6) flow process o detects " whether SD is online ".Now inserted SD card, SD is stuck in line, enters flow process p;
7) flow process p the inside, CPU configures multiplexing control module, the connection of setting up SD module and IOA, IOB, IOC.It is state of activation that SD interface is set, and enters flow process s;
8) exit after interruption subroutine, according to the needs of sound box system, carry out SD communication.
, then insert USB flash disk after this.Timer produces Interruption, and CPU carries out following detection and setting steps:
1) flow process a detects " whether USB is in communications status ".USB, not at communications status, enters flow process b;
2) flow process b detects " whether SD is in communications status ".If SD card, in communications status, exits interruption subroutine, waiting timer interrupts again.If SD card is not in communications status, because SD interface is activated, inevitable in idle condition, enter flow process c;
3) flow process c detects " whether USB is in idle condition ".USB, not in idle condition, enters flow process d;
4) flow process d detects " whether SD is in idle condition ".SD interface, in idle condition, enters flow process k;
5) flow process k detects " whether USB is in suspended state ".USB, not in suspended state, enters flow process l;
6) flow process l the inside, detecting action for fear of USB affects SD module and SD card, and SD is set to suspended state.Detect again " whether USB is online ".Now USB flash disk has inserted online, enters flow process m;
7) flow process m USB is set to after state of activation, enters flow process s;
8) exit after interruption subroutine, according to the needs of sound box system, carry out usb communication.
For first inserting USB flash disk, then insert the situation of SD card, can be with reference to said process, realize online detection and state setting.
If SD interface is in state of activation, SD card also still connects online, and when system need to be carried out SD communication, with reference to accompanying drawing 5, CPU carries out following steps:
1) whether flow process A detects SD card online.Because SD is not pulled out, enter flow process B;
2) flow process B the inside, SD interface is set to communications status.Then enter flow process C, start SD communication;
3) after SD sign off, enter flow process D;
4) flow process D SD interface is set to after idle condition, enters flow process F, exits SD communication process.
If USB interface is in state of activation, but USB flash disk is pulled out.In the time that system attempts carrying out usb communication again, with reference to accompanying drawing 6, CPU carries out following steps:
1) whether flow process (1) detects USB online.Because USB flash disk has been pulled out off-line, enter flow process (5);
2) flow process (5) USB interface is set to after off-line state, enters flow process (6), exits usb communication flow process.
Above flow process is detecting step and the stateful switchover process of the partial status of the present embodiment, can realize with reference to the process flow diagram of figure 4, Fig. 5, Fig. 6 the switching that under various conditions, USB and SD play.
Above embodiment only, for explanation design of the present utility model and feature, can not limit protection domain of the present utility model with this, and all equivalences of doing according to the utility model essence change or modify, within should being included in the protection domain of the utility model patent.
The utility model switching field that can be applicable to communicate by letter.
Claims (2)
1. USB and a SD interface multiplexing circuit, comprise MCU, USB interface and SD interface, described MCU comprises CPU, USB module, SD module, timer and level detection module, described USB interface comprises the first data pin and the second data pin, SD interface comprises command pin, clock pin, data pin and insertion detect pin, it is characterized in that: described MCU also comprises the first pin, the second pin, the 3rd pin and the 4th pin, described clock pin is connected with described the first pin, described data pin is connected with described the second pin, described command pin is connected with described the 3rd pin, described insertion detects pin and is connected with the 4th pin, described the first data pin and described the second data pin and described the first pin, described the second pin is connected with any two pins in described the 3rd pin, in described MCU, also embed and have a multiplexing control module, one end of described multiplexing control module respectively with described USB module, described SD module is connected with described level detection module, the other end respectively with described the first pin, described the second pin, described the 3rd pin is connected with described the 4th pin.
2. USB according to claim 1 and SD interface multiplexing circuit, is characterized in that: described the first pin, described the second pin, described the 3rd pin and described the 4th pin are universal input output pin.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201420005605.5U CN203858628U (en) | 2014-01-06 | 2014-01-06 | USB (universal serial bus) and SD (secure digital) interface multiplexing circuit |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201420005605.5U CN203858628U (en) | 2014-01-06 | 2014-01-06 | USB (universal serial bus) and SD (secure digital) interface multiplexing circuit |
Publications (1)
Publication Number | Publication Date |
---|---|
CN203858628U true CN203858628U (en) | 2014-10-01 |
Family
ID=51608471
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201420005605.5U Expired - Lifetime CN203858628U (en) | 2014-01-06 | 2014-01-06 | USB (universal serial bus) and SD (secure digital) interface multiplexing circuit |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN203858628U (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104318280A (en) * | 2014-10-27 | 2015-01-28 | 康泰医学***(秦皇岛)股份有限公司 | Method for reading and writing SD card by upper computer via USB |
-
2014
- 2014-01-06 CN CN201420005605.5U patent/CN203858628U/en not_active Expired - Lifetime
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104318280A (en) * | 2014-10-27 | 2015-01-28 | 康泰医学***(秦皇岛)股份有限公司 | Method for reading and writing SD card by upper computer via USB |
CN104318280B (en) * | 2014-10-27 | 2017-07-14 | 康泰医学***(秦皇岛)股份有限公司 | The method that host computer high-speed read-write SD card is realized using USB interface |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103778092A (en) | USB and SD interface multiplex circuit and multiplex method | |
CN104657313B (en) | Detecting system and method for universal serial bus device | |
CN203930811U (en) | A kind of IO board of supporting NCSI | |
WO2007083179A3 (en) | A method for booting a host device from an mmc/sd device, a host device bootable from an mmc/sd device and an mmc/sd device method a host device may be booted from | |
WO2008117111A3 (en) | Flash memory control interface | |
CN105635885A (en) | USB interface multiplex circuit, mobile terminal and earphone | |
CN104731746A (en) | Equipment controller device | |
CN102073602A (en) | Computer system, connection control device as well as connecting and disconnecting method | |
CN103077139B (en) | Use integrated circuit and the control method thereof of internal integrate circuit bus | |
CN109117205A (en) | A kind of dual chip loading method based on MCU and FPGA | |
CN203858628U (en) | USB (universal serial bus) and SD (secure digital) interface multiplexing circuit | |
CN102445981B (en) | Data transmission system and data transmission method | |
CN105512085A (en) | Information processing method and electronic equipment | |
CN101763324A (en) | Method for realizing equipment simulating and device thereof | |
CN207408859U (en) | EMP3288 embedded computer core boards | |
CN206294300U (en) | A kind of set CARPLAY communications and the device of USB transmission | |
CN203133695U (en) | BMC (backboard management controller) card based on AST2300 control chip | |
CN102833513B (en) | High definition player | |
CN105718414A (en) | Addressable bus structure | |
CN103970706A (en) | External expansion system of mobile device based on FT311D interface chip | |
CN112087359B (en) | Serial communication system | |
CN209562574U (en) | A kind of NTB card | |
CN106815173B (en) | Data sending and receiving method, device and system | |
CN204178365U (en) | Transformational structure between LBE bus and isa bus | |
CN204480237U (en) | A kind of connector, universal serial bus device and intelligent terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20220317 Address after: Rooms 1306-1309, 13 / F, 19 science Avenue West, Hong Kong Science Park, Shatin, New Territories, China Patentee after: BUILDWIN INTERNATIONAL (ZHUHAI) LTD. Address before: 519015 Guangdong city of Zhuhai province Jida Bailian Road No. 184 building 7 floor three-dimensional technology Patentee before: BUILDWIN INTERNATIONAL (ZHUHAI) Ltd. |
|
TR01 | Transfer of patent right | ||
CX01 | Expiry of patent term |
Granted publication date: 20141001 |
|
CX01 | Expiry of patent term |