Method and device for assigning I/O address in data processing apparatus

Abstract: An I/O address assigning device in a data processing apparatus having a standard port provided in the main unit for connecting the main unit to an I/O address assigning device so as to increase the function of the data processing apparatus and an I/O connecting portion for connecting an additional board provided with an I/O port therein. The I/O address assigning device comprises a control means for disabling the I/O port in the main unit for operation in order to prevent conflict of the I/O port in the main unit and on an additional board which have the same address, a detecting means for detecting the preset I/O address of the additional I/O port in the state in which the I/O port in the main unit is disabled, and an address assigning means for assigning an I/O address different from the preset address of the additional I/O port which is detected by the detecting means to the I/O port in the main unit. When the I/O address of the standard port on the additional board which is detected by the detecting means in the state in which the standard port in the main unit is disabled is the same as the I/O address of the standard port in the main unit, an I/O address different from that of the standard port on the additional board is assigned to the standard port on the main unit.

Description: The present invention relates to a data processing apparatus and, more particularly, to a method and a device for assigning I/O address in a data processing apparatus which is capable of changing the assignment of the address to an I/O port. Printer, RS-232C, floppy disk drive (FDD), hard disk drive (HDD), etc. are connected to personal computers and the like through standard ports. Since the number of standard ports is different depending upon the demand of the user, the main unit of a personal computer is generally provided with an extension slot (I/O slot) and a standard port is added by inserting an additional board provided with a standard port into the I/O slot. Devices such as a printer are often necessary to a personal computer. Most personal computers are therefore provided with standard ports for such devices in the main unit as the standard equipments. In this case, if the standard port in the main unit and the standard port on the additional board which is inserted into the I/O slot have the same function, since the addresses of both standard ports are the same, there is a fear of both standard ports being not able to operate due to conflict. To preclude this possibility, an additional board generally has a DIP switch for setting the address of the standard port thereon, and it is possible to change the I/O address of the standard port on the additional board by operating the DIP switch, thereby preventing the conflict of both standard ports. As shown in Fig. 5, such an additional board is provided with a connecting portion 1 which is connected to the main unit, a decoder 2, a standard port 3 and a DIP switch 4. An address signal supplied from the main unit through an address bus A is input to the decoder 2. When the address signal indicates a preset value (preset address), the decoder 2 supplies a decoding signal (chip selecting signal CS ) indicating that the standard port 3 is selected to the standard port 3. The I/O address which is to be assigned to the standard port 3 is determined in accordance with the I/O device which is to be connected to the standard port 3. There are two addresses, for example, a primary address and a secondary address for one I/O device. The decoder 2 can decode either of the addresses. The DIP switch 4 is connected to the decoder 2, and the decoder 2 can select the I/O address to be decoded in response to the turning on and off of the DIP switch 4. A connector 3a connects the additional board to an external device such as a printer. When the address of the standard port 3 on the additional board is actually assigned, the DIP switch 4 is operated so as to prevent the coincidence of the address of the standard port 3 on the additional board and the address of the standard port in the main unit, thereby preventing the conflict of both standard ports. However, in setting the additional board, it is necessary for the user to refer to the manual or the like before setting the DIP switch and then to operate the DIP switch. This operation is troublesome and involves a fear of setting error. In addition, in personal computers or the like, since a new model is frequently developed, the corresponding model is sometimes not described in the manual for the additional board. In such case, it is necessary for the user to refer to the manuals for both the main unit and the additional board in order to know the addresses of the standard port in the main unit and the standard port on the additional board and to set the DIP switch so as to prevent the conflict of both standard ports. This operation is very difficult. It is therefore demanded to facilitate the operation at the time of using the additional board such as the setting of the DIP switch and to omit such operation, if possible, thereby preventing an error in setting the DIP switch. Accordingly, it is an object of the present invention to solve the above-described problems in the related art and to provide an I/O address assigning device of a data processing apparatus which obviates the operation of setting a DIP switch by the user without any trouble in using an additional board. EP-A-0350917 discloses a personal computer system in which the presence is detected of optional Read Only Memory having a start address which conflicts with the start address of existing Read Only Memory, so that the existing ROM can be reassigned to non-conflicting address space. On power-on, the existing ROM is disabled and data is read at the start address. If the readout data coincides with predetermined data which would be present at the start address of optional ROM, the presence of optional ROM is confirmed and the existing ROM assigned to a different start address in non-conflicting address space. IBM Technical Disclosure Bulletin Vol.22, No.10, March 1980 pages 4366-4368, discloses performing a Write/Read operation at the known address of an optional feature card to check that the feature card is present and functional. The present invention provides an I/O address assigning device in a data processing apparatus having a first I/O port for connecting the data processing apparatus to an I/O device, said first I/O port having an I/O address assignable from a plurality of standard I/O port addresses, and an I/O connecting portion for connecting an additional I/O port to the data processing apparatus, wherein any said additional I/O port has a preset I/O address assigned from said plurality of standard I/O addresses, and a data register to which data for said additional I/O port can be written and from which data can be read, the I/O address assigning device comprising: control means for disabling the first I/O port; detecting means for detecting the preset I/O address of an additional I/O port connected to the I/O connecting portion whilst the first I/O port is disabled, said detecting means comprising: reading and writing means for writing and then reading data at a predetermined standard I/O port address; and identity detecting means for detecting if the data read at the predetermined standard I/O port address has identity with the data written to said address, to determine whether said predetermined standard I/O port address is the preset I/O address of an additional I/O port connected to the I/O connecting portion; and assigning means for generating an address switching signal to configure the first I/O port to switch to an I/O address which is different from said preset I/O address detected by the detecting means and enabling said first I/O port. The present invention also provides a method of assigning an I/O address in a data processing apparatus having a first I/O port for connecting the data processing apparatus to an I/O device, said first I/O port having an I/O address assignable from a plurality of standard I/O port addresses, and an I/O connecting portion for connecting an additional I/O port to the data processing apparatus, wherein any said additional I/O port has a preset I/O address assigned from said plurality of standard I/O addresses, and a data register to which data for said additional I/O port can be written and from which data can be read, the method comprising the steps of: disabling the first I/O port; detecting the preset I/O address of an additional I/O port connected to the I/O connecting portion whilst the first I/O port is disabled, said detecting step comprising the steps of: writing and then reading data at a predetermined standard I/O port address; and detecting if the data read at the predetermined standard I/O port address has identity with the data written to said address, to determine whether said predetermined standard I/O port address is the preset I/O address of an additional I/O port connected to the I/O connecting portion; configuring the first I/O port to switch to an I/O address which is different from said preset I/O address detected by the detecting means; and enabling said first I/O port. Embodiments of the present invention will now be described with reference to the drawings, in which:- Fig.1 is a block diagram of the schematic structure of an embodiment of an I/O address assigning device of a data processing apparatus according to the present invention; Fig. 2 is a block diagram of the structure of the main part of a standard port in the embodiment shown in Fig. 1; Fig. 3 is a block diagram of the structure of the decoder 7 shown in Fig. 1; Fig. 4 is a flow chart of the operation of the embodiment shown in Fig. 1; and Fig. 5 is a block diagram of the schematic structure of a conventional additional board. An I/O address assigning device of a data processing apparatus according to an embodiment of the present invention will be explained hereinunder with reference to the accompanying drawings. Fig. 1 is a block diagram of the entire structure of an embodiment of the present invention. These elements are provided in the main unit. To a CPU 5 are connected an address bus A supplying an address signal of 16-bits (A0 to A15) which indicates what is to be accessed therethrough, a control bus C for supplying an operation command such as IOW, IOR, MEMR and MEMW therethrough, and a data bus supplying data of 8 bits (D0 to D7) therethrough. The I/O address assigning device in a data processing apparatus of this embodiment is provided with four I/O slots 6a to 6d into which an additional board can be inserted. Each of the address bus A, the control bus C and the data bus D is connected to these I/O slots. Since all the bits of the data bus D are pulled up by a pullup means Vp, when there is no data on the data bus D, the data bus D becomes FFH (all "1"). The address bus A is connected to the input terminal of a decoder 7. The decoder 7 outputs a decoding signal (chip selecting signal CS ) indicating that a standard port 8 is selected to the standard port 8 when the address of the address bus A reaches a predetermined value (e.g., 278H). The output terminal of the decoder 7 is connected to the input terminal of the standard port 8 in the main unit, and when the chip selecting signal CS is [L], the standard port 8 in the main unit inputs or outputs data. For this purpose, the data bus D and the control bus C are also connected to the standard port 8 in the main unit. The standard port 8 in the main unit is provided with a data register 8a to which the data bus D is connected so as to enable data reading and writing, a buffer 8b for judging whether or not the output of the register 8a is to be returned to the data bus D, an OR gate 8c for issuing a data-fetch command when a write command is issued, an OR gate 8d for allowing the buffer 8b to output data when a read command is issued, and a connector 8e for connecting the standard port 8 to an external device, as shown in Fig. 2. When the CPU 5 issues a write command to the standard port 8 in the main unit, the value of the address bus A reaches the address of the standard port 8 in the main unit and the chip selecting signal CS from the decoder 7 becomes [L]. Since the signal IOW from the control bus C becomes [L] in accordance with the write command, the OR gate 8c outputs [L] and the register 8a fetches the data from the data bus D. On the other hand, when the CPU 5 issues a read command to the standard port 8 in the main unit, the chip selecting signal CS from the decoder 7 becomes [L] as in the case of the write command. Since the signal IOR from the control bus C becomes [L] in accordance with the read command, the OR gate 8d outputs [L]. The buffer 8b is allowed to output data, and the output of the register 8a is supplied to the data bus D. In this way, the CPU 5 can both write desired data into the register 8a of the standard port 8 in the main unit and read the data from the register 8a. The structure of an additional standard port provided on an additional board is the same as the standard port 8 in the main unit shown in Fig. 2. This embodiment is provided with a decoder 9, an OR gate 10 and an address switching register 11 of 2 bits. The address bus A is connected to the input terminal of the decoder 9 and when the value of the address bus A reaches a predetermined value, the decoder 9 outputs [L]. The output of the decoder 9 is input to the OR gate 10 together with the signal IOW from the control bus C. The address switching register 11 is composed of two flip-flops, namely, an enable bit 11a and an address select bit 11b. The output of the OR gate 10 is input to the clock input terminals of the two flip-flops 11a, 11b, and 2 bits (D0, D1) of the data bus D are connected to the data input terminals of the enable bit 11a and the address select bit 11b, respectively. When the CPU 5 issues a write command while addressing the address switching register 11, the decoder 9 outputs [L]. The signal IOW from the control bus C becomes [L] in accordance with the write command, and the output of the OR gate 10 also becomes [L]. Therefore, the data of the buses D0 and D1 are fetched into the enable bit 11a and the address select bit 11b, respectively, of the address switching register 11. The outputs of the enable bit 11a and the address select bit 11b of the address switching register 11 are supplied to the decoder 7 as an enabling signal and an address selecting signal, respectively. The decoder 7 has a gate on the output side which does not output [L] unless the enabling signal is [L]. In other words, it is possible to so control the decoder 7 as to write/read data into/from the standard port 8 in the main unit in correspondence with the data stored in the enable bit 11a. The decoder 7 has a gate on the input side which outputs [L] as the chip selecting signal CS at a primary address (e.g., [278H]) when the address selecting signal of the address switching register 11 is [H] and outputs [L] as the chip selecting signal CS at a secondary address (e.g., [378H]) when the address selecting signal of the address switching register 11 is [L]. It is therefore possible to change the I/O address at which [L] is output as the chip selecting signal CS from the decoder 7 by the data which is stored in the address select bit 11b. The concrete structure of the decoder 7 is shown in Fig. 3. The decoder 7 is composed of a NAND gate 7a for decoding the primary address, a NAND gate 7b for decoding the secondary address, an AND gate 7c and an OR gate 7d. The address on the address bus A and the address selecting signal from the address select bit 11b of the address switching register 11 are supplied to the NAND gate 7a, while the address on the address bus A and the address selecting signal from the address select bit 11b of the address switching register 11 are supplied to the NAND gate 7b in the inverted form. Therefore, when the address on the address bus A is the primary address and the address selecting signal is [H], the NAND gate 7a outputs [L]. On the other hand, when the address on the address bus A is the secondary address and the address selecting signal is [L], the NAND gate 7b outputs [L]. In the other cases, both NAND gates 7a, 7b output [H]. The outputs of the NAND gates 7a, 7b are input to the AND gate 7c. Therefore, when the output of either of the NAND gates 7a, 7b is [L], the AND gate 7c outputs [L]. To the OR gate 7d are supplied the output of the AND gate 7c and the enable signal from the enable bit 11a of the address switching register 11. Therefore, only when the enable signal is [L] and the output of the AND gate 7c is [L], [L] is output as the chip selecting signal CS . In this way, the above-described operation is achieved. The operation of this embodiment will now be explained with reference to Fig. 4. In this embodiment, an I/O address assigning device for a printer is adopted as the I/O address assigning device. When the power source is turned on, data (e.g., "0") for disabling the standard port 8 in the main unit for operation is first written into the enable bit 11a of the address switching register 11 (S1). The CPU 5 writes predetermined data (other than FFH) at the address (primary address) of the standard port for a printer which is ordinarily used (S2). The data is read from the standard port at the address at which the data is written (S3), and judgement is made as to whether or not the data read out is [FFH] (all "1") (S4). The access to the standard port 8 in the main board is inhibited at S1. Since the data bus D is pulled up by the pullup means Vp, the data read out is [FFH] unless an additional board provided with a standard port to which the primary address is assigned is inserted into any of the I/O slots 6a to 6d. If the additional board provided with a standard port is inserted into the I/O slot, the data written at S2 is read out. If the answer is [Y] at S4, data (e.g., "1") for designating the primary address is written in the address select bit 11b of the address switching register 11 (S5). On the other hand, if the answer is [N] at S4, it means that the standard port having the primary address is set as an additional board, so that data (e.g., "0") for designating the secondary address is written into the address select bit 11b (S6). Data for designating an enabling process is then written into the enable bit 11a of the address switching register 11, thereby allowing the decoder 7 to output data (S7). As described above, if there is no additional board provided with a standard port having the same address as the primary address of the standard port 8 in the main unit, the address of the standard port 8 in the main unit is set at the primary address. On the other hand, if there is an additional board provided with a standard port having the same address as the primary address of the standard port 8 in the main unit, the address of the standard port 8 in the main unit is set at the secondary address. Accordingly, it is possible to prevent the conflict of the standard port on the additional board and the standard port 8 in the main unit without the need for setting a DIP switch of the additional board by the user. In this embodiment, the address select bit 11b has 1 bit and two kinds of addresses are switched over to each other, but it is possible to increase the number of addresses switched by increasing the number of bits of the address select bit 11b. Although the standard port in this embodiment is for a printer, it may be an I/O address assigning device for an external FDD (floppy disk drive), an RS-232C (an interface for transmitting serial data) or the like. As described above, according to an I/O address assigning device of a data processing apparatus of this embodiment of the present invention, it is possible not only to inhibit the access to the I/O port in the apparatus but also to automatically change the assignment of the I/O address. That is, it is possible to identify the address of another I/O port added thereto and set the address of the original I/O port at an address which prevents conflict of both I/O ports. It is thus possible to obviate the operation of setting an DIP switch of the additional board by the user.

