# Patent

## Title
Techniques for configuring contacts of a connector

## Abstract

Systems and methods for configuring contacts of a first connector includes detecting mating of a second connector with the first connector and in response to the detection, sending a command over one of the contacts and waiting for a response to the command. If a valid response to the command is received, the system determines the orientation of the second connector. The response also includes configuration information for contacts in the second connector. The system then configures some of the other contacts of the first connector based on the determined orientation and configuration information of the contacts of the second connector.

## Background
CROSS-REFERENCES TO RELATED APPLICATIONS
This application claims benefit under 35 USC §119(e) to (a) U.S. Provisional Patent Application No. 61/556,792, filed on Nov. 7, 2011 and (b) U.S. Provisional Patent Application No. 61/565,463, filed on Nov. 30, 2011, the disclosures of which are incorporated by reference in their entirety for all purposes.
This application is related to U.S. patent application Ser. No. 13/607,426, filed on Sep. 7, 2012, the contents of which are incorporated by reference herein in its entirety for all purposes.


BACKGROUND
Connectors are ubiquitous and are used in variety of applications for coupling two electronic devices. Most connectors usually have some sort of contacts that facilitate transmission of signals between the devices connected using a connector. Conventionally, each contact in a connector has a specific pre-assigned function. In other words, each contact in a connector is designated to carry a certain type of signal, e.g., power, data, etc.
Many electrical connectors can only be connected in a single orientation. These connectors have contacts that have pre-assigned functions which cannot be modified. Usually, these electrical connectors have a physical design that allows for connection only in a single orientation. In other words, two mating single orientation connectors can only be mated one way. Thus, one has to be careful when using a single orientation connector since plugging the connector in an incorrect manner can damage the connector and/or damage the device into which the connector is plugged in either physically, electrically, or both.
SUMMARY 
The present invention generally relates to connectors for connecting two devices. Specifically, certain embodiments of the present invention relate to reversible connectors with configurable contacts. As described above, conventional connectors have contacts that have pre-assigned function. For example, in a standard USB connector, each of the four contacts has a specific function associated with it, e.g., power, data, etc. The location of these pre-assigned contacts within the connector is also fixed. In sum, the contacts in such conventional connectors are not configurable and can perform only the pre-assigned function based on the type and use of the connector.
Embodiments of the present invention provide techniques for dynamically configuring contacts of a host-side connector that is associated with a host system. In one embodiment of the present invention, a contact in the host-side connector is capable of being assigned one of several functions. The function to be assigned to the contact (and other contacts in the connector) may depend on the accessory coupled to the host system and the signals provided/used by the accessory. For example, when an audio only accessory is coupled to the host system, at least one of the contacts on the host-side connector can be configured to carry audio data.
In some embodiments, a host-side connector and an accessory-side connector can mate with each other in more than one orientation. In the instance where the host-side connector and the accessory-side connector can mate with each other in more than one orientation, it may be beneficial to first determine the orientation of the accessory-side connector with respect to the host-side connector before configuring the contacts of the host-side connector.
Certain embodiments of the present invention provide techniques for determining orientation of an accessory-side connector with respect to a corresponding host-side connector. According to one embodiment, once the accessory-side connector is physically mated with the host-side connector, the host system sends a command to the accessory alternately over each of two selected contacts in the host-side connector and awaits a reply from the accessory. Depending over which of the two selected contacts the reply is received on, the host system can determine the orientation of the accessory-side connector with respect to the host-side connector.
In other embodiments, the contacts in the host-side connector are configured based on the determined orientation of the accessory-side connector. In an embodiment, the reply from the accessory may include information about the function assigned to each contact of the accessory-side connector. Using this information and the knowing the orientation of the accessory-side connector, the host system can then configure the contacts of the host-side connector in order to communicate with the accessory.
In some embodiments, the detection of orientation and configuration of contacts can be independent of each other. In other embodiments, the detection of orientation may precede and may be used to configure the contacts of the host-side connector. In some embodiments, the contacts of the host-side connector can be in a floating mode prior to mating with the accessory-side connector.
The following detailed description, together with the accompanying drawings will provide a better understanding of the nature and advantages of the present invention.



BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1A illustrates a plug connector according to an embodiment of the present invention.
FIG. 1B is a front view of the plug connector according to an embodiment of the present invention.
FIG. 1C is cross-sectional view of the plug connector according to an embodiment of the present invention.
FIG. 1D is a pin-out of a plug connector according to an embodiment of the present invention.
FIG. 1E is a pin-out of a plug connector according to another embodiment of the present invention.
FIG. 2A illustrates a receptacle connector according to an embodiment of the present invention.
FIG. 2B cross-sectional view of the receptacle connector according to an embodiment of the present invention.
FIG. 2C illustrates a receptacle connector according to another embodiment of the present invention.
FIG. 2D is a cross-sectional view of a receptacle connector having eight signal contacts and two connection detection contacts according to an embodiment of the present invention.
FIGS. 2E and 2F are diagrams illustrating a pinout arrangement of a receptacle connector according to two different embodiments of the invention configured to mate with plug connectors 100 and 101, respectively, as shown in FIGS. 1D and 1E.
FIG. 3A is a schematic illustrating the plug connector being coupled to the receptacle connector in a first orientation according to an embodiment of the present invention.
FIG. 3B is a schematic illustrating the plug connector being coupled to the receptacle connector in a second orientation according to an embodiment of the present invention.
FIG. 4 is a schematic illustrating a system for determining orientation of one connector with respect to another connector according to an embodiment of the present invention.
FIG. 5 is a flow diagram of a process for determining orientation of one connector with respect to other according to an embodiment of the present invention.
FIG. 6 is a flow diagram of a process for configuring contacts of a connector according to an embodiment of the present invention.
FIG. 7A illustrates a command structure according to an embodiment of the present invention.
FIG. 7B illustrates a response structure for the command according to an embodiment of the present invention.
FIG. 7C illustrates a detailed structure for a portion of a command sequence for requesting pin configuration and accessory capability information according to an embodiment of the present invention. FIG. 7D illustrates a detailed structure of a response sequence for responding to a request for pin configuration and accessory capability information according to an embodiment of the present invention.
FIG. 8A is a simplified cross-sectional view of a plug connector mated with a receptacle connector in a first orientation according to an embodiment of the present invention.
FIG. 8B is a simplified cross-sectional view of a plug connector mated with a receptacle connector in a second orientation according to an embodiment of the present invention.
FIGS. 9A and 9B is a flow diagram of a process for determining orientation and configuring contacts of a connector based on the orientation according to another embodiment of the present invention.



