SERIAL BUS SYSTEM

Abstract: A serial bus system in which frames are sent from a central station to a plurality of substations over a first conduc­ tor (TxD) and information is sent from the substation to the central station over a second conductor (RxD). Each transmit­ ted frame contains bits identifying whether it is for address, data or a command. An addressed substation sends a hand­ shake back to the central station by changing the logic level of the second conductor. An address frame contains a bit in­ dicating whether a message is to be written into a register of a substation or read from a register therein. Any substation can interrupt to request service from the central station by chang­ ing the logic level of the second conductor if the last command on the first conductor is an UNADDRESS command indicating the end of a message.

Description: The invention relates to a serial bus system in accordance with the precharacterizing part of claim 1. Such a serial bus system is known from Harold C. Folts (Ed.), McGraw-Hills Compilation of Data Communication Standards, Edition II, 1982. A number of situations exist where it is desired to provide communication between a computer controlled central station and a plurality of substations. If speed is required, the communication is usually provided by a parallel bus in which each bit of a frame in a message is conveyed from the central station to a substation by a separate conductor; but if there is sufficient time, the expense of isolation means can be avoided by using a serial bus in which the bits of each frame are conveyed in sequence via a single conductor. A number of serial bus systems are known, e.g., the RS232C industry standarad and modifications thereof. They often require constant polling of the substations so that asynchronous operation in which any substation can request servicing by the central station is not available. Furthermore, in some systems the substations are not able to acknowledge the receipt of data or to give an indication to the central station of its accuracy. Fig. 3 on page 726 of the above cited McGraw-Hills Compilation of Data Communication Standards shows a link configuration for point-to-point and multi-point operation. In order to set up the link, a multiple of specified messages such as depicted in Fig. 2 on page 725 of this document are communicated from the primary station to one or more secondary stations and from one secondary station at a time back to the primary station. The communication procedures are relatively complicated and may have advantageous effects only for high-level data link control (HDLC). The time-out considerations described in item 3.4.2.5 on page 727 function to detect a no-reply or lost-reply condition, wherein the primary and the secondary stations have specific time-out functions. Electronic Engineering, vol. 55, No 675, March 1983, London, GB; D. Ledamun:"Exploring the possibilities of the 1553 B data bus" discloses a synchronous data transmission system. Therefore, the word formats depicted in Fig. 1 on page 147 of this document include a synchronizing sequence. Page 148, left column, 4. paragraph describes a specific communication procedure, namely a wrap-around technique, whereby a message is sent to the terminal in question by the bus controller and this message is retransmitted using either the original bus or a second bus in a dual redundand system. The components shown in the Fig. 2 and 3 on page 148 of this document can be combined to various system configurations, wherein control of data traffic on the bus is in strict correspondence to the rules specified in MIL-ST 1553 B. The link configuration indicated in the Fig. 4 and 5 on page 150 of this document differs from the link configuration and one-way communication type described in the above cited McGraw-Hill's Compilation of Data Communication Standards because each bus line in the system described in Electronic Engineering is used for a two-way communication. A further known document M 68 00 Application Manual, Motorola Inc., 1975, Switzerland, pages 3-21 to 3-37 describes the application of Motorolas ACIA in a MC 68 60-modem system. The communication method requires hand-shaking procedures as described in section 3-4.3.3 on page 3-34 and usual communication standards of public and private communication systems. The object of the invention is to provide a bus system of simple design which allows asynchronous operation, the acknowledge of data receipt and accuracy indication. This object is met by the invention which is, according to claim 1, characterized by each of said processors for said substations programmed to respond to a frame on said first conductor that represents its address by changing the logic level of said second conductor after receipt of each of the address frame, a subsequent data frame and certain command frames for a predetermined period of time, said period of time corresponding to one of two predetermined numbers of bit lengths according to a correct or incorrect receipt of each frame. Further advantageous developments are specified in the dependant claims 2 to 6. In accordance with this invention, a microprocessor is provided for the central station that communicates with the computer controlling the central station via a number of registers. The microprocessor in the central station also communicates with a microprocessor in each substation. The latter microprocessors control their respective substations. Information being sent from the central station to a substation is conveyed in a one-way communication by the first conductor, hereinafter called "TxD", and information being sent from any substation to the central station is conveyed in a one-way communication by the separate second conductor, hereinafter called "RxD". The registers include a STATUS register, which has bits indicating an in-transmission error when a timely handshake has not been received, when an interrupt request has been received from by one of the substations and the fact that the microprocessor for the central station is busy; a COMMAND register having a bit indicating whether the command is for all stations or only one station, the address of the latter station and the command itself: an ADDRESS register that includes the address of the station, the register therein with which the communication is to occur and a R/W bit indicating whether data is to be written into that register or read from it; a WR DATA register containing ... data that is to be conveyed to the substation; and a RD DATA register into which data read from a substation is to be temporarily stored. The protocol by which the system operates can be best explained with the aid of the following examples. If the computer desires to send data to one of the substations, it loads the ADDRESS register with the address of the station, an identification of the register therein that is to be written into, and sets the R/W bit at the required logic level. In addition, it informs the microprocessor for the central station, hereinafter referred to as a "µPC", that the ADDRESS register has just been loaded and sets the BSY flag in the STATUS register. The µPC forms an ADDRESS frame including the bits read from the ADDRESS register, two bits, hereinafter called a "transaction code", that identifies the frame as being one containing an address, a parity bit, a most significant bit known as a START bit and a least significant bit known as a STOP bit. The bits of the frame, starting with the most significant, are serially placed on the conductor TxD. The inputs of the microprocessors for the substations, which microprocessors are hereinafter indicated by µPS and a suitable subscript, are always coupled to TxD. When the START bit appears on TxD, the logic state of TxD is changed, thereby indicating to all µPS microprocessors that a message is about to be placed on TxD by the µPC. The next two bits, the transaction code, inform the substations that the byte of data immediately following them represents an address. The next bit indicates the parity of the frame as a whole and the STOP bit restores TxD to its original logic level. In addition to cooperation with the µPC in respect to the write and read communications it controls, each of the substation microprocessors µPS monitors its own substation to see if it desires service from the central station. When the START bit just referred to appears on TxD, all of the station microprocessors disable their interrupt procedures. Each of the substation microprocessors reads the address on TxD and, if it is the address of its substation, checks the parity of the entire frame and sends a handshake frame back to the µPC of the central station by changing the logic level of RxD. If the parity checks, the logic level is changed for a predetermined time, such as two bits. If, however, parity does not check, the logic level is changed for a different predetermined time, e.g., one bit. If parity does not check, the µPC may retransmit the frame at least one time, but if parity still does not check, the µPC sets an error flag in the interface STATUS register so as to inform the computer of the fact. If the logic level of the RxD line is not changed within a predetermined time after the STOP bit has restored TxD to its original logic level, the µPC sets a time out flag in the STATUS register so as to inform the computer. After the ADDRESS frame is sent, the computer loads WR DATA register and the µPC sends a frame on TxD including the data, the transaction code for data, the parity bit and the START, STOP bits. The microprocessor µPS for the addressed substation performs the handshake as just described. In the programs for this particular embodiment of the invention, only one byte of data is transmitted in any given message, but any number could be sent, in which event the handshake procedure would follow each. After the last DATA frame is transmitted on TxD, the µPC sends an UNADDRESS command on TxD to the substations. The µPC includes the bits for this command in a frame that also has the transaction code for a command, the PARITY bit, the START, STOP bits and a bit indicating whether the command is for all substations or for a designated station. In the latter circumstance, the address of the station is also included. The UNADDRESS command is universal, i.e., it is for all substations and informs them that the communication is over. Should the computer desire to read data from a particular register in a given substation, it sets the R/W bit in the ADDRESS register at a different logic level. Seeing this, the µPS for the addressed substation reads the data from the designated register and places it on the RxD line with PARITY, START and STOP bits. The data is stored in the RD DATA register which has been designated by signals from the computer to the µPC. The presence of the data on RxD makes it unnecessary for the µPS to perform a handshake for the read address. If no data is received by the µPC in a predetermined time, the µPC sets the time-out flag in the STATUS register. If there is a parity error, the µPC requests the µPS to retransmit the data. After a given number of erroneous transmissions, the µPC sets the error flag in the STATUS register. After all data bytes have been received, the µPC places an UNADDRESS command on TxD. This informs all substations that the communication is over. As previously noted, the serial bus system of this invention has the capability of permitting any substation to request service from the computer. When the µPS detects that its substation desires to interrupt the computer, it signifies the fact by changing the logic level of RxD from its quiescent value, but it does this only when the last frame received was an UNADDRESS command. This is necessary as the change in logic level of RxD for the purpose of interruption might be confused with the change in level for a handshake. When RxD changes level, the µPC knows that some substation has requested an interrupt but does not know which one. To determine this, it polls the µPS for each substation by reading the substation STATUS register for each µPS to see if its interrupt flag is set and the kind of interrupt requested. The various features and advantages of the present invention may be more readily understood with reference to the following detailed description taken in conjunction with the accompanying drawings, in which: Fig. 1 is a block diagram of a system incorporating this invention; Fig. 1A illustrates the registers of a microprocessor for the computer that are used in a serial bus system of this invention; Fig. 2 illustrates a frame hat is transmitted on the serial bus; Fig. 3 illustrates the code used to identify a frame; Fig. 4 illustrates the handshaking procedure in the particular embodiment of the invention described herein in which a message has only one data frame; Fig. 5 illustrates the handshaking procedure that would occur in an embodiment of the invention where a message has more than one data frame. In the block diagram of Fig. 1, a computer C is interfaced with a microprocessor µPC via registers that are respectively for STATUS, COMMAND, ADDRESS, WR-DATA (data to be written), and RD DATA (data read). A conductor TxD carries frames of bits from the microprocessor µPC of a central station to each of the microprocessors µPS₁, µPS₂, µPS₃, and µPS₄ for the substations S₁, S₂, S₃ and S₄; and a conductor RxD carries frames of bits to the microprocessor µPC from the microprocessors µPS₁, µPS₂, µPS₃ and µPS₄. The manner in which the microprocessor µPC transmits a message to one of the various substations is now explained by reference to a flow chart F T which is presented in written form rather than in block form. The µPC is type 8048 family, and the program for carrying out the steps is set forth in a program P T infra. When the computer C has data to send to one of the substations S₁, S₂, S₃ or S₄, it sets the most significant bit of the ADDRESS register low so as to indicate that the data is to be transmitted; loads the next three bits A₂, A₁ and A₀ with the address of the station to which the data is to go; and loads the next four bits, R₃, R₂, R₁ and R₀ with an identification of the register of the substation into which the data is to be written. As indicated at lines 20 and 21 of the flow chart F T , the µPC determines that the ADDRESS register is the one to be read. The procedure then goes to line 33. The contents of the interface ADDRESS register are read into a register in the µPC (line 34), the parity error counter is initialized (line 35), and the transaction code 1,0 of Fig. 3 corresponding to an address frame is generated and added to the register in locations TR1 and TR0 of a frame shown in Fig. 2. The R/W bit in the interface ADDRESS register is checked (line 37). In this case, the R/W bit is low so as to indicate that data is to be transmitted. The frame parity bit is then calculated (line 40), and an address frame such as shown in Fig. 2 is sent over the conductor TxD. The frame includes a most significant START bit that is low and a least significant STOP bit that is high, the normal logic level of TxD being high. At this point (line 42), the µPC waits for a handshake from the addressed station and performs the following functions (lines 42-47). As will be explained in connection with the operation of a substation microprocessor, that microprocessor will change the logic level of the conductor RxD from high to low to acknowledge the receipt of a frame. If parity is proper, it holds RxD low for the duration of two bits; but if parity is not proper, RxD is held low for one bit and the µPC retransmits the frame once more. If this transmission is not successful, the µPC sets the error flag in the STATUS register. Similarly, if the RxD line does not go low within a given time after the STOP bit of the address frame, the time-out flag T0 is set in the status register. The sequences of events just described are illustrated in Fig. 4. After the address frame, RxD is low for two bits indicating that the address has been properly received so that the data frame can be placed on the conductor TxD. But after the data frame has been placed on the conductor TxD by µPC, the conductor RxD goes low for only one bit indicating that the parity of the data received by the substation is not the same as the parity of the data transmitted so that µPC retransmits the data. With the particular program P T , only one data frame is permitted in a message so that the next frame is an UNADDRESS command. Fig. 5 illustrates the handshaking procedure in a system wherein a number of data frames may be transmitted in a message. Assuming that the transmission of the address is followed by a handshake, indicating that the station has properly received the address, the computer C then loads data into the WR DATA interface register of Fig. 1A. As before, the µPC identifies that the WR DATA register has been loaded (lines 20 and 21) and proceeds to line 65. It places the data in a register (line 66), sets the TR1 and TR0 bits of Fig. 2 to "1,1" respectively so as to indicate that the frame contains data (line 67). The µPC then calculates the frame parity bit (line 68). At this point, the data frame is sent on TxD and the µPC waits for the handshake from the station microprocessor as it did following the address frame. As presently implemented, the serial bus comprised of TxD and RxD can only send one data frame at a time, but there is no reason why it could not send more as illustrated in Fig. 5. When the last data frame is sent and properly received, or if retransmission has been unsuccessful, as indicated by setting the error flag in the STATUS register, the µPC sends an UNADDRESS command on TxD to all the substations. In the event that the computer C is to read from a register in a substation, it loads the ADDRESS register of the interface with the most significant bit R/W set high. After the microprocessor for the station having the data to be read sends this data on the RxD line indicating that the address has been properly received, the µPC loads the data in the RD DATA interface register for the computer C to read (line 57). The operation of the microprocessors µPS₁, µPS₂, µPS₃ and µPS₄ for the stations S₁, S₂, S₃ and S₄ respectively is now explained by reference to the flow chart F S which is in language rather than block form. The program for carrying out the various kinds of steps in F S with a microprocessor of the 8048 family is as set forth in the program listing P S . The initialization procedure for the µPS is set forth in lines 38-52. In line 57, the substation microprocessor µPS examines its station to see if it is requesting an interrupt. If it is, it initiates the part of the program P S that handles the interrupt service (lines 356-358). Line 357 checks that the substation is permitted to request an interrupt as previously described including checking for UNADDRESS. All of the substation microprocessors monitor the TxD line. When a frame is placed thereon by the µPC, the transaction code bits are examined so as to determine the type of frame (lines 97-103) and the appropriate section of the program P S is started. If, as previously described, the microprocessor µPC for the computer has placed an address frame on TxD line (line 100) sets in motion the address routine, the functions of which are set forth starting at line 107. Because the line TxD is in use, as evidenced by a frame being on it, all station microprocessors disable their interrupt procedures (line 108). Then they read the address (line 109) that is on TxD. If the address is not that of a station, it updates certain flags and returns to line 57 where it checks to see if its station needs servicing by the computer C. If a station sees its own address on TxD, its microprocessor examines the R/W bit. If it is high, so as to indicate that the microprocessor µPC for the computer wishes to read from it, it inputs what is in the register to be read (line 120), calculates the parity (line 121), and sends the data to the µPC via the RxD line. Should the R/W bit be low, indicating that data is to be written into a register identified in the frame, the number of the register is stored (line 126), the handshake procedure previously described is initiated (line 127), and the substation microprocessor returns to line 57. When examination of the transaction code by a station microprocessor indicates that the frame is for a command, the procedure goes to line 132. The U/S bit is examined (line 133) and if it is high, the command is universal, i.e., it is for all stations, and the functions of lines 137-161 are carried out. One of the universal commands is the UNADDRESS command that follows the data sent by the µPC so as to indicate that the particular transmission is completed. In this case, the procedure of lines 148-153 is followed in which the station microprocessor sets a flag indicating the end of the transmission. There is no handshake following a universal command. However, when the U/S bit is low, the command is for a specific substation and the procedure goes to line 162. The substation address is read (line 163) and examined (lines 164 and 165) to see if this substation is the one to which the command is sent. If it is not, the procedure returns to line 57. If it is, the steps of lines 167-193 are carried out. If the transaction code indicates that the frame on TxD is for data (line 102), the procedure goes to line 200. In line 201 it outputs the data to the designated register and provides a handshake as previously described (line 202).

