Control equipment with communication apparatus

A control equipment with a built-in communication apparatus is provided which realizes a delay required for communication without a software intervention while at the same time reducing a load of the communication processing. The control equipment with a communication apparatus includes: a communication device to communicate with a plurality of destinations; and a decision device to determine a mode requiring a reception completion interrupt and a mode not requiring the reception completion interrupt. If the decision device decides that the reception completion interrupt is not necessary, the communication device transmits data to one or more destinations and also virtually transmits data to a second destination different from the first intended destination.

BACKGROUND OF THE INVENTION

The present invention relates to a control equipment to control an actuator based on external states transmitted from sensors through a network, and more particularly to a control equipment with a communication apparatus between microcomputers built into the control equipment and peripheral ICs.

An automotive engine control equipment controls an amount of fuel supply and fuel injection timings according to input signals such as a crank angle sensor signal. The engine control, as it becomes more sophisticated in function, is required to be performed using a growing number of pieces of information, which means that the number of input/output signals is increasing. An engine control equipment with built-in microcomputers is provided with a limited number of input/output signals because of cost limitations. Therefore if the number of input/output signals required to be handled is greater than that of the microcomputer itself, it is common practice in recent years to control the output by the microcomputer communicating with peripheral ICs. Further, associated laws and regulations in recent years require that the control equipment be provided with a diagnostic function. So, the control equipment has come to communicate with these ICs, that have their own diagnostic functions, to obtain diagnostic information. With the above configuration of the control equipment, the likelihood of the communication processing influencing software load has increased. JP-A-6-261099 discloses a configuration that aims to reduce the load of the communication processing by switching between a mode requiring a communication interrupt and a mode not requiring it. As to a communication protocol, some control equipments use SPI (Serial Peripheral Interface) protocol (U.S. Pat. No. 6,880,530 B2 and U.S. Pat. No. 6,684,862 B2). The SPI communication is a master-slave type serial communication protocol characterized in that master and slave data are exchanged in synchronism with clock.

The control equipment described in JP-A-6-261099 normally operates in a mode not requiring the communication interrupt and, during a large-volume data communication, switches to a mode requiring the communication interrupt. At the end of the communication the control equipment returns to the mode not requiring the communication interrupt. This configuration has a drawback that, when the communication in a mode requiring the interrupt occurs in succession, unnecessary switching takes place. Further, in communicating with a plurality of destinations, the control equipment produces an interrupt to execute reception processing before establishing communication with a different destination. This requires an interrupt to be produced each time the communication destination is changed.

SUMMARY OF THE INVENTION

To solve these problems, the present invention provides a control equipment with the following configuration.

The control equipment comprises a communication means to communicate with a plurality of communication destination devices; and a decision means to determine a mode requiring a reception interrupt and a mode not requiring the reception interrupt; wherein, if the decision means decides that the reception interrupt is not necessary, transmission data is sent to one or more communication destination devices and at the same time is also virtually sent to a second communication destination device different from the first one.

With this invention the load of the communication processing can be reduced and at the same time a communication delay based on hardware restrictions can be generated without intervention of software.

DESCRIPTION OF THE EMBODIMENTS

A control equipment with a built-in communication function that can reduce the load of communication processing without changing the hardware configuration by making improvements on software is realized.

FIG. 1shows a configuration of the control equipment. The control equipment1is connected with a sensor2and an actuator3and also connected through a network4to other control equipment5. Two or more sets of sensor2, actuator3, network4and other control equipment5may be provided. The control equipment1includes a microcomputer-A11, a microcomputer-B6, IC_A7, IC_B8, IC_C9and IC_D10. Further, although ports are shown to connect to a virtual_A71and a virtual_B72, the virtual_A71and virtual_B72do not physically exist. The microcomputer-A11has a memory111, a CPU112and a peripheral module113. Through the peripheral module113the microcomputer-A11is connected to the network4, sensor2, actuator3, microcomputer-B6, IC_A7, IC_B8, IC_C9and IC_D10. The memory111has an application program1111, a device driver1112and an OS1113. For the SPI communication, the device driver1112has a mode switching process11121, an interrupt-not-required mode process11122and an interrupt mode process11123.