DETAILED DESCRIPTION
Embodiments of the present invention generally relate to connectors. More specifically, certain embodiments of the present invention provide techniques for determining orientation of one connector with respect to another connector. In some embodiments, an accessory-side or “plug” connector may be insertable into a host-side or “receptacle” connector in more than one orientation. In this instance, the techniques described herein may provide a method to determine the exact orientation of the plug connector with respect to the receptacle connector.
Some embodiments of the present invention provide techniques for dynamically configuring contacts of a host-side connector based on information received from a connected accessory.
Certain embodiments of the present invention provide systems and methods for determining orientation of an accessory-side connector with respect to a host-side connector and configuring the host-side connector based on the determined orientation and information received from the accessory.
FIG. 1A illustrates a plug connector 100 (or accessory-side connector 100) according to an embodiment of the present invention. Plug connector 100 is exemplary and is used herein to explain the various embodiments of the present invention. One skilled in the art will realize that many other forms and types of connectors other than plug connector 100 can be used and that techniques described herein will apply to any plug connector that has the characteristics of plug connector 100. In some embodiments, plug connector 100 may be associated with an accessory that can be coupled to a host device.
Plug connector 100 includes a body 102 and a tab portion 104. A cable 106 is attached to body 102 and tab portion 104 and extends longitudinally away from body 102 in a direction parallel to the length of the connector 100. Tab 104 is sized to be inserted into a corresponding receptacle connector during a mating event and includes a first contact region 108a formed on a first major surface 104a and a second contact region 108b (not shown in FIG. 1A) formed at a second major surface 104b (also not shown in FIG. 1A) opposite surface 104a. Surfaces 104a, 104b extend from a distal tip of the tab to a spine 109 that, when tab 104 is inserted into a corresponding receptacle connector, abuts a housing of the receptacle connector or portable electronic device the receptacle connector is incorporated in. Tab 104 also includes first and second opposing side surfaces 104c, 104d (not shown) that extend between the first and second major surfaces 104a, 104b. In one particular embodiment, tab 104 is about 6.6 mm wide, about 1.5 mm thick and has an insertion depth (the distance from the tip of tab 104 to spine 109) of about 7.9 mm.
A plurality of contacts 112 can be formed in each of contact regions 108a and 108b such that, when tab 104 is inserted into a corresponding receptacle connector, contacts 112 in regions 108a or 108b are electrically coupled to corresponding contacts in the receptacle connector. In some embodiments, contacts 112 are self-cleaning wiping contacts that, after initially coming into contact with a receptacle connector contact during a mating event, slide further past the receptacle connector contact with a wiping motion before reaching a final, desired contact position.
As an example, in one embodiment an ID module is embodied within an IC operatively coupled to the contacts of connector 100. The ID module can be programmed with identification and configuration information about the connector and/or its associated accessory/adapter that can be communicated to a host device during a mating event. As another example, an authentication module programmed to perform an authentication routine, for example a public key encryption routine, with circuitry on the host device can be embodied within an IC operatively coupled to connector 100. The ID module and authentication module can be embodied within the same IC or within different ICs. As still another example, a current regulator can be embodied within one of IC's 113a or 113b. The current regulator can be operatively coupled to contacts that are able to deliver power to charge a battery in the portable electronic device and regulate current delivered over those contacts to ensure a constant current regardless of input voltage and even when the input voltage varies in a transitory manner. The function of the IC's is further described below in reference to FIG. 4.
Bonding pads 115 can also be formed within body 102 near the end of PCB 107. Each bonding pad can be connected to a contact or contact pair within regions 108a and 108b. Wires (not shown) can then be soldered to the bonding pads to provide an electrical connection from the contacts to circuitry within an accessory associated with connector 100. In some embodiments, however, bonding pads are not necessary and instead all electrical connections between the contacts and components of connector 100 and other circuitry within an accessory are made through traces on a PCB that the circuitry is coupled to and/or by interconnects between multiple PCBs within the accessory.
The structure and shape of tab 104 is defined by a ground ring 105 that can be made from stainless steel or another hard conductive material. Connector 100 includes retention features 114a, 114b (not shown) formed as curved pockets in the sides of ground ring 105 that double as ground contacts. Body 102 is shown in FIG. 1A in transparent form (via dotted lines) so that certain components inside the body are visible. As shown, within body 102 is a printed circuit board (PCB) 107 that extends into ground ring 105 between contact regions 108a and 108b towards the distal tip of connector 100. One or more integrated circuits (ICs), such as Application Specific Integrated Circuit (ASIC) chips 113a and 113b, can be operatively coupled to PCB 107 to provide information regarding connector 100 and/or to perform specific functions, such as authentication, identification, contact configuration and current or power regulation.
FIG. 1B illustrates a front view of plug connector 100. The front view illustrates a cap 120. Cap 120 can be made from a metal or other conductive material and can extend from the distal tip of connector 100 along the side of the connector towards body 102 either fully or partially surrounding contacts 112 formed in contact regions 108a and 108b in the X and Y directions. In some embodiments, cap 120 can be grounded in order to minimize interference that may otherwise occur on contacts 112 of connector 100 and can thus be referred to as a ground ring, e.g., ground ring 105 illustrated in FIG. 1A. Contacts 112(1)-112(N) can be positioned within contact region 108a and additional contacts 114(1)-114(N) can be positioned within region 108b on the opposing surface of tab 104. In some embodiments, N can be between 2 and 8. Contacts 112(1) . . . 112(N) and 114(1) . . . 114(N) can be used to carry a wide variety of signals including digital signals and analog signals as well as power and ground.
FIG. 1C illustrates a cross-sectional schematic view of contacts 112, 114 and positioning of the contacts. Contacts 112, 114 can be mounted on either side of a PCB 150 as illustrated. In some embodiments, opposing contacts, e.g., 112(1) and 114(1) may be shorted or electrically connected to each other through PCB 150, e.g., using a via, to create an in-line connector design. In other embodiments, all contacts may be independent with no connections between any of the contacts or the contacts may have other connections schemes between them. In the instance where each contacts is independent and not connected to any other contact, a different receptacle connector, e.g., connector 250 of FIG. 2C, may be used. Contacts 112, 114 can be made from a copper, nickel, brass, a metal alloy or any other appropriate conductive material. Spacing is consistent between each of the contacts on the front and back sides and between the contacts and the edges of the connector providing 180 degree symmetry so that plug connector 100 can be inserted into a corresponding receptacle connector in either of two orientations.
When connector 100 is properly engaged with a receptacle connector, each of contacts 112(1)-112(N) or 114(1)-114(N) is in electrical connection with a corresponding contact of the receptacle connector.
FIG. 1D illustrates a pin-out configuration for connector 100 according one particular embodiment of the present invention as described in connection with FIG. 1C above.
The pin-out shown in FIG. 1D includes four contacts 112(4), 112(5), 114(4), and 114(5) that are electrically coupled together to function as a single contact dedicated to carrying power to a connected host device. Connector 100 may also include accessory ID contacts 112(8) and 114(8); accessory power contacts 112(1) and 114(1); and eight data contacts arranged in four pairs. The four pairs of data contacts may be (a) 112(2) and 112(3), (b) 112(6) and 112(7), (c) 114(2) and 114(3), and (d) 114(6) and 114(7). Host power contacts 112(4), 112(5), 114(4), and 114(5) carry power from an accessory associated with connector 100 to a portable electronic device that is coupled to the accessory via connector 100. The host power contacts can be sized to handle any reasonable power requirement for an electronic device or host device, and for example, can be designed to carry between 3-20 Volts from an accessory to charge the portable electronic device connected to connector 100. In this embodiment, host power contacts 112(4), 112(5), 114(4), and 114(5) are positioned in the center of contact regions 108a, 108b to improve signal integrity by keeping power as far away as possible from the sides of ground ring 105.
Accessory power contacts 112(1) and 114(1) can be used for an accessory power signal that provides power from the electronic device (i.e. the host device) to an accessory. The accessory power signal is typically a lower voltage signal than the host power in signal received over host power contacts 112(4) and 112(5), for example, 3.3 volts as compared to 5 volts or higher. The accessory ID contacts provide a communication channel that enables the host device to authenticate the accessory and enable the accessory to communicate information to the host device about the accessory's capabilities as described in more detail below.
The four pairs of data contacts (a) 112(2) and 112(3), (b) 112(6) and 112(7), (c) 114(2) and 114(3), and (d) 114(6) and 114(7) may be used to enable communication between the host and accessory using one or more of several different communication protocols. For example, data contacts 112(2) and 112(3) are positioned adjacent to and on one side of the power contacts, while data contacts 112(6) and 112(7) are positioned adjacent to but on the other side of the power contacts. A similar arrangement of contacts can be seen for contacts 114 on the other surface of the PCB. The accessory power and accessory ID contacts are positioned at each end of the connector. The data contacts can be high speed data contacts that operate at rate that is two or three orders of magnitude faster than any signals sent over the accessory ID contact which makes the accessory ID signal look essentially like a DC signal to the high speed data lines. Thus, positioning the data contacts between the power contacts and the ID contact improves signal integrity by sandwiching the data contacts between contacts designated for DC signals or essentially DC signals.
FIG. 1E illustrates a pin-out configuration for a connector 101 according another particular embodiment of the present invention.
Connector 101 is a also a reversible connector just like connector 100. In other words, based on the orientation in which connector 101 is mated with a corresponding connector of a host device, either the contacts on the surface 108a or 108b are in physical and electrical contact with the contacts in the corresponding connector of the host device. As illustrated in FIG. 1E, connector 101 may have eight contacts arranged on an upper surface of a PCB 150 and eight contacts arranged on a lower surface of PCB 150.
Connector 101 includes two contacts 112(1) and 114(4) that can function as accessory ID contacts to carry the identification signals between the accessory and the portable electronic device. Contacts 112(1) and 114(4) are electrically connected to each other as illustrated in FIG. 1E. Connector 101 can have four pairs of data contacts, (a) 112(2) and 112(3), (b) 112(6) and 112(7), (c) 114(2) and 114(3), and (d) 114(6) and 114(7). In this particular embodiment, opposing data contacts, e.g., 112(2) and 114(2), are electrically connected to each other via PCB 150 as illustrated in FIG. 1E. Connector 101 may further include host power contacts 112(4) or 114(5) that may be electrically connected to each other. Host power contacts 112(4) or 114(5) can carry power to the host device that is mated with connector 101. For example, plug connector 101 may be part of a power supply system designed to provide power to the host device. In this instance, either contact 112(4) or 114(5) may carry power from the power supply to the host device, e.g., to charge a battery in the host device.
Connector 101 may further include accessory power contacts 112(5) and 114(8) that may be electrically connected to each other, e.g., via PCB 150. Accessory power contacts carry power from the host device to a connected accessory. For example, in some instances, an accessory connected to the host device may not be self-powered and may derive its power from the host device. In this instance, the host device can supply power to the accessory over either of the accessory contacts, depending on the orientation of connector 101 with respect to a corresponding connector of the host device. Connector 101 may further include two ground contacts 112(8) and 114(1) electrically connected to each other. The ground contacts provide a ground path for connector 101.
FIG. 2A illustrates a receptacle connector 200 according to an embodiment of the present invention. Receptacle connector 200 includes a housing 202 that defines a cavity 204 and houses N contacts 206(1)-206(N) within the cavity. In operation, a connector plug, such as plug connector 100 (or connector 101) can be inserted into cavity 204 to electrically couple the contacts 112(1)-112(N) or 114(1)-114(N) to respective contacts 206(1)-206(N). Each of the receptacle connector contacts 206(1)-206(N) electrically connects its respective plug contact to circuitry associated with the electrical/host device in which receptacle connector 200 is housed. For example, receptacle connector 200 can be part of a portable media device and electronic circuitry associated with the media device is electrically connected to receptacle 200 by soldering tips of contacts 206(1)-206(N) that extend outside housing 202 to a multilayer board such as a printed circuit board (PCB) within the portable media device. Note that connector 200 includes contacts on just a single side so it can be made thinner. In other embodiments, connector 200 may have contacts on each side.
FIG. 2B illustrates a cross section view of receptacle connector 200 according to an embodiment of the present invention. As illustrated, in some embodiments, Additional contacts 208(1) and 208(2) are located at either ends of contacts 206(1)-206(N). Contacts 208(1) and 208(2) may be used to detect whether the plug connector is fully inserted into cavity 204 or inserted to a point where contacts 112 (or 114) of plug connector 100 (or connector 101) are physically coupled to contacts 206 of receptacle connector 200. In some embodiments, contacts 208(1) and 208(2) can also be used to detect whether the plug connector has been disconnected from the receptacle connector. In some embodiments, contacts 208 can make contact with cap 120 of plug connector 100 when the plug connector is inserted beyond a certain distance within cavity 204. In some embodiments, contacts 208 are placed such that they will make contact with the ground ring of plug connector only when contacts 112 make a solid physical connection with contacts 206. In some embodiments, when contacts 208 connect to the ground ring of the plug connector, a signal may be generated indicating the connection.
In some embodiments, the receptacle connector may have contacts both on the top side and the bottom side of cavity 204. FIG. 2C illustrates a cross-sectional view of a receptacle connector 251 that includes contacts 207(1)-207(N) on the top and contacts 206(1)-206(N) on the bottom. In some embodiments, a plug connector with electrically isolated contacts on the top and the bottom side may use the receptacle connector 251 of FIG. 2C.
In some embodiments, the receptacle connector may have contacts 206(1)-(N) only on a single side inside cavity 204 as described above. In a particular embodiment, receptacle connector 250 may have eight (8) contacts 206(1)-206(8) as illustrated in FIG. 2D. Some or all of these contacts may be configured to perform one of several functions depending on the signals available on a plug connector. Plug connector 100 (or connector 101) may be associated any one of several accessories that may be designed to work with a host device that is associated with receptacle connector 250. For example, plug connector 100 (or connector 101) may be associated with an audio only accessory in which case the signals available on the contacts, e.g., 106(1)-106(N), of the plug connector may include audio and related signals. In other instances, where plug connector 100 (or connector 101) is associated with a more complex accessory such as video accessory, the contacts of plug connector may carry audio, video, and related signals. Thus, in order to enable receptacle connector 250 to be operable with various different types of signal, contacts 206(1)-(8) of receptacle connector 250 can be made configurable based on the signals available from a plug connector 100 (or connector 101).
In the particular embodiment illustrated in FIG. 2D, receptacle connector 250 has eight contacts 206(1)-(8) in addition to two connection detection contacts 208(1) and 208(2). The operation of the connection detection contacts 208(1) and 208(2) is described above in relation to FIG. 2B. Some or all of contacts 206(1)-(8) may have an associated switch that can configure the contact to carry one of many possible signals, e.g., as illustrated in FIG. 4. However, for ease of explanation only one switch 220 coupled to contact 206(8) is illustrated in FIG. 2D. It is to be noted that some other contacts from among contacts 206(1)-206(8) may each have a similar switch 220 coupled to it. As illustrated in FIG. 2D, switch 220 can be used to configure contact 206(8) to carry any one of signals S1-Sn depending on the configuration of the plug connector.
In a particular embodiment, contact 206(1) may be an identification bus pin (ACC_ID) and can be configured to communicate a command operable to cause an accessory to perform a function and provide a response to a host device unique to the command. The command may be any one or more of a variety of commands, including a request to identify a connector pin and select one of a plurality of communication protocols for communicating over the identified connector pin, a request to set a state of the accessory, and a request to get a state of the accessory. Contact 206(1) may also or alternatively be configured to communicate power from the host device to the accessory (e.g., Acc_Pwr). For example, contact 206(1) may be coupled to a positive (or negative) voltage source within the host device so as to generate a voltage differential with another contact (such as a ground contact which may be, e.g., contact 206(8)).
In a particular embodiment, contacts 206(2) and 206(3) may form a first pair of data contact (DP1/DN1). The data contacts may be configured to carry one or more of a variety of signals, such as (a) USB differential data signals, (b) non-USB differential data signal, (c) UART transmit signal, (d) UART receive signal, (e) digital debug input/output signals, (f) a debug clock signal, (g) audio signals, (h) video signals, etc.
In a particular embodiment, contact 206(4) may carry incoming power (e.g., a positive voltage relative to another contact such as a ground pin) to the host device (e.g., from a power source in or coupled to the accessory) with which receptacle connector 200 is associated. Contact 206(5) may also function as an identification bus pin (ACC_ID) similar to contact 206(1) described above. Contact 206(5) may also or alternatively be configured to communicate power from the host device to the accessory (e.g., Acc_Pwr), depending on the orientation of a connected plug connector 100 (or connector 101) with respect to receptacle connector 200.
In a particular embodiment, contacts 206(6) and 206(7) may form a second pair of data pins (DP2/DN2) and can each be configured to carry one or more of a variety of signals, such as (a) USB differential data signals, (b) non-USB differential data signal, (c) UART transmit signal, (d) UART receive signal, (e) digital debug input/output signals, (f) a debug clock signal, (g) audio signals, (h) video signals, etc.
In a particular embodiment, contact 206(8) may be a ground pin or otherwise provided at a voltage potential lower than contacts 206(1), 206(4), and 206(5) so as to provide a voltage potential for power being provided to or from the host device.
In some embodiments, tab 104 has a 180 degree symmetrical, double orientation design which enables plug connector 100 (or connector 101) to be inserted into receptacle 200 in both a first orientation and a second orientation. FIGS. 3A and 3B are schematic views illustrating the different orientations that connector 100 (or connector 101) can be mated with connector 200. As illustrated in FIG. 3A, connector 100 (or connector 101) can be mated with connector 200 where contacts 112 of connector 100 (or connector 101) can couple with contacts 206 of connector 200. We can refer to this as the first orientation for purposes of explanation. Details of several particular embodiments of connector 100 (and connector 101) are described in a commonly-owned U.S. patent application Ser. No. 13/607,366, filed on Sep. 7,2012, the contents of which are incorporated by reference herein in their entirety for all purposes.
FIGS. 2E and 2F illustrate pin-out configuration for a receptacle connector according to two different embodiments of the present invention. In one embodiment, receptacle connector 200 has a pin-out as shown in FIG. 2E that matches pin-out of connector 100 in FIG. 1D and in another embodiment receptacle connector 200 has a pin-out as shown in FIG. 2F that matches pin-out of connector 101 of FIG. 1E. In each of FIGS. 2E and 2F, the ACC1 and ACC2 pins are configured to mate with either the accessory power (ACC_PWR) or accessory ID (ACC_ID) pins of the plug connector depending on the insertion orientation of plug connector, the pair of Data A contacts is configured to mate with either the pair of Data 1 contacts or the pair of Data 2 contacts of the plug connector, and the P_IN (power in) pin or pins are configured to mate with the Host Power contact or contacts of the plug connector. Additionally, in the pin-out of FIG. 2F, the GND contact is configured to mate with the GND contact in the plug connector.
In some embodiments, connector 100 (or connector 101) can be mated with connector 200 in a second orientation as illustrated in FIG. 3B. In the second orientation, contacts 114 of connector 100 (or connector 101) are coupled with contacts 206 of connector 200. As illustrated in FIGS. 3A and 3B, the second orientation may be 180 degrees rotated from the first orientation. However, these are not the only possible orientations. For example, if connector 100 (or connector 101) is a square connector with a corresponding square connector 200, then connector 100 (or connector 101) can be mated with connector 200 in one of four possible orientations. Thus, one skilled in the art will realize that more than two orientations for the connectors may be possible.
FIG. 4 is a block diagram of a system 400 according to an embodiment of the present invention. System 400 includes an electronic device/host device 402. Host device 402 can be a PC, a PDA, a mobile computing device, a media player, a portable communication device, a laptop computer, a tablet computer, or the like. Host device 402 may include a microcontroller 412 and a connector 404 that is coupled to microcontroller 412. Device 402 also includes various communication circuitry 430 such as UART, USB, JTAG, audio/video, and/or other communication circuitry. Communication circuitry 430 may be implemented in the same or in different micro-controllers, computer processors, or the like. Device 402 may also include a computer processor 440 that has access to a tangible not-transitory storage medium (not shown) that stores instructions thereon that, when executed by the processor 440, cause the processor to perform various functions. The instructions may be programmed by a user to, e.g., control the behavior of the switches in microcontroller 412. Connector 404 can be implemented, e.g., as connector 200 of Fig. 2A. It is to be noted that hose device 402 may include other components in addition to microcontroller 412. However the additional components are omitted here for the sake for the clarity as they do not directly pertain to the embodiments described herein.
Microcontroller 412 can be implemented using one or more integrated circuits, one or more single-core or dual-core processors, or the like. In some embodiments, microcontroller 412 can include orientation detection circuitry 420 for detecting orientation of a accessory-side connector coupled to connector 404.
Connector 404 can be implemented, e.g., as connector 200 of FIG. 2A. Connector 404 may have multiple contacts 206(1)-206(N). Some of the contacts of connector 404 may be capable of being assigned one of several functions based on several factors including but not limited to the orientation in which connector 406 is mated with connector 404. In other words, contacts of connector 404 can be multiplexed to perform several different functions. Each of the contacts in connector 404 is electrically coupled to some circuitry disposed in device 402. As illustrated in FIG. 4, several of the contacts of connector 404 are coupled to switches 1-N. In some embodiments, depending on the detected orientation, switches 1-N may configure these contacts to perform one of several functions. For example, the functions may include differential data signals, USB power and/or data, UART transmit and/or receive, test ports, debug ports, operational power, etc. Each switch may be used to configure its associated contact to carry one of many available signals. In one embodiment, each switch may be coupled to different types of communication circuitry. for example, switch 1 may be coupled to UART, USB, and JTAG circuitry, while switch 2 may be coupled to USB, audio, and other communication circuitry. Each switch may also or alternatively be coupled to poer circuitry. For example, switch 1 may be coupled to aq power source in electronic device 402. The switches can then switch between the dirrerent circuitry such that the pin coupled to the switch is connected to the selected circuitry. The configuration of the plug connector 406 discussed below.
System 400 also includes connector 406, which can be a corresponding connector that mates with connector 404. For example, if connector 404 is a receptacle connector, the connector 406 may be a corresponding plug connector. In some embodiments, connector 406 may be implemented, e.g., as connector 100 (or connector 101) described above. Connector 406 may be associated with an accessory that is designed to be used with device 402. Connector 406 may also has several contacts. When connector 406 is physically mated with connector 404, at least one set contacts of connector 406 are physically and electrically connected to the contacts in connector 404. This results in the electrical coupling of the contacts in connector 406 with device 402 via connector 404. As discussed above, since connector 406 is reversible, either the contacts 112(1) to 112(N) are in electrical connection with contacts 206(1)-206(N) of connector 404 or contacts 114(1) to 114(N) are in electrical connection with contacts 206(1)-206(N) of connector 404. However device 402 may not know which set of contacts of connector 406 are coupled to contacts in connector 404. For a given accessory, each contact of associated connector 406 may have a predefined function associated with it. As described above, the type of signals carried by connector 406 may depend on the type of accessory that it is associated with. For example, if connector 406 is associated with a charge/sync cable, the contacts of connector 406 may carry at least a power signal and a communication signal, among others. Thus, at the time connector 406 is mated with connector 404, the information carried by each contact in connector 406 may be pre-defined. This information may be transmitted to host device 402 so that host device 402 can configure contacts 206(1)-206(N) of connector 404 appropriately. Accordingly, before a mating event between connectors 404 and 406, contacts of connector 404 are placed in a “floating” mode. In other words contacts of connector 404 are isolated from other circuitry within host device 402.
Thus, before contacts 206(1)-206(N) of connector 404 can be configured; it may be beneficial to understand the orientation of connector 406 with respect to connector 404. In other words, it would be beneficial to understand which of the two sets of contacts, e.g., 112(1) to 112(N) or 114(1) to 114(N), of connector 406 are currently coupled to contacts 206(1)-206(N) of connector 404. In order to determine this, a process referred to herein as orientation detection may be performed.
However, before the orientation detection process can begin, device 402 may ensure that connector 406 is mated securely with connector 404, i.e. at least some contacts in both connectors are in physical contact with each other. This is done to ensure that the two connectors are properly mated and that there is reduced risk of arcing or shorting due to a potentially floating, partially connected, or unconnected power contact. In order to determine physical mating between connectors 404 and 406, a process referred to herein as connection detection may be performed.
Before the host device can initiate communication with an accessory, it may be beneficial to determine whether the plug and the receptacle connectors are physically connected or “mated” with each other. As described above, a receptacle connector, e.g., connector 404, has a connection detection contact, e.g., contact 208(1) illustrated in FIG. 2B, which is recessed from the other contacts in the receptacle connector. This connection detection contact, labeled as “Con Detect” in FIG. 4, is a last make/first break type of contact. In other words, as plug connector 406 is mated with receptacle connector 404, the connection detection contact is the last contact in connector 404 to make physical contact with any portion of connector 406. During an un-mating sequence, this connection detection contact is the first contact in connector 404 to physically disengage from connector 406. In some embodiments, the connection detection contact is coupled to microcontroller 412 via a signal line 414. When connector 406 is not mated with connector 404, signal line 414 is held in a logic “high” state by microcontroller 412. Thus, as long as signal line 414 is in a logic “high” state, the host device may conclude that no connector has been mated with connector 404.
When connector 406 is mated with connector 404, a certain distance after travelling within the cavity of connector 406, a ground ring, e.g., cap 120 of FIG. 1, of connector 406 makes physical contact with the connection detection connector. This causes signal line 414 to transition from the logic “high” state to a logic “low” state. Microcontroller 412 can detect this change in state of signal line 414 and determine that connector 406 is now physically connected with connector 404. In some embodiments, based on the physical design of the two connectors, when signal line 414 goes into the logic “low” state, it can be concluded that other contacts in the plug connector are also in physical connection with corresponding contacts in the receptacle connector. In some embodiments, the detection of this mating triggers further processes such as orientation detection, accessory authentication, contact configuration, etc. as described below.
In some embodiments, the connection detection contact can also be used for disconnection detection. In some embodiments, in order to protect device 402 from unauthorized accessories that may cause harm, all the switches within device 402, e.g., Switches 1-N and the OD1 and OD2 switches, are held in an open state prior to detection of a connection event. Similarly it would be desirable that once connector 406 is disconnected, these switches are returned to their “open” state so that no harmful signals can be communicated to device 402.
When connector 406 is un-mated or disconnected from connector 404, the connection detection contact is the first contact that loses physical connection with connector 406 (recall this is a last make/first break type contact). Once the connection detection contact becomes physically disengaged from connector 406, signal line 414 returns to its logic “high” state. Microcontroller 412 can detect this change in state and conclude that connector 406 has been disengaged from connector 404. Based on this determination, microcontroller may operate one or more of the switches to place them in an “open” state thus protecting the internal circuitry of device 402 from potential arcing and shorting hazard if any of the corresponding contacts of the plug connector have power on them.
At a later time if connector 406 is once again mated to connector 404, device 402 may again perform the connection detection process described above.
As described above, in some embodiments, the accessory-side connector, e.g., connector 406, can be mated with the host-side connector, e.g., connector 404 in more than one orientation. In such an instance, it may be desirable to determine the orientation of the accessory-side connector with respect to the host-side connector in order to properly route signals between the host device and the accessory.
In some embodiments, one or more of the contacts in connector 404 may be used for determining orientation. As described earlier, all switches inside microcontroller 412 that control the respective contacts of connector 404 are initially in an “open” state. In the embodiment of FIG. 4, two contacts, illustrated as OD1 and OD2, can be used to determine orientation. In order to describe the orientation detection and contact configuration processes, consider for example that contacts 206(1) (designated as “OD2” in FIG. 4) and 206(8) (designated as “OD1” in FIG. 4) can be chosen from among contacts 206(1)-206(N) of connector 404. Each of these contacts OD1 and OD2 are connected to corresponding switches 416 and 418, respectively. It is to be understood that any other contacts from connector 404 may also be chosen and contacts 206(1) and 206(1) are merely being used herein to explain the techniques. Similar to the contacts 206(1)-206(N), contacts OD1 and OD2 can also be configured to perform one of several functions. In some embodiments, contacts OD1 and OD2 may be first used to detect orientation and then later may be configured to perform certain other functions once the orientation detection is complete, e.g., carry communication signals between the accessory and the host device and/or carry accessory power from the host device to the accessory. In some embodiments, contacts 206(1)-206(N) in connector 404 may be floating prior to the completion of the orientation detection process. “Floating” in this context means that the contacts 206(1)-206(N) may not be assigned any function prior to the orientation detection and are in an deactivated or isolated state. This may be accomplished by having one or more of switches 1-N in an “open” state.
In some embodiments, orientation detection circuitry 420 may be coupled to contacts OD1 and OD2 and can monitor contacts OD1 and OD2 to detect presence of a particular or expected signal on either of the contacts. Orientation detection circuitry 420 can send a command over any of the contacts OD1 and OD2 and detect a response to the command. This will be explained in detail below.
In some embodiments, system 400 may include an ID module 408. ID module 408 may be implemented as an Application Specific Integrated Circuit (ASIC) chip programmed to perform a specific function, e.g., as one of chips 113a or 113b of FIG. 1A. In some embodiments, ID module 408 may be disposed in the accessory that connects with host device 402. In other embodiments, ID module 408 may be an integral part of connector 406 and may be disposed within a housing of connector 406, e.g., as illustrated in FIG. 1A. In some embodiments, ID module 408 may receive a command from host device 402 via contact OD2 and may respond with a predetermined response to the command over the same contact OD2. In some embodiments, ID module 408 is closely integrated with connector 406. In other words, ID module 408 and connector 406 may be disposed in an accessory that is configured to be operable with device 402. Thus, in an instance where the accessory is a cable, connector 406 and ID module 408 can be part of the cable. In some embodiments, ID module 408 may include configuration information associated with the contacts of connector 406 with which it is associated. Upon successful connection with host device 402, ID module 408 may provide the configuration information to host device 402 as described below.
In some embodiments, system 400 may also include accessory hardware 410. Accessory hardware 410 can be a processor and other associated circuitry of an accessory that is designed to be operable with device 402. In some embodiments, an accessory may provide power to device 402 and in other embodiments; the accessory may be powered by device 402. Accessory hardware 410 will vary depending on type and function of the accessory.
It will be appreciated that the system configurations and components described herein are illustrative and that variations and modifications are possible. The device and/or accessory may have other components not specifically described herein. Further, while the device and the accessory are described herein with reference to particular blocks, it is to be understood that these blocks are defined for convenience of description and are not intended to imply a particular physical arrangement of component parts. Further, the blocks need not correspond to physically distinct components. Blocks can be configured to perform various operations, e.g., by programming a processor or providing appropriate control circuitry, and various blocks might or might not be reconfigurable depending on how the initial configuration is obtained. Embodiments of the present invention can be realized in a variety of devices including electronic devices implemented using any combination of circuitry and software.
In operation, in an embodiment of the present invention, when connector 404 is physically mated with connector 406, signal line 414 changes its state from logic “high” to logic “low” when the connection detection contact of connector 404 makes physical contact with the ground ring portion of connector 406. This indicates to device 402 that connector 406 is now connected to connector 404. Thereafter, microcontroller 412 initiates the orientation detection operation.
Connector 406 is configured such that one contact within connector 406 carries an identification signal, e.g., ID contact 422 which may correspond to one of contacts OD1 or OD2 described above. Once the contact carrying the accessory identification signal is identified, device 402 can determine an orientation of connector 406 with respect to connector 404. As described above in relation to FIGS. 3A and 3B, connector 406 can be mated with connector 404 in more than one orientation. As also as described above, in order to illustrate the orientation detection process, we considered that either contact OD1 or OD2 of connector 404 is connected with ID contact 422 of connector 406. Thus, in one orientation, ID contact 422 can be connected to contact OD2 of connector 404 and in a second orientation, which is 180 degrees from the first orientation; ID contact 422 can be connected to contact OD2 of connector 404. In order to determine which of contacts OD1 or OD2 is connected to ID contact 422, the following process may be used.
Once it is determined that connector 406 is mated with connector 404, one of the switches 416 or switch 418 is closed so that the contact corresponding to the closed switch is now “active.” In other words, the contact associated with the closed switch is now in electrical connection with corresponding contact in connector 406. As described above, both switches 416 and 418 are in an “open” state when connector 404 and connector 406 are first mated with each other. Consider that switch 416 is closed first. In this instance, switch 418 is kept open to avoid any power or other harmful signal from appearing on the associated OD2 contact. In the instance illustrated in FIG. 4, closing switch 416 results in the contact OD1 being electrically coupled to accessory power line via connector 406. It is to be understood the contact OD1 may also have been connected to ID module 408 depending on which orientation connector 406 was connected to connector 404 (as shown by dotted line in FIG. 4). However, to explain the orientation detection process, FIG. 4 assumes that contact OD1 is connected to accessory power line while contact OD2 is connected to ID module 408.
Once switch 416 is closed, microcontroller 412 sends a command over the OD1 contact, e.g., using OD circuitry 420. OD circuitry 420 then “listens” for a specific and/or expected response to the command on the OD1 contact. In some embodiments, the command is interpretable only by ID module 408, which in turn generates a response to the command. However, in this example, the OD1 contact is coupled to the accessory power line and not to ID module 408. Therefore, ID module 408 does not receive the command and thus does not generate a response to the command. Consequently, no response to the command is received by OD circuitry 420 via the OD1 contact.
If after a predetermined time OD circuitry 420 does not detect a response on the OD1 contact, microcontroller 412 concludes the OD1 contact is not connected to ID module 408 on the accessory side and opens switch 416. Thereafter, microcontroller 412 closes switch 418. This causes contact OD2 to be now electrically connected to ID module 408 via ID contact 422. Thereafter, OD circuitry 420 sends the same command as above over the OD2 contact. Because the OD2 contact is connected to ID module 408, once ID module 408 receives the command, it generates and sends a response over the OD2 contact to microcontroller 412. The response is detected by OD circuitry 420. Thus, microcontroller 412 now knows that the OD2 contact is connected to ID module 408 and designates the line that is coupled to the OD2 contact as the accessory communication line (e.g., ACC_ID of FIG. 1E). Thus, in our example, one of contacts 206(1) or 206(8) now carries the accessory communication signal and the other contact can be designated as the accessory power contact (e.g., ACC_PWR of FIG. 1E). Based on the location/position of the accessory communication contact and the accessory power contact, host device 402 can now determine the orientation of the connector 406 with respect to connector 404.
FIG. 5 is a flow diagram of a process 500 for determining orientation of an accessory-side connector with respect to a host-side connector according to an embodiment of the present invention. Process 500 may be performed, e.g., by host device 402 of FIG. 4.
At block 502, the host device may detect coupling of the accessory (first) connector with its own (second) connector. In other words, the host device may detect that the accessory connector has been physically coupled to its own connector, e.g., via the connector detector contact in its connector. Once the host device determines that the accessory connector is physically coupled to its connector, the host device may, via the microcontroller, send a command over a first contact, e.g., OD1 of FIG. 4, of its connector, e.g., the OD1 contact described above at block 504. For example, the host device may send the ID command described below in reference to FIG. 7A. Once the command is sent, the host device may wait for a response to the command from the accessory. At block 506, the host device may check whether a response to the command was received from the accessory over the first contact. If a response is received over the first contact, the host device may determine the orientation of the accessory connector with respect to its own connector at block 508. For instance, based on the response, the host device now knows which contact in its own connector is coupled to the ID module in the accessory-side connector and can therefore designate that contact as the ID bus line or accessory communication line. Once the ID bus line/contact is known, the host device can determine the orientation in which the accessory connector is plugged in. Once the orientation is known, the host device may configure the rest of the contacts of the second connector based on the determined orientation, at block 510.
If at block 506, the host device receives no response to the command, the host device can send the same command over a second contact, e.g., OD2 of FIG. 4, in its connector at block 512. At block 514, the host device can again check to see if a valid response is received from the ID module for the command over the second contact. If a valid response is received, process 500 proceeds to blocks 508 and 510 as described above and the host device configures the rest of the contacts in its own (second) connector accordingly. If no response is received at block 514, the process returns to block 504 where the host device sends the same command over the first contact again. Thus, the host device may alternately send the command over the first and the second contacts until it receives a valid response on one of the contacts. In some embodiments, process 500 may be programmed to time out after a certain duration or after a certain number of attempts.
It should be appreciated that the specific steps illustrated in FIG. 5 provides a particular method of determining orientation according to an embodiment of the present invention. Other sequences of steps may also be performed according to alternative embodiments. For example, alternative embodiments of the present invention may perform the steps outlined above in a different order. Moreover, the individual steps illustrated in FIG. 5 may include multiple sub-steps that may be performed in various sequences as appropriate to the individual step. Furthermore, additional steps may be added or removed depending on the particular applications. In particular, several steps may be omitted in some embodiments. One of ordinary skill in the art would recognize many variations, modifications, and alternatives.
Certain embodiments of the present invention provide techniques for dynamically configuring contacts of a host-side connector. The configuring of the contacts may be done without first determining orientation of the accessory-side connector. In some embodiments, the host device may send a command to the accessory, as described above. The response to the command may include information about the contact assignment/configuration for the accessory-side connector. The accessory may provide this contact assignment information to the host device in a response packet similar to the one described below. Details of the command and response are described below in connection with FIGS. 7A and 7B. In addition to the contact configuration information, the accessory, e.g., via ID module 408, may also send configuration information of the accessory, an accessory identifier, etc. to the host device.
In some embodiments, the accessory configuration information may also include type of accessory, types of signals provided/required by the accessory, etc. among other things. For example, the accessory may provide information about the signal that each contact of connector 406 is configured to carry. For example, a first contact may carry a power signal; a second contact may carry a data signal, etc. Once the microcontroller 412 receives this contact configuration information from the accessory, it can operate switches 1-N associated with the corresponding contacts in connector 404 to configure the contacts to carry the same signals as the corresponding contacts in connector 406.
It is to be noted that contact configuration in the host device can occur independent of orientation detection for the accessory-side connector. For example, accessory-side connector, e.g., connector 406, can only be connected to connector 404 in a single orientation. In this instance there is no need for determining orientation of connector 406 with respect to connector 404. Upon connection, the accessory can send contact configuration information for connector 406 to the host device. The host device can then configure the contacts of its own connector 404 to match those of connector 406. Thus, in some embodiments, contact configuration may be performed without first performing orientation detection.
Once the contacts in connector 404 are configured properly, a continuous electrical link is established between device 402 and the accessory and device 402 can then communicate with the accessory in a substantive manner, e.g., exchange commands and data, run application programs, etc.
FIG. 6 is a flow diagram of a process 600 for configuring contacts of a connector according to an embodiment of the present invention. Process 600 can be performed, e.g., by device 402 of FIG. 4.
The host device initially detects physical connection between the host-side connector and the accessory-side connector (block 602). In an embodiment, the host device may use the connection detection contact described above to determine the physical connection. Once the two connectors are physically connected, the host device may send a command to the accessory to provide configuration information about the contacts on the accessory-side connector (block 604). In some embodiments, the host device need not even request this information and the accessory may automatically provide this information upon determination of physical connection between the two connectors. For example, the host device may send the request command sequence described with reference to FIG. 7C. The host device receives the contact configuration information from the accessory (block 606). For example, the host device may receive the response sequence described with reference to FIG. 7D. the contact configuration information enables the host device to determine the functionality associated with each contact in the accessory-side connector. Based on this information, the host device configures contacts in the host-side connector to match the functionality of the corresponding accessory-side connector contacts (block 608). For example, the host device may configure PIN —1 through PIN —4 using the pin selection field 780 (FIG. 7D). In some embodiments, the host device may operate switches 1-N illustrated in FIG.4 to impart the appropriate functionality to some of the contacts in the host-side connector. For example, the host device may connect SWITCH 1 through SWITCH 4 to the appropriate communication circuitry 430 and/or power circuitry (not shown) based on the contents of the pin selection field 780.
In some embodiments, the accessory may not even send the contact configuration information to the host device. Instead the host device may determine the type of accessory connected to it based on, e.g., an accessory identifier. Once the type of accessory is determined, the host system may consult a look-up table in order to determine contact configuration of the accessory-side connector and accordingly configure the contacts of the host-side connector. In this instance, the look-up table may include contact configuration information for various accessory-side connectors that may be indexed using a unique accessory identifier associated with each accessory.
It should be appreciated that the specific steps illustrated in FIG. 6 provides a particular method for configuring contacts according to an embodiment of the present invention. Other sequences of steps may also be performed according to alternative embodiments. For example, alternative embodiments of the present invention may perform the steps outlined above in a different order. Moreover, the individual steps illustrated in FIG. 6 may include multiple sub-steps that may be performed in various sequences as appropriate to the individual step. Furthermore, additional steps may be added or removed depending on the particular applications. In particular, several steps may be omitted in some embodiments. One of ordinary skill in the art would recognize many variations, modifications, and alternatives.
In some embodiments, the configuration of the accessory-side contacts may be changed by the accessory after providing an initial configuration information. This may happen in instances where the accessory is capable of performing two different functions, e.g., USB and UART. Initially, the accessory may specify the accessory-side connector contacts as being configured for USB signals and communicate that information to the host. The host may then configure the contacts of its host-side connector to match the accessory-side connector contacts. Then during operation, consider that the accessory changes the accessory-side connector contacts to now carry UART signals. In this instance, the accessory can send new configuration information to the host device and the host device can dynamically change the configuration of the host-side connector contacts to match the new configuration.
As described above, when the ID module receives a command from the microcontroller, it sends a predetermined response back to the microcontroller. FIGS. 7A and 7B illustrate a command and response sequence according to an embodiment of the present invention.
FIG. 7A illustrates a structure for a command sequence 700 that can be sent by the microcontroller over the OD1 or the OD2 lines according to an embodiment of the present invention. Command sequence 700 may include a break pulse 702. In some embodiments, break pulse 702 may be used to indicate to the ID module that a command is being sent by the microcontroller and/or to indicate start of a command. In some embodiments, the duration of break pulse may be programmable. In some embodiments, break pulse 702 resets the ID module to a known state so that the ID module is ready to receive the command from the microcontroller. Break pulse 702 may be followed by a command 704. In some embodiments, command 704 can include between 8 and 16 bits. In some embodiments, command 704 can be followed by a N-byte payload 706. In other embodiments, command 704 can be sent without any payload. For the purposes of detecting orientation, command 704 can be followed by up to 16 bits of payload 706. In this instance, payload 706 may include a unique identifier associated with the microcontroller. The unique identifier can be used by the ID module to recognize the microcontroller and/or the device and formulate a response to command 704. For example, the unique identifier may inform the ID module whether the device is phone, a media player, or a personal computing device, e.g., a tablet computer, or a debug accessory.
In some embodiments, payload 706 (or command 704) may be followed by Cyclic Redundancy Check (CRC) sequence 708. CRC is an error-detecting code designed to detect accidental changes to raw computer data, and is commonly used in digital networks and storage devices. Blocks of data entering these systems get a short check value attached, derived from the remainder of a polynomial division of their contents; on retrieval the calculation is repeated, and corrective action can be taken against presumed data corruption if the check values do not match. In some embodiments, CRC sequence 708 can be generated using a 8 polynomial function of X8+X7+X4+1. In some embodiments, CRC 708 may be followed by another break pulse 702 signaling end of the command sequence. This indicates to the ID module that the microcontroller has finish sending the command and associated data, if any, and is now ready to receive a response. It is to be understood that only the ID module can interpret and respond to this command. Thus, if command sequence 700 is sent over a line that is not connected to the ID module, the microcontroller in the host device will not receive a response to the command. In some embodiments, the command may time-out if a response is not received from the host device. In this instance, the microcontroller will conclude that the line is not connected to the ID module and hence is not the ID bus line.
One skilled in the art will realize the command sequence 700 is illustrative only and may include more or less information than shown in FIG. 7A depending on the specific requirements for communication between the device and the accessory that includes the ID module.
Once the ID module receives command sequence 700, it may send a response sequence 720 as illustrated in FIG. 7B. Response sequence 720 may include a command response 722. Command response 722 may be a predetermined response for command 704. For example, regardless of the type of device connected, each ID module may generate the same command response 722 in response to receiving command 704 from the device. Response sequence 720 may also include payload 724, which may be up to 48-bits long. In some embodiments, payload 724 may include an identifier associated with the accessory incorporating the ID module, e.g., a serial number of the accessory. In some embodiments, payload 724 may also include configuration information associated with the accessory such as type of accessory, various signals needed by the accessory in order to communicate with the device, etc. In some embodiments, payload 724 may include information about functionality associated with each if the contacts in the accessory-side connector. For example, up to 4 bits may be used to indicate functionality to be imparted to the OD1 and OD2 switches. In some embodiments, up to 2 pairs of 2-bits each in payload 724 may inform the microcontroller on how to configure the switches 1-N, where N=4 or in other words which functionality is to be imparted to the contacts associated with switches 1-N. Once configured, the switches connect the various contacts in connector 404 to other circuitry within device 402. It is to be understood that additional bits may be used for additional switches and the system is expandable. Thus, upon receiving the command response, the microcontroller now knows how to configure the various switches 1-N, OD1, and OD2 described above. In some embodiments, payload 724 may be followed by CRC 726. CRC 726 may be similar to CRC 708. In some embodiments, the total duration for sending command sequence 700 and receiving response sequence 720 is about 3 milliseconds. Details of the command and response structure and their contents is described in a co-pending U.S. patent application Ser. No. 13/607,426, filed on Sep. 7, 2012 , the contents of which are incorporated by reference herein in its entirety for all purposes.
FIG. 7C illustrates a detailed structure for a portion of command sequence 750 for requesting pin configuration and accessory capability information according to one embodiment. Command 754 corresponds to command 704, system identifier portions 756(a) and 756(b) correspond to payload 756, and CRC 758 corresponds to CRC 708. The command 754 is a single byte field followed by two bytes forming the payload 756 and a single byte CRC 758. The command 754 in this embodiment is a request for pin configuration and accessory capability information. The payload 756 in this case is formed from a first portion 756(a) that includes a first portion of a system identifier followed by a second portion 756(b) that includes a second portion of the system identifier. In some embodiments, each portion constitutes one byte of the system identifier. The system identifier is a unique identifier for each type of product (e.g., phone, tablet, etc.) that is fused in the hardware of that product. The payload 756 is then followed by a single byte field forming the CRC 758.
FIG. 7D illustrates a detailed structure of a response sequence 760 for responding to a request for pin configuration and accessory capability information. Command response 762 corresponds to command response 722, payload 764 corresponds to payload 706, and CRC 766 corresponds to CRC 726. The command response 762 is a single byte field followed by a six byte payload 764 and single byte CRC 766. The command response 762 in this case is a unique sequence of bits that corresponds to the unique command 754. The CRC 766 is a CRC of the command response 762 and payload 764. The payload in this case includes a pin selection field 770 followed by an accessory capability field 780 followed by an expansion field 790. The pin selection field 770 is operable to cause a host device to select one of a plurality of communication protocols (e.g., UART, USB, JTAG, etc.) for communicating with the accessory over one or more connector pins (e.g., one or more of the pins in connector 404), or performing some other type of function/operation (e.g., supplying power, receiving power, etc.) via one or more connector pins. The accessory capability field 780 defines or more capabilities of the accessory, such as the maximum speed of the selected communication protocol that the accessory can communicate at. The expansion field 790 may include any other information suitable to be communicated from the accessory to the host, such as information defining additional capabilities of the accessory.
In some embodiments, pin selection field 770 may include one or more individual or sets of bits that operate to identify a connector pin and cause the host device to select a communication protocol, power source, or other functional capability. Accordingly, pin selection field 770 may include ACCx bits 771 that operate to define the function of contacts ACC_1 and ACC_2. By defining the function of contacts ACC_1 and ACC_2, microcontroller 412 may use the contents of the ACCx bits 771 to configure corresponding contacts in the host-side connector.
For example, the contents of the ACCx bits 771 may cause microcontroller 412 to switch ACC _1 416 to a power source provided in electronic device 402 so as to provide power to pin ACC_1, and may cause microcontroller 412 to switch ACC_2 318 to UART communication circuitry provided within electronic device 402 so that electronic device 402 may communicate with ID module 408 via UART on pin ACC_2. For another example, the contents of the ACCx bits 771 may cause microcontroller 412 to couple the ACC _1 pin to the ID bus circuitry 420 while leaving the ACC_2 pin in a high impedance state. The ACC_2 pin may then subsequently be controlled by software whereby the software may control switch 418 to couple the ACC_2 pin to a power source in the host device. For yet another example, the contents of the ACCx bits 771 may cause microcontroller 412 to couple the ACC _1 pin to a transmission circuitry (e.g., USB13 Tx, UART13 Tx, etc.) while coupling the ACC_2 pin to reception circuitry (e.g., USB13 Rx, UART13Rx, etc.). More generally, the contents of the ACCx bits 771 may cause microcontroller 412 to couple the ACC_1 and ACC_2 pins to co-operating circuitry, such as by coupling ACC_1 to JTAG digital I/O circuitry and ACC_2 to JTAG Clock circuitry. For yet another example, the contents of the ACCx bits 771 may cause microcontroller 412 to reset the host device.
Returning to FIG. 7D, in addition or alternatively to ACCx bits 771 defining the function of contacts ACC_1 and ACC_2, pin selection field 770 may include USB bits 772, UART bits 773, DB bits 774, and MB bits 775. USB bits 772 indicate the USB configuration of the accessory and thus the desired USB configuration of the host device. For example, the USB configuration may indicate whether the host device should act as host or slave, and/or whether the accessory has or does not have USB capability. UART bits 773 indicate a configuration of the UART controller in the accessory, which includes a speed of the UART controller. For example, the UART bits 775 may indicate that the accessory does not include UART control, that the accessory is capable of communicating over UART at 17200 bps, that the accessory is capable of communicating over UART at 57600 bps, or that the accessory is capable of communicating over UART at 115200 bps. DB bits 774 indicate whether the accessory is a debug accessory (i.e., an accessory used for debugging the host device) or a non-debug accessory (e.g., a customer accessory). MB bits 775 indicate whether the accessory includes an audio and/or video data transfer bus.
The USB, UART, DB, and MB bits may be used by the host device to configure one or more of its switches, such as Switch 1 through Switch N and/or switches 416 and 418. For example, when the USB bits 773 indicate that the accessory is capable of USB communication, the MB bits 774 indicates the accessory does not include an audio or video data transfer bus, and the UART bits indicate that the accessory is capable of UART communication at certain data transfer rate, PIN_1 and PIN_2 may be configured for USB communication while PIN_3 and PIN_4 may be configured for UART communication.
Like the pin selection field 770, the accessory capability field 780 may include one or more individual or sets of bits. These bits, however, operate to indicate capabilities of the accessory and, in most embodiments, are not used by the host device to control its switches such as Switch 1 to N or switches 416 and 418. Accessory capability field 780 may include one or more of a variety of accessory capability bits, such as PS bits 781, HV bits 782, BP bits 783, CC bits 784, AU bits 785, PWR bits 786, DI bits 787, and AI bits 788. PS bits 781 indicate when power should be supplied from the host device to the accessory (e.g., over ACC_1 or ACC_2). For example, the PS bits 781 in one state may indicate that power charging should be disabled when the host device is asleep, whereas a the PS bits 782 in another state may indicate that power charging should be enabled at all times the accessory is connected to the host device.
HV bits 782 indicate the maximum charging voltage supported by the accessory, where the maximum charging voltage is the maximum voltage that the accessory may safely transfer from a power source to the host device. For example, HV bits 782 may indicate a maximum charge voltage of 0 volts, 5 volts, 10 volts, 15 volts, 20 volts, a voltage in the range of 0 to 20 volts, or a voltage greater than 20 volts. BP bits 783 indicate the charging behavior of the host device when receiving power from the accessory. For example, BP bits 783 in one state may indicate that the host device may receive and consume power from the accessory for both operating the host device and charging a battery of the host device, whereas BP bits 783 in another state may indicate that the host device may use received power only for operating the host device.
CC bits 784 indicate the power removal behavior which is the behavior of the host device when power is removed from the host device. For example, the CC bits 784 in one state may indicate that the host device may continue normal operation when power is removed, whereas the CC bits 784 in another state may indicate that the host device should pause operation when power is removed. AU bits 785 indicate whether the accessory supports authentication commands from a host device, where authentication commands may be commands used to authenticate the accessory. PWR bits 786 indicate the maximum power that the accessory can receive from the host device via, e.g., ACC_1 or ACC_2 bits. For example, PWR bits 781 may indicate a maximum accessory voltage of 0 volts, 1 volt, 2 volts, 3 volts, 4 volts, 5 volts, a voltage in the range of 0 to 5 volts, or a voltage greater than 5 volts.
DI bits 787 indicate the diagnostics mode behavior which is the behavior of the host device with respect to diagnostic operation. For example, DI bits 787 in one state may indicate that the host device may continue normal operation, whereas DI bits 787 in another state may indicate that the host device should enter factory diagnostics operation. AI bits 788 indicate whether an accessory supports accessory information commands from a host device, where an accessory information command is a command requesting accessory information such as the accessory manufacturer, accessory model number, accessory name, or other accessory-related information.
In some embodiments, such as when the microcontroller 412 is a hardware-implemented state machine, pins of the host device (e.g., pin ACC_1 and ACC_2) may be configured even if the host device does not have any power. Once the host device acquires sufficient power to execute software on its processor, e.g., processor 440, the programmed software may then reconfigure the switches. For example, processor 440 may control microcontroller 412 so as to reconfigure switches 1-N and/or switches 416 and 418, thereby reconfiguring the pins of the host device. In one particular example, the ACCx bits 771 may be configured to instruct the microcontroller 412 to couple the ACC_1 pin to the ID bus circuitry 420 while leaving the ACC_2 pin in a high impedance state. The ACC_2 pin may then subsequently be controlled by software whereby the software may control switch 418 to couple the ACC_2 pin to a power source in the host device. It should be recognized that not only may ACC_1 and ACC_2 be initially configured in hardware and subsequently configured software, but other pins such as PIN_1 through PIN_4 may similarly be configured.
In some embodiments, the pin configuration may change for a given payload 524 based on the results of the orientation detection process which, in some embodiments, may also be performed by a hardware-implemented state machine. That is, as a result of the orientation detection process previously described, ID Bus Circuitry 420 may detect a signal on one of contacts ACC_1 and ACC_2. When ID Bus Circuitry 420 detects a signal on contact ACC_1 (e.g., by sending a command and receiving an expected response over ACC_1), microcontroller 412 may configure its switches for a given payload 764 such that the pins in connector 404 are operable to perform a set of functions. However, when ID Bus circuitry 420 detects a signal on contact ACC_2, microcontroller 412 may configure its switches for the same payload 764 differently such that the pins in connector 404 are operable to perform a different set of functions, or the same set of functions but dispersed across different pins. For example, for a particular ACCx value, in one orientation ACC_1 may be set for software control and ACC_2 may be set for connection to ID Bus Circuitry 420, while in another orientation ACC_1 may be set for connection to ID Bus Circuitry 420 and ACC_2 set for software control. For another example, for a particular value of pin selection 770, in one orientation PIN_1 and PIN_2 may be set for software control and PIN 3 and PIN 4 set for USB communication, while in another orientation PIN_1 and PIN_2 may set for USB communications while PIN_3 and PIN_4 are set for software control.
One skilled in the art would recognize that the specific bit assignments depicted in and described with reference to FIG. 7D are merely exemplary and not limiting. While the pin selection field 770 is shown to include five component fields (ACCx, USB, UART, DB, MB), it may include more or fewer component fields. Similarly, while the accessory capability field 780 is shown to include eight component fields, it may include more or fewer component fields. Further, each component field may include one or more bits. The order of each field (e.g., pin selection field 770 followed by accessory capability field 780) is also not to be limited to the order depicted in FIG. 5B, but rather the fields could be arranged in different orders (e.g., the accessory capability field 780 could be followed by the pin selection field 770). Similarly, the order of the components in each field (e.g., ACCx component 771 followed by USB component 772) is also not to be limited to the order depicted in FIG. 5B, but rather the components could be arranged in different orders (e.g., USB component 772 could be followed by ACCX component 771). The number of components of each field is also not limited to the number of components depicted in FIG. 7D, but rather each field (e.g., pin selection field 770) could include more or fewer components (e.g., UART component 773 and DB component 774 could be omitted). Further details of command and response structures and their contents are described in a co-pending U.S. patent application Ser. No. 13/607,426, filed on Sep. 7, 2012, the contents of which are incorporated by reference herein in its entirety for all purposes.
Referring back to FIG. 4, in some embodiments, if connector 406 is physically removed/detached from connector 404, device 402 detects the removal via connector detect 414 and as a result, microcontroller 412 places all the switches 1-N in an ‘open’ state. For example, if a logic “high” is detected on signal line 414 for longer than a predetermined duration, the microcontroller can conclude that connector 406 has been detached from connector 404 and may instruct device 402 accordingly. In some embodiments, the predetermined duration is between 20 μs and 100 μs.
The embodiments described above can be independent of each other. For example, orientation detection can be performed without being followed by contact configuration. Orientation detection may be useful in instances where the contacts all have fixed functionality and it is desirable to only determine which way the accessory-side connector is connected to the host-side connector. Also, in another embodiment, contact configuration can be performed without first determining orientation of the accessory-side connector with respect to the host-side connector. For example, in some instances, the two connectors can only be mated in a single orientation. In this instance there is no need for determining orientation and upon connection the host device may configure the host-side connector contacts based on the accessory-side connector.
In yet another embodiment of the present invention, contact configuration can follow and be based on the orientation of the accessory-side connector with respect to the host-side connector. For example, in instances where two connectors can be mated with each other in more than one orientation, it may be beneficial to first determine the orientation of one connector with respect to another (e.g., using the technique described above) and then configure the contacts based on the determined orientation.
FIG. 8A is a cross-sectional view illustrating an accessory-side connector 100 (or connector 101) mated with a host-side connector 250 according to an embodiment of the present invention. As illustrated in FIG. 8A, contact 114(1) of connector 100 is in contact with contact 206(1) of connector 250. Connector 100 is reversible and can be mated with connector 250 in at least two orientations. In addition to the orientation illustrated in FIG. 8A, connector 100 can also be mated with connector 250 in another orientation illustrated in FIG. 8B. In the other orientation contact 112(8) of connector 100 is in contact with contact 206(1) of connector 250. Thus, it can be seen that in the two orientations, two different contacts of connector 100 can be coupled to the same contact of connector 250. Thus, in this instance it would be beneficial to first determine which orientation connector 100 is mated before any of the contacts are configured. For example, since some of the contacts may carry power, it would be detrimental if the incorrect contact on the host-side connector is enabled to carry power.
In this embodiment, once it is determined that connector 100 is physically connected to connector 250, e.g., using the connection detection contact described above, the host device then attempts to determine in which orientation is connector 100 mated with connector 250. In other words, the host device determines which contacts of connector 100 are actually physically connected to the contacts of connector 250. Once the orientation is determined, the host device can use that information and the contact configuration information of connector 100 to configure the contacts of connector 250.
FIGS. 9A and 9B illustrate a flow diagram for a process 900 for determining orientation and configuring contacts of a connector according to an embodiment of the present invention. Process 900 may be performed by, e.g., host device 402 of FIG. 4.
As described above, when the host device is not connected to any accessory via its host-side connector, all the switches that control the contacts of the host-side connector are in an “open” state thus placing all the contacts in a deactivated/isolated state. This is done to ensure that no unwanted signal can be received by the host device thus protecting the host device from any damage. At block 902 the host device determines that an accessory-side connector has been physically mated with its host-side connector, e.g., using the connection detection contact in the host-side connector. In response to detecting physical mating of the two connectors, the host device, at block 904, closes a switch associated with a first contact of the host-side connector to be used for detecting orientation. This results in the first contact being activated or in other words a continuous connection path now exists between host device and the accessory via the first contact.
Thereafter, the host device sends a command to the accessory over the first contact at block 906. In some embodiments, the command may request certain information from the accessory. After sending the command over the first contact, the host device then waits to receive a response back from the accessory, at block 908. Thereafter the host device checks to see if a response was received from the accessory at block 910. If the host device receives a response from the accessory on the first contact, the host device designates the first contact as carrying the accessory communication signals. As described above, the command sent by the host device can only be interpreted by an ID module in the accessory or the accessory-side connector. Thus, the fact that a response was received on the first contact means that the first contact is coupled to the ID module in the accessory.
Once it is determined that the first contact is coupled to the accessory communication contact of the accessory-side connector, the host device can determine orientation of the accessory-side connector with respect to the host-side connector at block 912. In other words, the host device now knows which contacts of the accessory-side connector are in physical contact with contacts of the host-side connector. The response received from the accessory over the first contact includes information that specifies functionality associated with each of the contacts of the accessory-side connector. The host device, at block 914, can analyze the information received from the accessory and determine the function associated with each contact of the accessory-side connector. Based on this information and the previously determined orientation information the host device now knows which contacts of the host-side connector are to be assigned which function in order to be compatible with the accessory-side connector. In order to accomplish this, the host device, at block 916, operates a switch associated with one or more of the contacts of the host-side connector in order to configure the contact to enable the determined function.
However, if at block 910 the host device does not receive any response from the accessory, the host device opens the first switch and deactivates the first contact at block 918, as illustrated in FIG. 9B. Thereafter at block 920 the host device closes a second switch associated with a second contact and activates the second contact. At block 922, the host device sends the same command over the second contact and waits for a response from the accessory. If a response from the accessory is received at block 924 over the second contact, process 900 continues to step 912. If the host device does not receive a response from the host device at block 924, the host device opens the second switch and deactivates the second contact at block 928. Thereafter process 900 returns to step 904 where the first contact is again activated.
Host device may alternately activate the first contact and the second contact, send the command over the active contact, and wait for a response from the accessory. In some embodiments, the host device may repeat this process indefinitely until it receives a response from the accessory. In other embodiments, after expiration of a predetermined time duration, the host may stop process 900 and report an error. In some embodiments, the first contact and the second contact used for determining orientation are predetermined and programmed into the host device. In other embodiments, the first and/or the second contact may be dynamically selected.
It should be appreciated that the specific steps illustrated in FIGS. 9A and 9B provides a particular method for determining orientation and configuring contacts according to an embodiment of the present invention. Other sequences of steps may also be performed according to alternative embodiments. For example, alternative embodiments of the present invention may perform the steps outlined above in a different order. Moreover, the individual steps illustrated in FIGS. 9A and 9B may include multiple sub-steps that may be performed in various sequences as appropriate to the individual step. Furthermore, additional steps may be added or removed depending on the particular applications. In particular, several steps may be omitted in some embodiments. One of ordinary skill in the art would recognize many variations, modifications, and alternatives.
Circuits, logic modules, processors, and/or other components can be described herein as being “configured” to perform various operations. Those skilled in the art will recognize that, depending on implementation, such configuration can be accomplished through design, setup, interconnection, and/or programming of the particular components and that, again depending on implementation, a configured component might or might not be reconfigurable for a different operation. For example, a programmable processor can be configured by providing suitable executable code; a dedicated logic circuit can be configured by suitably connecting logic gates and other circuit elements; and so on.
While the embodiments described above can make reference to specific hardware and software components, those skilled in the art will appreciate that different combinations of hardware and/or software components can also be used and that particular operations described as being implemented in hardware might also be implemented in software or vice versa.
Computer programs incorporating various features of the present invention can be encoded on various non-transitory computer readable storage media; suitable media include magnetic disk or tape, optical storage media, such as compact disk (CD) or DVD (digital versatile disk), flash memory, and the like. Computer readable storage media encoded with the program code can be packaged with a compatible device or provided separately from other devices. In addition program code can be encoded and transmitted via wired optical, and/or wireless networks conforming to a variety of protocols, including the Internet, thereby allowing distribution, e.g., via Internet download.
Thus, although the invention has been described with respect to specific embodiments, it will be appreciated that the invention is intended to cover all modifications and equivalents within the scope of the following claims.