Claims: An I/O address assigning device in a data processing apparatus having a first I/O port (8) for connecting the data processing apparatus to an I/O device, said first I/O port (8) having an I/O address assignable from a plurality of standard I/O port addresses, and an I/O connecting portion (6a,6b,6c,6d) for connecting an additional I/O port (3) to the data processing apparatus, wherein any said additional I/O port (3) has a preset I/O address assigned from said plurality of standard I/O addresses, and a data register (8a) to which data for said additional I/O port (3) can be written and from which data can be read, the I/O address assigning device comprising: control means (lla,7d) for disabling the first I/O port (8); detecting means (5) for detecting the preset I/O address of an additional I/O port (3) connected to the I/O connecting portion (6a,6b,6c,6d) whilst the first I/O port (8) is disabled, said detecting means comprising: reading and writing means (5,8a,8b,8c,8d) for writing and then reading data at a predetermined standard I/O port address; and identity detecting means (5) for detecting if the data read at the predetermined standard I/O port address has identity with the data written to said address, to determine whether said predetermined standard I/O port address is the preset I/O address of an additional I/O port (3) connected to the I/O connecting portion (6a,6b,6c,6d); and assigning means (7,9,10,11b) for generating an address switching signal to configure the first I/O port (8) to switch to an I/O address which is different from said preset I/O address detected by the detecting means (5) and enabling said first I/O port (8). An I/O address assigning device according to Claim 1, wherein the control means (lla,7d) comprises: (a) a disabled state register (11a) in which data designating a disabled state is set; and (b) means (7d) for disabling a chip selecting signal to be supplied to the first I/O port (8) in accordance with the output of the disabled state register (11a). An I/O address assigning device according to either one of Claims 1 or 2, wherein the assigning means (7,9,10,11b) comprises: (a) an I/O address register (11b) in which information about which of the plurality of I/O addresses is selected is set; and (b) an address decoder (7) for receiving an address signal and outputting a chip selecting signal to the first I/O port (8) when the input address is an I/O address which corresponds to the information set in the I/O address register (11b). An I/O address assigning device according to any preceding claim, wherein the control means (11a,7d), the detecting means (5) and the assigning means (7,9,10,11b) are started when a power source for the data processing apparatus is turned on. An I/O address assigning device according to any preceding claim, wherein the assigning means (7,9,10,11b) assigns said predetermined standard I/O port address to the first I/O port (8) when said identity is not detected by the identity detecting means (5). A method of assigning an I/O address in a data processing apparatus having a first I/O port (8) for connecting the data processing apparatus to an I/O device, said first I/O port (8) having an I/O address assignable from a plurality of standard I/O port addresses, and an I/O connecting portion (6a,6b,6c,6d) for connecting an additional I/O port (3) to the data processing apparatus, wherein any said additional I/O port (3) has a preset I/O address assigned from said plurality of standard I/O addresses, and a data register (8a) to which data for said additional I/O port (3) can be written and from which data can be read, the method comprising the steps of: disabling the first I/O port (8); detecting the preset I/O address of an additional I/O port (3) connected to the I/O connecting portion (6a,6b,6c,6d) whilst the first I/O port (8) is disabled, said detecting step comprising the steps of: writing and then reading data at a predetermined standard I/O port address; and detecting if the data read at the predetermined standard I/O port address has identity with the data written to said address, to determine whether said predetermined standard I/O port address is the preset I/O address of an additional I/O port (3) connected to the I/O connecting portion (6a,6b,6c,6d); configuring the first I/O port (8) to switch to an I/O address which is different from said preset I/O address detected by the detecting means (5); and enabling said first I/O port (8).

Inventors: KIMURA MINORU, KIMURA, MINORU
Applicants: SANYO ELECTRIC CO, SANYO ELECTRIC CO., LIMITED.
Application year: 1991
Main classification: G06F12
IPC codes: G06F12, G06F13