Communication method for communication network of vehicle and communication network
By adding start bits and stop bits to the UART communication protocol, the problem of port occupation by the SPI communication protocol is solved, achieving more efficient data transmission and safety integrity, and is suitable for monitoring applications of safety-critical systems.
Patent Information
- Application Number
- CN202280088674.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-01-13
- Filing Date
- 2022-11-23
- Publication Date
- 2024-08-23
AI Technical Summary
When using the SPI communication protocol in the existing technology, the monitoring SoC port is occupied, causing other higher priority tasks to be unavailable, and may lead to increased CPU load, data processing delays, physical short circuits and other problems.
Using the UART communication protocol, by adding start bits and stop bits to the data frame to identify the start and end of the data, and using the slave device selection line for data transmission, it reduces the number of lines and pins required by the receiving device, and achieves Data packet capabilities similar to SPI protocol.
It reduces the CPU load of the monitoring SoC, reduces the number of lines and pins used by the port, and improves the safety integrity and reliability of data transmission. It is suitable for applications in safety-critical systems.
Smart Images

Figure CN118541679A
Abstract
Description
Technical Field
[0001] The present disclosure relates to a communication method for a vehicle and a communication device configured to at least partially perform the method. An optional autonomous vehicle including a communication network may be provided. Background Art
[0002] A System on Chip (SoC) is a highly advanced microcontroller with limited ports that uses the SPI (Serial Peripheral Interface) protocol for communication of high priority tasks.
[0003] One problem with the prior art is that if these ports are used for heartbeat monitoring, there may be situations where other higher priority tasks cannot be executed using these ports or impose a heavy CPU (central processing unit) load. That is, one problem with the prior art is that when using a communication protocol such as SPI, monitoring different slave SoCs via one monitoring SoC requires a large number of monitoring ports on the monitoring SoC. This also imposes more CPU load on the monitoring SoC and may cause delays in data processing and / or cross-communication between ports, or even cause short circuits between physical pins / ports of the monitoring SoC. Summary of the invention
[0004] In view of this prior art, an object of the present disclosure is to provide an apparatus and / or method, respectively, suitable for overcoming at least the above-mentioned disadvantages of the prior art.
[0005] This object is solved by the features of the independent claims. The dependent claims have preferred further embodiments of the disclosure as their subject matter.
[0006] More specifically, the object is solved by a communication method for a communication network of a vehicle, wherein the network comprises a master data processing unit and a slave data processing unit, the slave data processing unit being connected to the master data processing unit via a synchronous serial communication interface. The slave data processing unit can be connected to the master data processing unit via a slave device select line, the slave device select line being used to indicate that data is being sent from the master data processing unit to the slave data processing unit.
[0007] The master data processing unit and / or the slave data processing unit may be or include a SoC. A SoC is an integrated circuit (also referred to as a "chip") that integrates all or most of the components of a computer or other electronic system. These components may include a central processing unit (CPU), memory, input / output ports, and auxiliary storage devices, and optionally other components such as a graphics processing unit (GPU) - all on a single substrate or microchip. SoCs may include digital, analog, mixed-signal, and / or radio frequency signal processing functions. SoCs contrast with the common traditional motherboard-based PC architecture, which separates components based on function and connects them through a central interface circuit board. The motherboard houses and connects removable or replaceable components, while the SoC integrates all of these components into a single integrated circuit.
[0008] According to the method, data sent from the master data processing unit to the slave data processing unit and / or from the slave data processing unit to the master data processing unit are framed by a start bit as the first bit of the sent data and a stop bit as the last bit of the sent data. Here, the data (frame) sent in one cycle can have a fixed length, for example, 8 bits (i.e., one byte), 10 bits, 12 bits, or 16 bits.
[0009] More specifically, the master and slave data processing units may be SPI devices, where SPI is a synchronous serial communication interface specification used for short-distance communication, primarily in embedded systems. SPI devices may communicate in full-duplex mode using a master-slave architecture, typically with a single master device. The master (controller / data processing) device initiates frames for reading and writing. Multiple slave devices may be supported by selecting with individual chip select (CS) or slave select (SS) lines. In an independent slave configuration, there is a separate chip select line for each slave. The master device only has one chip select active at a time. Some products implementing SPI may be connected in a daisy chain configuration, with the first slave output connected to the second slave input, and so on. The SPI port of each slave device is designed to send out an exact copy of the data it received during the first set of clock pulses during the second set of clock pulses. The entire chain acts as a communication shift register; daisy chaining is typically done with shift registers to provide a set of inputs or outputs through SPI. Each slave device copies the input to the output in the next clock cycle until the active low SS line goes high. Such a feature requires only a single SS line from the master device, rather than requiring a separate SS line for each slave device. Both configurations can be implemented here.
[0010] As a synchronous serial communication interface, SPI does not use start and stop bits to indicate the beginning and end of sending data, but uses a slave select line to select the corresponding slave device connected to the master device. However, when using a universal asynchronous receiver-transmitter (UART) device, the start and stop bits are used, which is a computer hardware device for asynchronous serial communication, in which the data format and transmission speed are configurable. The UART sends data bits one by one from the least significant bit to the most significant bit, and the data bits are framed by the start and stop bits so that precise timing is handled by the communication channel. A related device, the universal synchronous and asynchronous receiver-transmitter (USART), can also be provided here, which also supports synchronous operation.
[0011] However, by adding start and stop bits to each data (frame or packet) sent using synchronous communication (such as SPI), interconnection between a device using asynchronous communication (such as UART) and a master data processing device and a slave data processing device can be provided.
[0012] More specifically, a UART typically receives bytes of data and transmits the individual bits in a sequential manner. At the destination, a second UART reassembles the bits into a complete byte. Each UART contains shift registers, which are the basic method of converting between serial and parallel forms. It is cheaper to transmit digital information (bits) serially over a single wire or other medium than to transmit them in parallel over multiple wires. Communications can be simplex (in one direction only, with no provision for the receiving device to send information back to the transmitting device), full-duplex (both devices transmit and receive simultaneously), or half-duplex (devices take turns transmitting and receiving). In a UART, the idle, no-data state is a high voltage or power-on. Each character / data packet is framed as a logic low start bit, data bits, possibly a parity bit, and one or more stop bits. The start bit signals the receiver that a new character is coming. The next five to nine bits (optional) represent the character, depending on the code set used. If a parity bit is used, it is placed after all the data bits. The next one or two bits are always in the mark (logic high, i.e., "1") state and are called the stop bit(s). They signal to the receiver that a character is complete. Since the start bit is logic low (i.e. 0) and the stop bit is logic high (i.e. 1), there are always at least two guaranteed signal changes between characters.
[0013] In this example, the transmitting device is not a UART, but an SPI device that emulates the start and stop bits so that the UART can identify the beginning and end of the data being transmitted. Therefore, the start and stop bits can be called dummy bits.
[0014] UART has the advantage that simplex data transmission requires only one wire, duplex data transmission (and ground) requires only two wires, while SPI requires four wires. Therefore, according to this method, the number of wires and pins required at the receiving device is reduced.
[0015] The above method will be described in more detail below.
[0016] The slave data processing unit can be connected to the master data processing unit via: a serial clock line for synchronizing the sampling time of the master data processing unit and the sampling time of the slave data processing unit; and a master-out slave-in data line for outputting data from the master data processing unit to the slave data processing unit.
[0017] Here, sampling is the reduction of a continuous-time signal received at the corresponding device (i.e., data transmitted via MOSI and / or MSIO) to a discrete-time signal. The sampling time is one or more time points at which (multiple) samples are taken from the continuous-time signal at the receiver. The original (continuous-time) signal can be retrieved from the sample sequence by passing the sample sequence through a low-pass filter called a reconstruction filter, up to the Nyquist limit.
[0018] The method may include using a slave select line to indicate that data is being sent from the master data processing unit to the slave data processing unit, for example, pulling the slave select line from high to low.
[0019] The method may include synchronizing a sampling time of the master data processing unit to a sampling time of the slave data processing unit using the serial clock line after and / or during an indication that data is being sent from the master data processing unit to the slave data processing unit.
[0020] The method may include sending data from the master data processing unit to the slave data processing unit using a master-out slave-in data line (ie, MOSI) after and / or during synchronization of the master data processing unit's sampling time to the slave data processing unit's sampling time.
[0021] The slave data processing unit may be connected to the master data processing unit via a master-in-slave-out data line (ie, MISO) for outputting data from the slave data processing unit to the master data processing unit.
[0022] The method may include sending data from the slave data processing unit to the master data processing unit using a master-in slave-out data line after and / or during synchronizing the sampling time of the master data processing unit to the sampling time of the slave data processing unit.
[0023] More specifically, in the case of SPI, to begin communication, the (bus) master can configure the clock using a frequency supported by the slave device (usually up to several MHz). The master can then select the slave device with a logic level 0 on the select line, as described above. If a waiting period is required, such as for analog to digital conversion, the master can wait at least that period of time before issuing a clock cycle.
[0024] During each SPI clock cycle, full-duplex data transfer may occur. The master can send a bit on the MOSI line and the slave can read that bit, and the slave can send a bit on the MISO line and the master can read that bit. This sequence can be maintained even if only one-way data transfer is intended.
[0025] Transmissions using SPI typically involve two shift registers with some given word length (such as eight bits), one in the master and one in the slave; they are connected in a virtual ring topology. Data is usually shifted out first with the most significant bit. On the clock edge, both the master and the slave can shift out a bit and output it to each other on the transmission line (i.e., MISO and MOSI). On the next clock edge, the bit can be sampled from the transmission line at each receiver and set to the new least significant bit of the corresponding shift register. After the shift register bits have been shifted out and in, the master and the slave have exchanged register values. If more data needs to be exchanged, the shift register can be reloaded and the process repeated. In this example, the corresponding shift register is loaded with the start bit as the most significant bit and the stop bit as the least significant bit, optionally in each cycle. The transmission can last for any number of clock cycles. After completion, the master stops switching the clock signal and typically deselects the slave using the slave select line.
[0026] The network may comprise a monitoring data processing unit comprising an asynchronous serial communication interface, wherein the monitoring data processing unit may be connected to the master data processing unit and the slave data processing unit via the asynchronous serial communication interface.
[0027] According to this method, the monitoring device can use the start bit to identify the beginning of the transmitted data and use the stop bit to identify the end of the transmitted data.
[0028] That is, the monitoring device may comprise a UART acting as a (second) receiver of signals sent from the master device to the slave device and / or from the slave device to the master device.
[0029] More specifically, the monitoring data processing unit may be connected to the master-out slave-in data line.
[0030] According to the method, the monitoring device can use a start bit to identify the beginning of data sent from the master data processing unit to the slave data processing unit via the master-out slave-in data line, and use a stop bit to identify the end of data sent from the master data processing unit to the slave data processing unit via the master-out slave-in data line.
[0031] Additionally or alternatively, a monitoring data processing unit may be connected to the master-in slave-out data line.
[0032] According to the method, the monitoring device can use a start bit to identify the beginning of data sent from the slave data processing unit to the master data processing unit via the master-in slave-out data line, and use a stop bit to identify the end of data sent from the slave data processing unit to the master data processing unit via the master-in slave-out data line.
[0033] More specifically and with respect to UARTs, all operations of the UART hardware may be controlled by an internal clock signal that runs at a multiple of the data rate used to transmit data, typically 8 or 16 times the bit rate. The receiver (here, a monitoring device) may test the state of the incoming signal on each clock pulse, looking for the beginning of a start bit. If the apparent start bit lasts for at least half the bit time, it may be valid and signal the beginning of a new character. If not, it may be considered a false pulse and may be ignored. After waiting for another bit time, the state of the line may be sampled again, and the resulting level may be clocked into the shift register. After the number of bit periods required for the character length (typically 5 to 8 bits, as described above) has passed, the contents of the shift register may be made available to the receiving system (in a parallel manner). The UART may set a flag to indicate that new data is available, and may also generate a processor interrupt to request the host processor to transmit the received data.
[0034] Communicating UARTs have no shared timing system other than the communicating signals. Typically, a UART resynchronizes its internal clock on every change of the data line (not seen as a stray pulse). Having the timing information in this way, they can reliably receive when the transmitter is sending at a slightly different speed. Simple UARTs do not do this; instead, they resynchronize only on the falling edge of the start bit and then read the center of each expected data bit, and this system works if the broadcast data rate is accurate enough to allow the stop bit to be sampled reliably. Both options are possible here.
[0035] However, since the UART does not obtain a clock signal from the master data processing device, the UART must know the bit rate used by the master and slave devices so that it samples the data correctly, i.e., the UARTs of the master, slave and monitoring system need to have substantially the same sampling rate.
[0036] The monitoring device may sample data at the same sampling time as the master data processing unit and the slave data processing unit.
[0037] The monitoring device may perform automatic baud rate detection (ABR). ABR may refer to a process by which the receiving device (in this case, the monitoring device) determines the speed, code level, start bit, and stop bit of the incoming data by examining the first character, usually the preselected login character (sync word) on the UART connection. ABR allows the receiving device to accept data from a variety of transmitting devices operating at different speeds without having to establish the data rate in advance.
[0038] In addition, the monitoring device can store the most recent character while receiving the next character. This "double buffering" gives the receiving computer the entire character transmission time to obtain the received character. The monitoring device can have a small first-in-first-out (FIFO) buffer memory between the receiver shift register and the host system interface. This allows the host processor more time to handle interrupts from the UART and prevents loss of received data at high rates.
[0039] The monitoring device may be referred to as a security device. The monitoring device and the main data processing unit may be located on the same SoC or on different SoCs.
[0040] The above method can be summarized as follows in other words and with respect to its more specific implementation.
[0041] The disclosed background is to create a monitoring system that uses UART (Universal Asynchronous Receiver-Transmitter) communication protocol instead of SPI (Serial Peripheral Interface) protocol, for example in heartbeat monitoring, to ensure the safety integrity of safety-critical systems such as System on Chip (SoC).
[0042] Safety integrity can be defined using the Automotive Safety Integrity Level (ASIL), which is a standardized risk classification scheme defined by the ISO 26262 - Functional Safety of Road Vehicles standard. This is an adaptation of the Safety Integrity Level (SIL) used in IEC 61508 for the automotive industry. This classification helps define the safety requirements needed to comply with the ISO 26262 standard. The ASIL is determined by performing a risk analysis of potential hazards, which focuses on the severity, exposure, and controllability of the vehicle operation scenario. The safety goal for that hazard, in turn, carries an ASIL requirement. The standard recognizes four ASILs: ASIL A, ASIL B, ASIL C, and ASIL D. ASIL D specifies the highest integrity requirements for the device / method, while ASIL A specifies the lowest integrity requirements. Hazards that are identified as QMs do not specify any safety requirements.
[0043] The present disclosure contemplates that there may be multiple slave SoCs, which may be monitored by a master SoC and / or a separate monitoring / safety SoC.
[0044] The main / safety SoC can be developed according to the ASIL and provide different monitoring mechanisms such as CRC, timeout and heartbeat monitoring to ensure high availability.
[0045] According to the prior art, the security SoC uses an SPI (Serial Peripheral Interface) communication protocol with a given port to monitor the heartbeat of a slave device. However, according to the present disclosure, the security SoC may use a UART (Universal Asynchronous Receiver-Transmitter) communication protocol.
[0046] The UART protocol is an asynchronous serial communication protocol with configurable speed. Asynchronous means that there is no clock signal to synchronize the output bits from the transmitting device to the receiving end of the UART. Therefore, data is sent serially from the transmitting UART to the receiving UART.
[0047] The secure SoC may have only one UART port per slave device. The port may be configured to only receive information from each corresponding slave device transmission port.
[0048] The UART communication protocol may be modified to ensure data packet capabilities similar to the SPI communication protocol.
[0049] The SPI communication protocol can be modified to create a UART packet using a start bit, a data frame, and (multiple) stop bits. Here, the UART packet can be configured so that the start bit is low (i.e., 0), and the stop bit and bus idle are high (i.e., 1). The stop bit can include one, 1, 5, or more bits. The parity bit before the stop bit may or may not be used.
[0050] The security SoC may also be the grand master SoC having multiple SoCs in a master-slave SoC configuration.
[0051] The master SoC and slave SoC can communicate with each other using "MOST" and "MISO". The highest master safety SoC can monitor the heartbeat by using ASIL and UART "RX" to directly read the "MOST" and "MISO" of the master SoC and slave SoC.
[0052] Communications between the master SC and slave SCs and to the highest master security SoC may be protected using end-to-end (E2E) protection, such as a cyclic redundancy check (CRC), to ensure that data frames of data packets are not corrupted.
[0053] It can be ensured that the bits in the data frame of the UART are read with the same frequency / baud rate as the SPI protocol, ie the same sampling time can be used.
[0054] Furthermore, a communication network for a vehicle is provided. The communication network may be configured to at least partially perform the above method.
[0055] The network comprises a master data processing unit and a slave data processing unit connected to the master data processing unit via a synchronous serial communication interface.
[0056] The slave data processing unit is connected to the master data processing unit via a slave select line which is used to indicate that data is being sent from the master data processing unit to the slave data processing unit.
[0057] The master data processing unit is configured to frame data transmitted from the master data processing unit to the slave data processing unit with a start bit as the first bit of the transmitted data and a stop bit as the last bit of the transmitted data.
[0058] Additionally or alternatively, the slave data processing unit is configured to frame data sent from the slave data processing unit to the master data processing unit with a start bit as the first bit of the sent data and a stop bit as the last bit of the sent data.
[0059] The above-mentioned communication network will be described in more detail below.
[0060] The slave data processing unit can be connected to the master data processing unit via: a serial clock line for synchronizing the sampling time of the master data processing unit and the sampling time of the slave data processing unit; and a master-out slave-in data line for outputting data from the master data processing unit to the slave data processing unit.
[0061] The master data processing unit may be configured to use the slave select line to indicate that data is being sent from the master data processing unit to the slave data processing unit.
[0062] The master data processing unit can be configured to synchronize the sampling time of the master data processing unit (i.e., the time at which the corresponding unit samples / reads the signal received via the data line) to the sampling time of the slave data processing unit using the serial clock line after and / or during indication that data is being sent from the master data processing unit to the slave data processing unit.
[0063] The master data processing unit may be configured to send data from the master data processing unit to the slave data processing unit using the master-out slave-in data line after and / or during synchronization of the master data processing unit's sampling time to the slave data processing unit's sampling time.
[0064] Additionally or alternatively, the slave data processing unit may be connected to the master data processing unit via a master-in slave-out data line for outputting data from the slave data processing unit to the master data processing unit.
[0065] The slave data processing unit may be configured to send data from the slave data processing unit to the master data processing unit using the master-in slave-out data line after and / or during synchronization of the sampling time of the master data processing unit to the sampling time of the slave data processing unit.
[0066] The network may include a monitoring data processing unit including an asynchronous serial communication interface, wherein the monitoring data processing unit is connected to the master data processing unit and the slave data processing unit via the asynchronous serial communication interface.
[0067] The monitoring device may be configured to use the start bit to identify the beginning of transmitted data and the stop bit to identify the end of transmitted data.
[0068] The monitoring data processing unit can be connected to the master-out and slave-in data lines.
[0069] The monitoring device can be configured to use a start bit to identify the beginning of data sent from the master data processing unit to the slave data processing unit via the master-out slave-in data line, and use a stop bit to identify the end of data sent from the master data processing unit to the slave data processing unit via the master-out slave-in data line.
[0070] Additionally or alternatively, a monitoring data processing unit may be connected to the master-in slave-out data line.
[0071] The monitoring device can be configured to use a start bit to identify the beginning of data sent from the slave data processing unit to the master data processing unit via the master-in slave-out data line, and to use a stop bit to identify the end of data sent from the slave data processing unit to the master data processing unit via the master-in slave-out data line.
[0072] The monitoring device may be configured to sample data at the same sampling time as the master data processing unit and the slave data processing unit.
[0073] The communication network may include an electronic control unit (ECU) and / or SoC for the vehicle as a master data processing unit, a slave data processing unit and / or a monitoring data processing unit. The data processing unit may be a (smart) processor control unit that may optionally communicate with other modules via a central gateway (CGW). The data processing unit may form part of the vehicle's onboard network, including a field bus such as a CAN bus, a LIN bus, a MOST bus and / or a FlexRay or automotive Ethernet, optionally formed with a telematics control unit. (Multiple) data processing units may be configured to control functions related to the vehicle's driving behavior, such as an engine control system, a power transmission, a braking system and / or a tire pressure control system. In addition, (multiple) data processing units may control some or all driver assistance systems, such as parking assistance, adaptive cruise control, lane departure warning, lane change assistance, traffic sign recognition, light signal recognition, proximity assistance, night vision assistance, intersection assistance and / or many other systems.
[0074] Furthermore, the above description regarding the method applies to the network, and vice versa.
[0075] In addition, a vehicle is provided, which comprises the above data communication network.
[0076] The vehicle may be an automobile, such as a sedan. The vehicle may be autonomous. The autonomous vehicle may be designed to at least partially and / or temporarily take over lateral and / or longitudinal guidance during autonomous driving of the autonomous vehicle. Thus, among other things, sensor / camera data of the above-mentioned sensor system / camera may be used. The control unit may be configured to at least partially control the autonomous driving.
[0077] Autonomous driving may be such that the driving of the vehicle is (largely) automatic. The vehicle may be a Level 1 autonomous vehicle, i.e. having certain driver assistance systems to support the driver in operating the vehicle, such as adaptive cruise control (ACC).
[0078] The vehicle may be a Level 2 automated driving vehicle, i.e. partially autonomous, such that the driver assistance systems can perform functions such as automatic parking, lane keeping or lateral navigation, general longitudinal navigation, acceleration and / or braking.
[0079] The vehicle can be a Level 3 automated driving vehicle, which is conditionally autonomous and does not require the driver to continuously monitor the system vehicle. The vehicle automatically performs functions such as triggering turn signals, changing lanes and / or lane keeping. The driver can focus on other matters, but if necessary, the system will prompt the driver to take over control within the warning time.
[0080] The vehicle may be a Level 4 automated driving vehicle, i.e. a highly autonomous vehicle, where the driving of the vehicle is permanently taken over by the system vehicle. The driver may be asked to take over control if the system is no longer handling the driving task.
[0081] The vehicle can be a Level 5 autonomous vehicle, which is fully autonomous and does not require a driver to complete the driving task. No human intervention is required except to set the destination and start the system. The vehicle can be operated without a steering wheel or pedals.
[0082] Furthermore, the above descriptions regarding the method and the network apply to the vehicle, and vice versa.
[0083] Furthermore, the computer program comprises instructions which, when a computer (optionally a data processing unit(s)) executes the program, cause the computer to at least partially perform the above-described method.
[0084] The program may comprise any program code, in particular a code suitable for use in a vehicle control system.The above description with respect to the method, the control unit and the vehicle applies to the computer program and vice versa.
[0085] In addition, the computer-readable medium includes instructions that, when executed by a computer, cause the computer to at least partially perform the above-described method.
[0086] The computer readable medium can be any digital data storage device, such as a USB flash drive, a hard disk, a CD-ROM, an SD card or an SSD card. The above-mentioned computer program can be stored on a computer readable medium. However, the computer program does not necessarily have to be stored on such a computer readable medium, and can also be obtained via the Internet.
[0087] Furthermore, the above description regarding the method, the control unit, the vehicle and the computer program applies to the computer-readable (storage) medium and vice versa. BRIEF DESCRIPTION OF THE DRAWINGS
[0088] Reference below Figures 1 to 4 Embodiments are described.
[0089] Figure 1 Schematically shows an SPI network according to the prior art, the SPI network comprising a master data processing unit and a monitoring data processing unit connected to a slave data processing unit,
[0090] Figure 2 Schematically shows a communication network according to the present disclosure, the communication network comprising a master data processing unit and a monitoring data processing unit connected to a slave data processing unit,
[0091] Figure 3 Schematically shows the Figure 2a communication protocol for communication between the master data processing unit and the monitoring data processing unit in the network, and
[0092] Figure 4 Shows Figure 2 Flowchart of a communication method used in a communication network. DETAILED DESCRIPTION
[0093] Reference below Figures 1 to 4 An embodiment is described wherein the same reference symbols are used for the same objects throughout the description of the drawings and wherein the embodiment is merely a specific example for implementing the present disclosure and does not limit the scope of the present disclosure as defined by the claims.
[0094] Figure 4 The flowchart should not be interpreted as showing a strict order of steps S1 - S3 of the method, but rather steps S1 - S3 may be performed in any technically reasonable order (eg, at least partially simultaneously).
[0095] In US4816996A, a network 14' having a serial peripheral interface (SPI) is shown and described. Figure 1 A network 14' is illustrated wherein the SPI used therein may be described as a synchronous four-wire serial interface.
[0096] A master device / data processing unit 10' (such as a microcomputer (MCU) or a system on chip (SoC)) and a slave device / data processing 11' (such as an analog-to-digital converter or similar peripheral or system on chip (SoC)) communicate via their respective SPI interfaces.
[0097] At the master device 10', the SPI interface includes a master shift register 12' and a clock generator 13'. The least significant bit of the shift register 12' has an input connected to a pin labeled MISO (master input / slave output or master input slave output) of the master device 10', and the most significant bit of the shift register 12' has an output connected to a pin labeled MOSI (master output / slave input or master output slave input) of the master device 10'. The output of the clock generator 13' is connected to the clock input of the shift register 12' of the master device 10 and a pin labeled SCK (for slave clock) of the master device 10'.
[0098] The SPI interface of the slave device 11' (there may be more than one slave device 11' coupled to a single master device 10') includes a slave shift register 15'. The least significant bit of the slave shift register 15' has an input connected to a pin labeled MOSI of the slave device 11', while the most significant bit of the shift register 15' has an output connected to a pin labeled MISO of the slave device 11'. The clock input of the slave shift register 15' is connected to a pin labeled SCK of the slave device 11', which is connected to a pin labeled SCK of the master device 10'.
[0099] The respective MOSI, MISO and SCK pins of the master device 10' and the slave device 11' are connected to each other. In addition, one or more slave device / chip select lines SS are provided for transmitting one or more chip select signals from the master device 10' to the slave device 11' to enable selection of the (respective) slave device 11'. The master device 10' and the slave device 11' each have a data path for inputting data to be transmitted into their respective shift registers 12', 15' and for retrieving received data therefrom.
[0100] In addition, a monitoring device 16' is provided, which is optionally a SoC, wherein the monitoring device 16' also includes the above-mentioned SPI interface of the slave device 11', including MOSI, MISO and SCK ports / pins connected to the MOSI, MISO and SCK ports of the master device and the slave devices 10', 11', and a shift register 161' for the MOSI data line and a shift register 162' for the MSIO data line, both of which are connected to the SCK port of the master device 10'. The monitoring device 16' is also connected to the chip select line marked as SS of the corresponding slave device 11'. The monitoring device 16' uses the SPI interface to monitor the master device 10' and the slave device 11' in real time, that is, to check whether data is regularly exchanged between the master device 10' and the slave device 11' and / or whether the exchanged data is correct and / or reasonable.
[0101] The main disadvantage of the above SPI interface when used for real-time monitoring is that it requires a relatively large number of pins / ports at the monitoring device 16', ie at least three but at most four or more pins, to perform real-time monitoring of a single slave device 11'.
[0102] Therefore, a novel communication method for a communication network 14 of a vehicle (not shown) is provided, such as from Figures 2 to 4 The results are obtained from Figure 2 The communication network 14 is schematically shown. Figure 3 Schematically shows the use of Figure 4 The method shown in Figure 2The network also includes a master device 10, a slave device 11 and a monitoring device 16, similar to Figure 1 The corresponding part of network 14 is composed of Figure 1 The same reference numerals as in the network 14' are used, but without the prime. Unless otherwise indicated, the above Figure 1 The description given for Figure 2 The network 14 shown in is also correct.
[0103] The network 14 includes a master data processing unit 10 and a slave data processing unit 11 connected to the master data processing unit 10 via its SPI.
[0104] More specifically, the slave data processing unit 11 is connected to the master data processing unit via a slave device select line marked as SS, a serial clock line marked as SCK, a master-out slave-in data line marked as MOSI, and a master-in slave-out data line marked as MISO. The slave device select line marked as SS is used to indicate that data will be sent from the master data processing unit 10 to the slave data processing unit 11, the serial clock line marked as SCK is used to synchronize the sampling time of the master data processing unit 10 and the sampling time of the slave data processing unit 11, the master-out slave-in data line marked as MOSI is used to output data from the master data processing unit 10 to the slave data processing unit 11, and the master-in slave-out data line marked as MISO is used to output data from the slave data processing unit 11 to the master data processing unit 10.
[0105] The network 14 comprises a monitoring device / data processing unit 16, which is connected to the master data processing unit 10 and the slave data processing unit 11. The monitoring data processing unit 16 therefore comprises an asynchronous serial communication interface.
[0106] More specifically, the asynchronous serial communication interface of the monitoring device 16 includes two input ports, each labeled as UART Rx, and two shift registers 161, 162, each connected at its input side to one of the input ports of the monitoring device 16. One of the input ports labeled as UART Rx is connected to a master-out slave-in data line labeled as MOSI, and the other of the input ports labeled as UART Rx is connected to a master-in slave-out data line labeled as MISO. Via the two input ports, data sent from the master device 10 to the slave device 11 (via MOSI) and data sent from the slave device 11 to the master device 10 (via MISO) are received at the monitoring device 16 and written into a corresponding one of the shift registers 161, 162 of the monitoring device 16. The asynchronous serial communication interface of the monitoring device 16 also includes a clock generator 163 (similar to the clock generator 13 of the master device 10), which is connected to the corresponding clock inputs of the two shift registers 161, 162 of the monitoring device 16. Both shift registers 161 , 162 of the monitoring device 16 have a data path for retrieving received data from the respective shift register 161 , 162 .
[0107] The network 14 is used to perform Figure 4 The method is as follows:
[0108] In the first step S1 of the method, the master device 10 indicates the start of a communication cycle, including: using a slave device select line marked as SS, for example by pulling the slave device select line marked as SS from an idle / high state (i.e., 1) to a low state (i.e., 0), sending data from the master device 10 to the slave device 11 and vice versa.
[0109] In the second step S2 of the method, the master device 10 and the slave device 11 start to send the data packets 17 that have been loaded (optionally pre-loaded) into their respective shift registers 12, 15 via the master-out slave-in data line marked with MOSI and the master-in slave-out data line marked with MISO. More specifically, in the second step S2, the master-out slave-in data line marked with MOSI is used to send data from the master data processing unit 10 to the slave data processing unit 11, and the master-in slave-out data line marked with MISO is used to send data from the slave data processing unit 11 to the master data processing unit 10.
[0110] Data packet 17 in Figure 3, and includes a start bit (e.g., low / zero) marked with S and a stop bit (e.g., high / one) marked with E, framing / accommodating between data bytes marked with F, which include eight data bits marked with F1-F8 (there may be more or less than eight data bits, but the data packet should contain a fixed / predefined number of data bits). That is, the data (packet) 17 sent from the master data processing unit 10 to the slave data processing unit 11 and the data (packet) 17 sent from the slave data processing unit 11 to the master data processing unit 10 are framed by the start bit marked with S as the first bit of the transmitted data (packet) 17 and the stop bit marked with E as the last bit of the transmitted data (packet) 17.
[0111] The master device 10 and the slave device 11 send the bits of the data packet 17 one by one, starting with the start bit marked S, followed by the data bits marked F1-F8, and finally the stop bit marked E.
[0112] At least during the transmission and reception of the data packets 17 in the second step S2 of the method, the shift register 12 of the master device 10 and the shift register 15 of the slave device 11 both receive the same clock signal via the serial clock line marked SCK from the clock generator 13 of the master device 10. That is, by using the same clock signal, the sampling time of the master device 10 and the sampling time of the slave device 10 are synchronized with each other.
[0113] More specifically, to start communication in the second step S2, the bus device 10 configures its clock generator 13 using a frequency supported by the slave device 11 (usually up to several MHz) and a frequency supported by the monitoring device 16. Here, a predefined frequency can be used. The master device 10 then selects the slave device 11 with a logic level 0 on the selection line marked SS. If a waiting period is required, such as for analog to digital conversion, the master device 10 waits at least for that period of time and then issues a clock cycle using its clock generator 13 and the serial clock line marked SCK.
[0114] During each SPI clock cycle, full-duplex data transfer may occur. Master 10 sends a bit on the master-out slave-in data line labeled MOSI, and slave 11 reads that bit, while slave 11 sends a bit on the master-in slave-out data line labeled MISO, and master 10 reads that bit. This sequence can be maintained even if only one-way data transfer is intended.
[0115] The data transmission between the master device 10 and the slave device 11 involves two shift registers 12 and 15 of the master device 10 and the slave device 11, both of which have a given word length, such as ten bits, one in the master device 10 and one in the slave device 11; they are connected in a virtual ring topology through the master-out slave-in data line marked as MOSI and the master-in slave-out data line marked as MISO. The data is first shifted out with the most significant bit, here the start bit marked as S. On the clock edge, the master device 10 and the slave device 11 both shift out one bit and output it to each other on the corresponding data (transmission) lines (i.e., MISO and MOSI). On the next clock edge, at each receiver 10, 11, the bit is sampled from the transmission line and set to the new least significant bit of the corresponding shift register 12, 15. After all register bits have been shifted out and in, the master device 10 and the slave device 11 have exchanged register values. If more data needs to be exchanged, the shift registers 12, 15 are reloaded and the process is repeated. The transfer may last any number of clock cycles. Upon completion, the master device 10 stops toggling the clock signal and deselects the slave device 11, typically using the slave select line labeled SS.
[0116] In addition to setting the clock frequency, the master device 10 also configures the clock polarity and phase relative to the data. In SPI, there are usually two options available, namely CPOL and CPHA (for clock polarity and clock phase).
[0117] The timing will be described further below and applies to both the master device 10 and the slave device 11.
[0118] CPOL determines the polarity of the clock. An inverter can be used to invert the polarity. CPOL=0 is a clock that idles at 0, and each cycle consists of a pulse of 1. That is, the leading edge is a rising edge and the trailing edge is a falling edge. CPOL=1 is a clock that idles at 1, and each cycle consists of a pulse of 0. That is, the leading edge is a falling edge and the trailing edge is a rising edge. CPHA determines the timing (i.e., phase) of the data bits relative to the clock pulses. For CPHA=0, the "output" side changes the data on the trailing edge of the previous clock cycle, while the "input" side captures the data on the leading edge of the clock cycle (or shortly thereafter). The "output" side keeps the data valid until the trailing edge of the current clock cycle. For the first cycle, the first bit must be on the MOSI line before the leading edge of the clock. Another way to think about it is to say that the CPHA=0 cycle consists of a half cycle in which the clock is idle and a subsequent half cycle in which the clock is valid. For CPHA=1, the "output" side changes the data on the leading edge of the current clock cycle, while the "input" side captures the data on the trailing edge of the clock cycle (or shortly thereafter). The "output" side holds the data valid until the leading edge of the next clock cycle. For the last cycle, the slave holds the MISO line valid until the slave select is deactivated. Another way to think about it is to say that a CPHA=1 cycle consists of a half cycle in which the clock is active and a subsequent half cycle in which the clock is idle. The MOSI and MISO signals are typically stable (at their receive point) for the half cycle until the next clock transition. The SPI master 10 and slave 11 can sample the data at different points in the half cycle. This adds more flexibility to the communication channel between the master 10 and the slave 11.
[0119] However, no matter which clock polarity and phase are used, the above content ensures that the master device 10 and the slave device 11 sample the received data signal at the correct time point, that is, they use the synchronized sampling time (given by Figure 3 Indicated by the arrow shown in ).
[0120] The monitoring device 16 can be considered as a middleman device, which also receives the bits labeled S, F1-F8 and E sent via the master-in slave-out data line (labeled MISO) and the master-out slave-in data line (labeled MOSI) at its corresponding input port (labeled UART Rx). Since the monitoring device 16 includes a UART interface (asynchronous communication interface), the monitoring device 16 is not connected to the serial clock line labeled SCK and therefore does not receive a clock signal from the master device 10. In addition, the monitoring device 16 also does not receive a slave / chip select signal from the master device 10 because it is not connected to the slave select line labeled SS.
[0121] However, since each data packet sent from the master device 10 to the slave device 11 and vice versa includes a start bit marked as S, the monitoring device 16 can identify the start of the above-mentioned transmission cycle without obtaining the chip selection signal. The same applies to the end of the transmission cycle. The monitoring device 16 can use the stop bit marked as E to identify the end of the transmission cycle. That is, the monitoring device 16 uses the start bit marked as S to identify the beginning of the transmitted data and the stop bit marked as E to identify the end of the transmitted data. Therefore, in the third step S3 of the method, the monitoring device 16 uses the start bit marked as S to identify the beginning of the data sent from the master data processing unit 10 to the slave data processing unit 11 via the master-out slave-in data line marked as MOSI, and uses the stop bit marked as E to identify the end of the data sent from the master data processing unit 10 to the slave data processing unit 11 via the master-out slave-in data line marked as MOSI. The monitoring device 16 uses a start bit marked S to identify the beginning of data sent from the slave data processing unit 11 to the master data processing unit 10 via the master input slave output data line marked MISO, and uses a stop bit marked E to identify the end of data sent from the slave data processing unit 11 to the master data processing unit 10 via the master input slave output data line marked MISO.
[0122] In addition, the monitoring device 16 samples the data at the same sampling time as the master data processing unit 10 and the slave data processing unit 11 (i.e., for data sent via MOSI, the received data is sampled during the same time slot as the slave data processing unit 11, and / or for data sent via MISO, the received data is sampled during the same time slot as the master data processing unit 10). This is achieved using the clock generator 163 of the monitoring device 16, which can have the same clock frequency as the clock generator 13 of the master device 10, and optionally by sampling the data at the monitoring device 16 according to the predefined clock polarity and phase used by the master device 10 and the slave device 11. Therefore, the monitoring device 16 can not only identify the beginning and end of the transmission cycle, but also correctly read / identify the data bits marked F1-F8 included in each data packet marked F.
[0123] Reference Symbols
[0124] 10' Main equipment (existing technology)
[0125] 11' From the device (existing technology)
[0126] 12' Main shift register (prior art)
[0127] 13' Clock generator of master device (prior art)
[0128] 14' Communication Network (Prior Art)
[0129] 15' From the shift register (prior art)
[0130] 16' Safety / monitoring equipment (existing technology)
[0131] 161' MISO shift register of monitoring equipment (prior art)
[0132] 162' MOSI shift register for monitoring equipment (prior art)
[0133] 10 Master Device
[0134] 11 Slave Device
[0135] 12 Main shift register
[0136] 13 Master clock generator
[0137] 14 Communication Network
[0138] 15 From the shift register
[0139] 16 Safety / monitoring equipment
[0140] 161 Monitoring device MISO shift register
[0141] 162 MOSI shift register of monitoring device
[0142] 163 Clock generator for monitoring equipment
[0143] 17 Data Grouping
[0144] MSIO Master-in Slave-out Data Cable
[0145] MOSI master-out slave-in data line
[0146] SS Slave / Chip Select Line
[0147] SCK slave clock line
[0148] S Start bit
[0149] E Stop bit
[0150] F Data Byte
[0151] F1-F8 data position
[0152] Steps of the S1-S3 method
Claims
1. A communication method for a communication network (14) of a vehicle, wherein the network comprises: - a master data processing unit (10), and - a slave data processing unit (11) connected to the master data processing unit (10) via a synchronous serial communication interface, - wherein the slave data processing unit (11) is connected to the master data processing unit (10) via a slave device select line (SS), the slave device select line (SS) being used to indicate that data (17) is being sent from the master data processing unit (10) to the slave data processing unit (11), Features - the data (17) sent from the master data processing unit (10) to the slave data processing unit (11) and / or from the slave data processing unit (11) to the master data processing unit (10) is framed by a start bit (S) as the first bit of the sent data (17) and a stop bit (E) as the last bit of the sent data (17).
2. The method according to claim 1, - wherein the slave data processing unit (11) is connected to the master data processing unit (10) via: - a serial clock line (SCK) for synchronizing the sampling time of the master data processing unit (10) and the sampling time of the slave data processing unit (11), and - a master-out slave-in data line (MOSI), used for outputting data from the master data processing unit to the slave data processing unit, It is characterized in that The method comprises: - using the slave select line (SS) to indicate that the data (17) is being sent from the master data processing unit (10) to the slave data processing unit (11), - after indicating that the data (17) is being sent from the master data processing unit (10) to the slave data processing unit (11) and / or during indicating that the data (17) is being sent from the master data processing unit (10) to the slave data processing unit (11), synchronizing the sampling time of the master data processing unit (10) to the sampling time of the slave data processing unit (11) using the serial clock line (SCK), and - after synchronizing the sampling time of the master data processing unit (10) to the sampling time of the slave data processing unit (11) and / or during synchronizing the sampling time of the master data processing unit (10) to the sampling time of the slave data processing unit (11), sending the data (17) from the master data processing unit (10) to the slave data processing unit (11) using the master-out slave-in data line (MOSI).
3. The method according to claim 2, - wherein the slave data processing unit (11) is connected to the master data processing unit (10) via a master input slave output data line (MISO), and the master input slave output data line (MISO) is used to output data from the slave data processing unit (11) to the master data processing unit (10), It is characterized in that The method comprises: - after synchronizing the sampling time of the master data processing unit (10) to the sampling time of the slave data processing unit (11) and / or during synchronizing the sampling time of the master data processing unit (10) to the sampling time of the slave data processing unit (11), sending the data (17) from the slave data processing unit (11) to the master data processing unit (10) using the master-in-slave-out data line (MISO).
4. The method according to any one of claims 1 to 3, wherein the network (14) comprises: - a monitoring data processing unit (16) comprising an asynchronous serial communication interface, - wherein the monitoring data processing unit (16) is connected to the master data processing unit (10) and the slave data processing unit (11) via the asynchronous serial communication interface, Features - the monitoring data processing unit (16) uses the start bit (S) to identify the beginning of the transmitted data (17) and uses the stop bit (E) to identify the end of the transmitted data (17).
5. The method according to claim 4 when dependent on claim 2, - wherein the monitoring data processing unit (16) is connected to the master-out slave-in data line (MOSI), Features - the monitoring data processing unit (16) uses the start bit (S) to identify the beginning of the data (17) sent from the master data processing unit (10) to the slave data processing unit (11) via the master-out slave-in data line (MOSI), and uses the stop bit (E) to identify the end of the data (17) sent from the master data processing unit (10) to the slave data processing unit (11) via the master-out slave-in data line (MOSI).
6. A method according to claim 4 or 5 when dependent on claim 3, - wherein the monitoring data processing unit (16) is connected to the master-in slave-out data line (MISO), Features - the monitoring data processing unit (16) uses the start bit (S) to identify the beginning of the data (17) sent from the slave data processing unit (11) to the master data processing unit (10) via the master input slave output data line (MISO), and uses the stop bit (E) to identify the end of the data (17) sent from the slave data processing unit (11) to the master data processing unit (10) via the master input slave output data line (MISO).
7. A method according to any one of claims 4 to 6 when dependent on claim 2 or 3, characterized in that The monitoring data processing unit (16) samples the received data (17) at the same sampling time as the master data processing unit (10) and the slave data processing unit (11).
8. A communication network (14) for a vehicle, wherein the network comprises: - a master data processing unit (10), and - a slave data processing unit (11) connected to the master data processing unit (10) via a synchronous serial communication interface, - wherein the slave data processing unit (11) is connected to the master data processing unit (10) via a slave device select line (SS), the slave device select line (SS) being used to indicate that data (17) is being sent from the master data processing unit (10) to the slave data processing unit (11), Features: - the master data processing unit (10) is configured to frame the data (17) sent from the master data processing unit (10) to the slave data processing unit (11) with a start bit (S) as the first bit of the sent data (17) and a stop bit (E) as the last bit of the sent data (17), and / or - the slave data processing unit (11) is configured to frame the data (17) sent from the slave data processing unit (11) to the master data processing unit (10) with a start bit (S) as the first bit of the sent data (17) and a stop bit (E) as the last bit of the sent data (17).
9. A network (14) according to claim 8, - wherein the slave data processing unit (11) is connected to the master data processing unit (10) via: - a serial clock line (SCK) for synchronizing the sampling time of the master data processing unit (10) and the sampling time of the slave data processing unit (11), and - a master-out slave-in data line (MOSI), used for outputting data (17) from the master data processing unit to the slave data processing unit (11), Features - the master data processing unit (10) is configured to use the slave select line (SS) to indicate that the data (17) is being sent from the master data processing unit (10) to the slave data processing unit (11), - the master data processing unit (10) is configured to synchronize the sampling time of the master data processing unit (10) to the sampling time of the slave data processing unit (11) using the serial clock line (SCK) after indicating that the data (17) is being sent from the master data processing unit (10) to the slave data processing unit (11) and / or during indicating that the data (17) is being sent from the master data processing unit (10) to the slave data processing unit (11), and - the master data processing unit (10) is configured to send the data (17) from the master data processing unit (10) to the slave data processing unit (11) using the master-out slave-in data line (MOSI) after synchronizing the sampling time of the master data processing unit (10) to the sampling time of the slave data processing unit (11) and / or during synchronizing the sampling time of the master data processing unit (10) to the sampling time of the slave data processing unit (11).
10. The network (14) according to claim 9, - wherein the slave data processing unit (11) is connected to the master data processing unit (10) via a master input slave output data line (MISO), and the master input slave output data line (MISO) is used to output data from the slave data processing unit (11) to the master data processing unit (10), Features - the slave data processing unit (11) is configured to send the data (17) from the slave data processing unit (11) to the master data processing unit (10) using the master-in slave-out data line (MISO) after synchronizing the sampling time of the master data processing unit (10) to the sampling time of the slave data processing unit (11) and / or during synchronizing the sampling time of the master data processing unit (10) to the sampling time of the slave data processing unit (11).
11. A network (14) according to any one of claims 8 to 10, wherein the network comprises: - a monitoring data processing unit (16) comprising an asynchronous serial communication interface, - wherein the monitoring data processing unit (16) is connected to the master data processing unit (10) and the slave data processing unit (11) via the asynchronous serial communication interface, Features - the monitoring data processing unit (16) is configured to use the start bit (S) to identify the beginning of the transmission data, and use the stop bit (E) to identify the end of the transmission data.
12. A network (14) according to claim 11 when appended to claim 9, - wherein the monitoring data processing unit (16) is connected to the master-out slave-in data line (MOSI), Features - the monitoring data processing unit (16) is configured to use the start bit (S) to identify the beginning of the data (17) sent from the master data processing unit (10) to the slave data processing unit (11) via the master-out slave-in data line (MOSI), and to use the stop bit (E) to identify the end of the data sent from the master data processing unit (10) to the slave data processing unit (11) via the master-out slave-in data line (MOSI).
13. A network (14) according to claim 11 or 12 when dependent on claim 10, - wherein the monitoring data processing unit (16) is connected to the master-in slave-out data line (MISO), Features - the monitoring data processing unit (16) is configured to use the start bit (S) to identify the beginning of the data (17) sent from the slave data processing unit (11) to the master data processing unit (10) via the master input slave output data line (MISO), and to use the stop bit (E) to identify the end of the data sent from the slave data processing unit (11) to the master data processing unit (10) via the master input slave output data line (MISO).
14. A network (14) according to any one of claims 11 to 13 when dependent on claim 9 or 10, characterised in that The monitoring data processing unit (16) is configured to sample the received data (17) at the same sampling time as the master data processing unit (10) and the slave data processing unit (11).
15. A vehicle, characterized in that: The vehicle comprises a network (14) according to any one of claims 8 to 14.