## Claims

1. An electronic device comprising:
a plurality of different types of communication circuitry including at least a first type of communication circuitry configured to enable the electronic device to communicate with another electronic device using a first communication protocol and a second type of communication circuitry configured to enable the electronic device to communicate with another electronic device using a second communication protocol different than the first communication protocol; and
a first connector having a plurality of contacts including a first contact and at least one data contact;
switching circuitry operatively coupled between the plurality of different types of communication circuitry and the at least one data contact; and
control circuitry operatively coupled to the switching circuitry and configured to:
detect when a second connector associated with a second electronic device is mated with the first connector,
in response to the detection, send a command comprising a plurality of bits to the second electronic device over the first contact in the plurality of contacts requesting contact configuration information, and
if a response to the command including the requested contact configuration information is received over the first contact, control the switching circuitry to connect the data contact to one of the plurality of different types of communication circuitry based on information in the response.

2. The electronic device of claim 1 further comprising detection circuitry configured to:
in response to detecting mating of the second connector, switch the first contact from an open state to be connected with the control circuitry thereby enabling the control circuitry to send the command over the first contact.

3. The electronic device of claim 1 wherein if no response is received over the first contact, the control circuitry is further configured to send the command over a second contact in the plurality of contacts.

4. The electronic device of claim 1 wherein the response to the command including the requested contact configuration information is in the form of a data structure that includes a command response field and a payload field, where the command response field defines a response to commands communicated to the second electronic device by the electronic device and the payload field includes a pin selection field enables the first electronic device to identify a communication protocol from the plurality of communication protocols and identify one or more contacts in the plurality of contacts over which the identified communication protocol is to be used.