FIG. 2is a functional diagram associated with an SPI communication software unit of the device driver1112of the microcomputer-A11. The device driver comprises communication software and an SPI driver. An application program hands a request to the communication software. The communication software, according to the request given, identifies the device to communicate with, from among the microcomputer-B, IC_A7, IC_B8, IC_C9and IC_D10, and then communicates with the identified device. The peripheral module SPI_A11131is connected to the microcomputer-B6, the peripheral module SPI_B11132is connected to the IC_A7, IC_B8and virtual_A71, and the peripheral module SPI_C11133is connected to the IC_C9, IC_D10and virtual_B72. The virtual_A71and virtual_B72do not exist physically.

FIG. 3shows a flow of processing for transmission to the microcomputer-B6. When the application program issues a request in the form of an event201using a transmission start function, the communication software registers the request with a job queue. The job registered with the job queue is processed by the SPI driver to start the transmission process corresponding to the job name.FIGS. 6A and 6Bshow a job-function correspondence table111213. A transmission function corresponding to the job MiB1112137is Send Microcomputer-B, which sets data C0-C7and a transmission destination and then starts transmission. When the transmission is complete, a transmission completion interrupt starts an SPI driver interrupt handler, which in turn starts an Rx Microcomputer-B that executes a reception operation for the job MiB. At event202the similar processing to that of event201is executed, with C8to C15set as the transmission data. In the figure, “McrB” represents the microcomputer-B.

FIG. 4shows a flow of communication that requires switching between the interrupt-not-required mode and the interrupt mode. An initial state is an interrupt mode. At event203a transmission buffer is set with d0to d3as transmission data and with virtual_A, IC_A and IC_B as destinations. At event204, an interrupt-not-required mode start function causes indices 0 to 3 of the transmission buffer to be transmitted repetitively. At event205there is a request to set the value of signal SigA to 1. A data setting function sets data d4using the SigA value of 1. At event206, when there is a request for diagnostic, Job Diagnostic1is set in the job queue. An SPI job registration function switches the mode from the interrupt-not-required mode to the interrupt mode and starts Send Diagnostic1, the transmission function for the registered Job Diagnostic1. The Send Diagnostic1sets transmission data e0-e30with virtual_A, IC_A and IC_B as destinations, as shown in Table2inFIG. 7B. IC_A and IC_B are required to have their communications separated more than a predetermined delay time apart. In this embodiment, the delay time is assumed to be able to be created by using two transmission durations. Here, the first two transmissions are set with virtual_A as the destination and the third transmission is set with a destination of IC_A. The reason that two transmissions in which IC_A does not receive are provided is that if the previous communication has ended with the transmission to IC_A and if a new transmission is immediately initiated to the same IC_A, the required delay time fails to be secured.

Although at event208there is an entry of a separate Job Diagnostic2, since Job Diagnostic1is currently being transmitted, the transmission of Job Diagnostic2is not initiated at this timing. After the reception operation of Job Diagnostic1is finished, Job Diagnostic1is taken out of the job queue and the next Job Diagnostic2is processed. At this time, the transmission operation for Job Diagnostic2is started to set and transmit data e32-e37. At the end of the transmission, the SPI driver starts the reception operation for Job Diagnostic2. With Job Diagnostic2completed, the mode changes to the interrupt-not-required mode as there are no requested jobs. In this mode, the indices 0-3 of the transmission buffer are repetitively transmitted as described before. At event207, there is a request to set the value of signal SigB to 1, so data d5that causes the signal SigB value to become 1 is set. At event211there is a request to set the value of SigA to 0, so data d6that causes the SigA value to become 0 is set.

As described above, in the interrupt-not-required mode since a completion interrupt is prevented by hardware repetitively transmitting data, unnecessary reception operation is not started. Further, a delay can be generated by hardware transmitting the data to a virtual device, thus reducing the load of software. Also, when it is desired to change the transmission data, it can be done simply by changing the transmission data in the transmission buffer. When it is desired to cancel the transmission to IC_A, this can be done by changing the destination from IC_A to a virtual device. The transmission buffer used in the interrupt mode avoids a buffer area used by the interrupt-not-required mode. This allows the data, which is to be transmitted in the interrupt-not-required mode, to be updated irrespective of the mode, even during the interrupt mode, as with event207and event211. In the figure, V_A represents Virtual_A; I_A represents IC_A; and I_B represents IC_B.