Claims: A serial bus system comprising a central station and a plurality of substations (S₁ - S₄), each of said stations having its own processor (µPC, µPS₁ - µPS₄) and each of said processors having an input and an output, a first conductor (TxD) forming a single path for one-way communication between the output of the processor (µPC) for said central station and the inputs of the processors (µPS₁ - µPS₄) for said substations (S₁ - S₄), a second conductor (RxD) forming a single path for one-way communication in the opposite direction between the outputs of the processors (µPS₁ - µPS₄) for said substations (S₁ - S₄) and the input of the processor (µPC) for said central station, the processor (µPC) for said central station being programmed to form a frame including the bits contained in a selected register, and to place the bits of said frame onto said first conductor (TxD) in series, the said frames having additional bits forming a transaction code identifying whether the frame is an address, data or a command, characterized in that each of said processors (µPS₁ - µPS₄) for said substations (S₁ - S₄) is programmed to respond to a frame on said first conductor (TxD) that represents its address by changing the logic level of said second conductor (TxD) after receipt of each of the address frame, a subsequent data frame and certain command frames for a predetermined period of time, said period of time corresponding to one of two predetermined numbers of bit lengths according to a correct or incorrect receipt of each frame. A serial bus system as set forth in claim 1 wherein the processor (µPC) for said central station inserts a bit (R/W) in a frame for an address indicating whether data (WA or RD) is to be sent to a substation (S₁ - S₄) or read from it, and wherein each processor (µPS₁ - µPS₄) for said substations (S₁ - S₄) is programmed to receive data if the bit has one logic level and to read from a register therein and place information so read onto said second conductor (RxD) if the bit has the other logic level. A serial bus system as set forth in claim 1 wherein the processor (µPC) for said central station inserts a parity bit into each frame and wherein the processors (µPS₁ - µPS₄) for the substations (S₁ - S₄) are programmed to check the parity of a frame on the first conductor if that station is addressed and to place bits on said second conductor (RxD) according to said logic level change of respectively predetermined time period indicating whether or not the parity of a frame just received agrees with the parity bit inserted by the central station. A serial bus system as set forth in claim 3 wherein the processor (µPC) for the central station is programmed to retransmit a frame on said first conductor (TxD) if the parity indicating bits are such that the parity of the frame received by the substation (S₁ - S₄) is incorrect. A serial bus system as set forth in claim 1 wherein the processors (µPS₁ - µPS₄) for said substations (S₁ - S₄) are programmed to determine whether their stations are requesting service from the central station and for changing the logic level of said second conductor (RxD) if such a request is present and if said first conductor (TxD) is free for communication. A serial bus system according to claim 1 or 5, wherein after a last data frame of a message the processor (µPC) of the central station is programmed to transmit a specific end command (UNADDR.) informing all substations that the particular communication is over via the first conductor (TxD), and wherein each substation is permitted to request service from the central station only after receipt of said specific end command (UNADDR.).

Inventors: BLIEK, GENEVIEVE M., LUEHMAN, KENT W.
Applicants: HEWLETT-PACKARD COMPANY
Application year: 1986
Main classification: G06F13
IPC codes: G06F13