5. The electronic device of claim 4 wherein and the payload field further includes an accessory capability field defining one or more capabilities of the second electronic device.

6. The electronic device of claim 1 wherein to detect when the second connector is mated with the first connector, the control circuitry is further configured to
monitor a connection detection contact in the plurality of contacts; and
determine that the second connector is mated with the first connector when it detects a logic low on the connection detection contact.

7. The electronic device of claim 1 wherein the first connector is a receptacle connector and the second connector is a plug connector.

8. The electronic device of claim 7 wherein the detect step detects when the plug connector is inserted into the receptacle connector.

9. The electronic device of claim 1 wherein the first connector comprises:
a housing that forms a cavity configured to receive the second connector; and
wherein the plurality of contacts are arranged as a single row on an anterior surface of the cavity.

10. The electronic device of claim 9 further comprises first and second retention latches disposed on opposite sides of the housing.

11. The electronic device of claim 1 wherein the plurality of contacts includes first and second pairs of differential data contacts and wherein, based on information in the response, the control circuitry controls the switching circuitry to connect the first pair of differential data contacts to the first type of communication circuitry within the plurality of different types of communication circuitry and controls the switching circuitry to connect the second pair of differential data contacts to the second type of communication circuitry within the plurality of different types of communication circuitry.

12. The electronic device of claim 1 wherein the first connector comprises:
a housing that forms a cavity configured to receive the second connector; and
wherein the plurality of contacts are arranged in a first row and a second row along a top anterior surface of the cavity and a bottom anterior surface of the cavity, respectively.