FIGS. 5A and 5Bshow functions and data provided by the SPI driver. The mode switching process11121comprises an interrupt-not-required mode start111211, an SPI job registration111212, a job function correspondence table111213, and a job queue111214. The interrupt-not-required mode process11122comprises a data set111221, a data read111222, and a command set111223. The interrupt mode process11123comprises a data set table111231, a data read table111232, an interrupt mode transmission start111233, and an interrupt operation111234.

FIGS. 7A and 7Bshow tables to update the transmission buffer. Table1(FIG. 7A) represents the content of a table used by event203ofFIG. 4. Table2(FIG. 7B) represents the content of a table used by event206. Looking at the transmission destination of IC_A, it is seen that a delay of two transmissions or more is provided between the destinations by sending data to other devices. The same also applies to IC_B.

FIG. 8shows a processing flow of the SPI job registration. If the job queue is empty, a job is registered with the job queue and the transmission operation is started. At this time, if the interrupt-not-required mode is active, the mode is switched to the interrupt mode. If the jog queue is not empty, the job is registered with the job queue and the processing is ended.

FIG. 9shows a processing flow of the interrupt-not-required mode start. If the specified len is 0, the interrupt-not-required mode operation is ended without performing anything. If len is not 0, the register is so set as to cause the length from start to len to be transmitted repetitively. Then, the communication is started. The start and len thus set are stored.

FIG. 10shows a processing flow of the data set table. The specified table content from start address to len is copied to the transmission buffer beginning with a start address.

FIG. 11shows a processing flow of the data set. Data is updated to the data of the transmission buffer at an index address.

FIG. 12shows a processing flow of the data read. Data of the reception buffer at an index address is reported.

FIG. 13shows a processing flow of the command set. Data of the transmission buffer for the destination at an index address is updated.

FIG. 14shows a processing flow of the data read table. Data of the reception buffer from the start address to len is copied to rx_data_ptr address.

FIG. 15shows a processing flow of the interrupt mode transmission start. First, the communication is stopped. Next, the register is so set that the communication will be restarted from the start address of the transmission buffer and that, after the len of data is transmitted, a completion interrupt will come in. Then, the communication is started.

FIG. 16shows a processing flow of the interrupt operation. The interrupt operation is prepared for each of the modules SPI_1, SPI_2and SPI_3. First, an interrupt bit is cleared and the reception operation corresponding to the current job is started from the job queue. Then, the next queue operation is started.

FIG. 17shows a processing flow of the next queue operation. The current job is picked up from the job queue. Next, if the job queue is empty, the interrupt-not-required mode start is executed. At this time, the start and len are given the previously stored values. When the interrupt-not-required mode is not used, as inFIG. 3, an initial value is specified. That is, len=0 and the mode is not switched to the interrupt mode. If the job queue is not empty, the transmission operation for the next job is started.

FIGS. 18A and 18Billustrate processing flows of Send Microcomputer-B1112138, which is the transmission operation for the Job Microcomputer-B, and of Rx Microcomputer-B1112139, which is the reception operation for the Job Microcomputer-B. The Send Microcomputer-B1112138uses a data set table function to set 8-byte data and a transmission destination. The Rx Microcomputer-B1112139uses a data read table function to copy the data of the reception buffer to table_miB_rx.

FIGS. 19A and 19Billustrate processing flows of Send Diagnostic1, which is the transmission operation for the Job Diagnostic1, and of Rx Diagnostic1, which is the reception operation for the Job Diagnostic1. The Send Diagnostic1uses the data set table function to set data and a transmission destination and then starts the transmission. The Rx Diagnostic1uses the data read table function to copy the data of the reception buffer and performs diagnostic analysis on the data.

FIGS. 20A and 20Billustrate processing flows of Send Diagnostic2, which is the transmission operation for the Job Diagnostic2, and of Rx Diagnostic2, which is the reception operation for the Job Diagnostic2. The Send Diagnostic2uses the data set table function to set data and a transmission destination and then starts the transmission. The Rx Diagnostic2uses the data read table function to copy the data of the reception buffer and performs diagnostic analysis on the data.

The present invention is applicable to control equipment with a built-in communication apparatus, including automotive control equipment.