This invention relates in general to device interface techniques, and more particularly, to a self-configuring peripheral interface system, peripheral device therefor and interface method for facilitating communications between a master device and one or more peripheral devices coupled thereto across a physical interface.
A dedicated, high pin count bus interface is often required to connect a master device, such as an embedded system, to one or more upgrade or add on peripheral devices. For example, a video game system cartridge, which typically has many interface pins to accommodate address and data signals, as well as decode lines, conventionally must also include separate lines for interfacing each add on peripheral device to the master system. Using the example of a portable video game console, it may be desirable to have a digital camera peripheral device, audio input peripheral device, printer peripheral device, or even additional game controllers for multiple players connected to the video game controller. In order for existing systems to implement this functionality, they require one of the following:
A need thus remains in the art for an enhanced, self-configuring peripheral interface technique, particularly for coupling one or more peripheral devices to a master device such as an embedded system, which minimizes the physical interface pin count requirements and does not require prestored microcode to operate all possible peripheral devices at the time the master device is offered for sale.
The shortcomings of the prior art are overcome and additional advantages are provided through a peripheral interface system which includes a master device coupled to a physical interface for connecting at least one peripheral device thereto, and logic activated by the master device to automatically initiate copying of relocatable device driver code from the at least one peripheral device when the at least one peripheral device is coupled to the master device via the physical interface. The copied device driver code facilitates communication by the master device with the at least one peripheral device.
In another aspect, a peripheral device is provided that is connectable to a master device via a physical interface. This peripheral device includes a peripheral functional component and relocatable device driver code. The relocatable device driver code is stored in non-volatile memory of the peripheral device, and is copied by a master device when the peripheral device is coupled thereto across a physical interface. The relocatable device driver code facilitates communication by the master device with the peripheral functional component of the peripheral device.
In yet another aspect, a peripheral interface system is provided that includes a master device coupled to a physical interface and at least one peripheral device coupled to the master device across the physical interface. The at least one peripheral device includes at least one peripheral functional component and at least one relocatable device driver code stored in at least one non-volatile memory of the at least one peripheral device. The peripheral interface system further includes logic activated by the master device to automatically initiate copying by the master device of the at least one relocatable device driver code from the at least one peripheral device. The at least one relocatable device driver code facilitates communication by the master device with the at least one peripheral functional component.
In a further aspect, a method of interfacing a peripheral device and a master device is provided. The method includes: providing the master device with a physical interface for connecting at least one peripheral device thereto, and logic for automatically initiating copying of relocatable device driver code from the at least one peripheral device when the at least one peripheral device is coupled thereto via the physical interface; and providing relocatable device driver code stored within non-volatile memory of each of the at least one peripheral device for accessing an associated peripheral functional component thereof, the relocatable device driver code facilitating communication by the master device with the associated peripheral functional component of the at least one peripheral device when copied by the master device from the non-volatile memory of the peripheral device.
Additional features and advantages are realized through the techniques of the present invention. Other embodiments and aspects of the invention are described in detail herein and are considered a part of the claimed invention.
The subject matter which is regarded as the invention is particularly pointed out and distinctly claimed in the claims at the conclusion of the specification. The foregoing and other objects, features, and advantages of the invention are apparent from the following detailed description taken in conjunction with the accompanying drawings in which:
Each peripheral device includes relocatable device driver code stored within non-volatile memory at one address and an associated peripheral functional component at a second address thereof. This sequential addressing of non-volatile storage memory and the peripheral functional component is significant, and in accordance with one aspect of the present invention, is repeated for each of the peripheral devices to be coupled to the master device across the single shared interface. Thus, each peripheral device essentially compromises a single unit with two components, i.e., a non-volatile storage component and the actual peripheral functional component. Both of these components are separately addressed. For example, peripheral device 220 includes a digital-to-analog converter (DAC) component 224 at address 2 and a serial EEPROM (SEEPROM) with relocatable device driver code at address 1222 for accessing the DAC component at address 2. Peripheral device #2230 has an analog-to-digital converter functional component 234 at address 4 with an associated SEEPROM containing relocatable device driver code for accessing the ADC functional component at address 3232. Peripheral device #3240 includes a PWM functional component 244 at address 6 and an associated SEEPROM with device driver code for accessing the PWM functional component at address 5242.
Note that the addressing order of the storage ROM and the associated peripheral functional component within each peripheral device is shown by way of example only. In an alternative example, the functional component of each peripheral device could be located at a first address and the relocatable device driver code in non-volatile memory at a second address thereof. The addressing organization of the peripheral functional component and relocatable device driver code within each peripheral device should be uniform, however, as explained further below. Note further that the three peripheral devices 220, 230 & 240 are shown by way of example only. The concepts disclosed herein are applicable to any number of peripheral devices of a type such as those depicted, as well as other peripheral devices such as a camera, a printer, a video capture device, a programmable gain amplifier, a game device, a video display, any human input device, any embedded application, etc. Advantageously, the peripheral interface system disclosed herein is modular in design and readily upgradeable by a customer simply by coupling additional peripheral devices (with the format described herein) to the master device via, for example, a single shared physical interface.
Microprocessor 210 includes a common, generic code which facilitates copying of relocatable device driver code into memory accessible by the master device from each of the peripheral devices coupled thereto. This common, generic code is referred to in
An address counter is reset to “1” 310, and the logic checks for a SEEPROM device (i.e., one example of non-volatile memory) having relocatable device driver code at the address specified by the counter 320 (i.e., the processor performs a read of address #1). The processor determines whether a SEEPROM is found at the current address 330, and if so copies the relocatable device driver code from the SEEPROM to a first driver ROM memory slot available at the master device 340. Note again that peripheral devices can be coupled in any order, and thus discovered in any order. Addresses are essentially assigned electromechanically as the peripheral devices are coupled together to the serial peripheral interface. Thereafter, or if a SEEPROM was not found at the current address, (e.g., the inquiry times out) the counter is incremented by 2350, and the logic determines whether it has reached the end of a specified enumeration 360 (e.g., until an arbitrary number of addresses are tested). If no, then the process repeats until the end of the enumeration is reached, after which the master device begins running the identified peripheral(s) using the copied relocatable device driver code(s).
Relocatable psuedocode is well known to one skilled in the art. For example, a simple relocatable code example is:
Since the branch back to Loop is relative to the current position (back one step) this code is relocatable. Thus, device driver code for the functional component of a peripheral device can be readily written to be relocatable by one skilled in the art, and then stored in non-volatile memory. This relocatable device driver code can use absolute addressing only for the registered address of the associated peripheral functional component of the peripheral device.
Those skilled in the art will note that presented herein is a modular peripheral interface system which allows a master device to self-configure for communication with one or more peripheral devices across, for example, a single shared physical interface, without requiring the master device to be preprogrammed with device drivers for each of the one or more peripheral devices. This is accomplished by providing each peripheral device with relocatable device driver code, meaning that the device driver code can be executed out of any location in RAM, including RAM available to the master device. The modular peripheral interface system presented does not depend upon the type of interface employed. For example, the interface may be a parallel interface or a serial interface. Further, various available physical interfaces may be utilized, including for example, a 12C serial bus, a 12S serial bus or a Motorola SPI bus. Advantageously, a simple four or six wire connector may be utilized to serially interface a master device to essentially unlimited peripheral functionality.
The capabilities of one or more aspects of the present invention can be implemented in software, firmware, hardware or some combination thereof.
One or more aspects of the present invention can be included in an article of manufacture (e.g., one or more computer program products) having, for instance, computer usable media. The media has therein, for instance, computer readable program code means or logic (e.g., instructions, code, commands, etc.) to provide and facilitate the capabilities of the present invention. The article of manufacture can be included as a part of a computer system or sold separately.
Additionally, at least one program storage device readable by a machine embodying at least one program of instructions executable by the machine to perform the capabilities of the present invention can be provided.
The flow diagrams depicted herein are just examples. There may be many variations to these diagrams or the steps (or operations) described therein without departing from the spirit of the invention. For instance, the steps may be performed in a differing order, or steps may be added, deleted or modified. All of these variations are considered a part of the claimed invention.
Although preferred embodiments have been depicted and described in detail herein, it will be apparent to those skilled in the relevant art that various modifications, additions, substitutions and the like can be made without departing from the spirit of the invention and these are therefore considered to be within the scope of the invention as defined in the following claims.