13. The electronic device of claim 12 wherein the first row and the second row each has equal number of contacts arranged therein.

14. A method of configuring a receptacle connector having a housing that defines an interior cavity into which a plug connector can be inserted in either a first orientation or a second orientation rotated 180 degrees from the first orientation and a first plurality of electrical contacts positioned along a first interior surface of the interior cavity, the plug connector having a second plurality of electrical contacts, the method comprising:
detecting, by a first device coupled to the receptacle connector, insertion of the plug connector into the interior cavity, wherein each contact in the second plurality of electrical contacts is in physical contact with a corresponding contact in the first plurality of electrical contacts;
sending, by the first device, via the receptacle connector, a signal over a first contact from the first plurality of electrical contacts;
monitoring, by the first device, the first contact to determine if a response is received for the signal;
if the response is not received over the first contact, sending, by the first device, via the receptacle connector, a signal over a second contact of the first plurality of electrical contacts;
monitoring, by the first device, a second contact to determine if a response is received for the signal;
determining, by the first device, whether the plug connector is inserted in the first orientation or the second orientation based on whether the response is received over the first contact or the second contact;
receiving, by the first device, configuration information for the second plurality of contacts of the plug connector;
setting, by the first device, internal connections to at least some of the first plurality of electrical contacts according to a first mapping when the plug connector is inserted into the interior cavity in the first orientation and setting internal connections to the at least some of the first plurality of electrical contacts according to a second mapping when the plug connector is inserted into the interior cavity in the second orientation.

15. The method of claim 14 wherein the signal comprises a request and the response comprises a response to the request.

16. The method of claim 15 wherein the request is for sending identification information associated with an accessory coupled to the plug connector.

17. The method of claim 14 wherein detecting insertion of the plug connector into the interior cavity further comprises:
electrically coupling at least one contact from the first plurality of electrical contacts to a ground contact of the plug connector;
receiving, by the first device, an indication indicating the coupling; and
determining, by the first device, that the plug connector is inserted into the receptacle connector based on the indication.

18. The method of claim 17 wherein the indication comprises an electrical signal equivalent to a logic low.

19. An electronic device comprising:
a receptacle connector including a first plurality of electrical contacts, wherein the receptacle connector is capable of accepting a plug connector that can be mated either in a first orientation or a second orientation 180 degrees rotated from the first orientation, the first plurality of electrical contacts including first and second contacts and at least one data contact;
a plurality of different types of communication circuitry including at least a first type of communication circuitry configured to enable the electronic device to communicate with another electronic device using a first communication protocol and a second type of communication circuitry configured to enable the electronic device to communicate with another electronic device using a second communication protocol different than the first communication protocol;
switching circuitry operatively coupled between the plurality of different types of communication circuitry and the at least one data contact; and
control circuitry operatively coupled to the switching circuitry and configured to:
detect mating of a plug connector associated with a second electronic device to the receptacle connector, wherein the plug connector includes a second plurality of electrical contacts;
in response to the detection, send a command comprising a plurality of bits to the second electronic device over the first contact in the first plurality of electrical contacts, the command requesting contact configuration information; and
if a response to the command including the requested contact configuration information is received over the first contact, control the switching circuitry to connect the data contact to one of the plurality of different types of communication circuitry; based on information in the response.

20. The electronic device of claim 19 wherein the response to the command including the requested contact configuration information is in the form of a data structure that includes a command response field and a payload field, where the command response field defines a response to commands communicated to the second electronic device by the electronic device and the payload field includes a pin selection field enables the first electronic device to identify a communication protocol from the plurality of communication protocols and identify one or more contacts in the plurality of contacts over which the identified communication protocol is to be used.

21. The electronic device of claim 20 wherein the payload field further includes an accessory capability field defining one or more capabilities of the second electronic device.

22. The electronic device of claim 19 wherein the first plurality of contacts includes up to 16 contacts.

23. The electronic device of claim 19 wherein the first connector comprises:
a housing that forms a cavity configured to receive the second connector; and
wherein the first plurality of contacts are arranged as a single row on an anterior surface of the cavity.

24. The electronic device of claim 19 wherein the circuitry is further configured to:
if the response is not received over the first contact, send the command over the second contact in the first plurality of contacts; and
if a response to the command including the requested contact configuration information is received over the second contact,
control the switching circuitry to connect the data contact in the first plurality of contacts to one of the plurality of different types of communication circuitry based on information in the response about the second plurality of contacts.

25. The electronic device of claim 24 wherein the circuitry is further configured to:
control the switching circuitry to set the first and second contacts in an open state prior to detecting mating of the plug connector to the receptacle connector, and after detecting mating of the plug connector to the second connector: (i) activate the first contact by closing a first switch associated with the first contact prior to sending the command over the first contact;
and, prior to sending the command over the second contact, activate the second contact by closing a second switch associated with the second contact and deactivate the first contact by opening the first switch.

26. The electronic device of claim 24 wherein the control circuitry sets internal connections to the one or more contacts in the plurality of contacts based on the configuration information of the contacts in the second connector and the payload field further includes an accessory capability field defining one or more capabilities of the second electronic device.

27. The electronic device of claim 19 wherein the response to the command including the requested contact configuration information is in the form of a data structure that includes a command response field and a payload field, where the command response field defines a response to commands communicated to the second electronic device by the electronic device and the payload field includes a pin selection field enables the first electronic device to identify a communication protocol from the plurality of communication protocols and identify one or more contacts in the plurality of contacts over which the identified communication protocol is to be used.