CN111858421A - Interaction method between double chips - Google Patents
Interaction method between double chips Download PDFInfo
- Publication number
- CN111858421A CN111858421A CN202010538890.7A CN202010538890A CN111858421A CN 111858421 A CN111858421 A CN 111858421A CN 202010538890 A CN202010538890 A CN 202010538890A CN 111858421 A CN111858421 A CN 111858421A
- Authority
- CN
- China
- Prior art keywords
- data
- mcu
- mpu
- signal channel
- signal
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Communication Control (AREA)
Abstract
The invention relates to an interaction method between double chips, wherein the double chips respectively refer to a signal control unit MCU and a signal display unit MPU in a vehicle-mounted instrument, the method comprises configuring a control signal channel of the MCU to the MPU, and the control signal comprises a chip selection signal and a clock signal; configuring a first data signal channel and a second data signal channel, wherein the first data channel is a data signal channel from an MCU (microprogrammed control Unit) end to an MPU (microprogrammed processing Unit) end, and the second data channel is a data signal channel from the MPU end to the MCU end; the on-off of the first data signal channel and the second data signal channel is controlled by the control signal. The control signal channel, the first data signal channel and the second data signal channel are realized through universal input and output interfaces of the MCU and the MPU. The invention provides a simple and safe mode for the data interaction between the MCU and the MPU.
Description
Technical Field
The invention belongs to the field of automotive electronic instruments, relates to a safe interaction mode of multiple chips and multiple systems, and particularly relates to an interaction method between double chips of an MCU (microprogrammed control Unit) and an MPU (micro processing Unit).
Background
Automobile instruments are developing from traditional pointer instruments to combination instruments and full liquid crystal instruments. The system based on the combination instrument and the all-liquid crystal instrument is composed of a plurality of core units, wherein a unit responsible for signal interaction with other vehicle bodies is called MCU, and a unit responsible for displaying signals is called MPU. Data interaction between the MCU and the MPU requires a simple, secure way.
Disclosure of Invention
Aiming at the technical problems in the prior art, the invention provides a safe and reliable transmission method for realizing data between an MCU (microprogrammed control Unit) and an MPU (micro processing Unit) by using GPIO (general purpose input/output) pins.
The technical scheme for solving the technical problems is as follows:
an interaction method between two chips, the two chips respectively refer to a signal control unit MCU and a signal display unit MPU in a vehicle-mounted instrument, comprises
Configuring a control signal channel of the MCU to the MPU, wherein the control signal comprises a chip selection signal and a clock signal;
configuring a first data signal channel and a second data signal channel, wherein the first data channel is a data signal channel from an MCU (microprogrammed control Unit) end to an MPU (microprogrammed processing Unit) end, and the second data channel is a data signal channel from the MPU end to the MCU end;
the on-off of the first data signal channel and the second data signal channel is controlled by the control signal.
Further, the method further comprises:
when the chip selection signal is enabled, in two adjacent clock cycles of the clock signal:
in the previous clock period, the MCU sends data to the MPU through the first data signal channel; the MPU transmits the received data back to the MCU through a second data signal channel;
and in the next clock period, the MCU receives the data returned by the MPU and compares the data with the data sent in the previous clock period, if the data are consistent, the next data is sent continuously, otherwise, the MCU resets and resends the data.
Further, in the previous clock cycle, the MCU sends data to the MPU via the first data signal channel; the MPU transmits the received data back to the MCU through a second data signal channel, and comprises:
in the clock period, when the clock signal is at a low level, the MCU writes data to be transmitted into the first data signal channel, and when the clock signal is at a high level, the MPU reads the data in the first data signal channel and writes the data into the second data signal channel.
Further, in the latter clock cycle, the MCU receives the data returned by the MPU and compares the data with the data sent in the previous clock cycle, and if the data are consistent, continues to send the next data, including:
in the clock period, when the clock signal is at low level, the MCU reads the data in the second data signal channel and compares the data with the data sent in the previous clock period, and if the data are consistent, the MCU writes the next data to be sent into the first data signal channel.
Further, the MCU resets and retransmits data, specifically: the MCU changes the high and low levels of the chip selection signal, enables the chip selection signal to be enabled again, and sends data to the MPU through the first data signal channel in the next clock period.
Further, the control signal channel, the first data signal channel and the second data signal channel are realized through universal input and output interfaces of the MCU and the MPU.
The invention has the beneficial effects that: the invention realizes safe and reliable data transmission between the MCU and the MPU through 4 General-purpose input/output interfaces (GPIOs), and realizes data verification through software and hardware. The MCU is designed to be in a host mode and the MPU is designed to be in a slave mode in the process of realizing the system, and the host realizes safe and stable interaction with the MPU through the GPIO. The functions allocated by the 4 GPIOs are as follows: 1. the master requests data interaction with the slave (CS signal), 2, the clock signal (CLK signal) used for master control data transmission, 3, the data (DOUT signal) used for master transmission, 4, the data (DIN signal) used for MCU transmission returned to the receiving MPU and received by the MCU for verification that the data transmitted by the MCU is consistent with the data received by the MPU. If the received data are not consistent, the communication is abnormal, the transmission is stopped and the data are retransmitted, which is a method for verifying the data cooperatively by software and hardware, and ensures the reliability of the data.
Drawings
FIG. 1 is a block diagram of the connection between the MCU and the MPU according to the embodiment of the present invention;
in fig. 1:
CS: the chip selection signal transmitting end comprises an MCU, the receiving end comprises an MPU
CLK: clock signal transmitting terminal, MCU, receiving terminal, MPU
DOUT, data signal transmitting terminal, MCU, receiving terminal, MPU
DIN, data signal transmitting end MPU, receiving end MCU.
Fig. 2 is a timing diagram of communication between the MCU and the MPU according to an embodiment of the present invention.
In fig. 2:
length of CLK: the bit length of the transmission data is + 1. The clock period may be determined according to the actual design task, e.g. 1ms
MCUwb indicates when the MCU writes bit data to DOUT, rb indicates when the MCU reads bit data from DIN
MPUwb: indicating that the MPU reads data rb from DOUT at this time: indicating that the MPU writes data to DIN at this time
Detailed Description
The principles and features of this invention are described below in conjunction with the following drawings, which are set forth by way of illustration only and are not intended to limit the scope of the invention.
An interaction method between two chips, the two chips respectively refer to a signal control unit MCU and a signal display unit MPU in a vehicle-mounted instrument, comprises
Configuring a control signal channel of the MCU to the MPU, wherein the control signal comprises a chip selection signal and a clock signal;
Configuring a first data signal channel and a second data signal channel, wherein the first data channel is a data signal channel from an MCU (microprogrammed control Unit) end to an MPU (microprogrammed processing Unit) end, and the second data channel is a data signal channel from the MPU end to the MCU end;
the control signal channel, the first data signal channel and the second data signal channel are realized through universal input and output interfaces of the MCU and the MPU;
the on-off of the first data signal channel and the second data signal channel is controlled by the control signal. The MCU and MPU configuration structure is shown in fig. 1.
As shown in fig. 2, when the chip select signal is enabled, in two adjacent clock cycles of the clock signal:
in the previous clock period, the MCU sends data to the MPU through the first data signal channel; the MPU transmits the received data back to the MCU through a second data signal channel; in the clock period, when the clock signal is at a low level, the MCU writes data to be transmitted into the first data signal channel, and when the clock signal is at a high level, the MPU reads the data in the first data signal channel and writes the data into the second data signal channel.
In the latter clock cycle, the MCU receives the data returned by the MPU and compares the data with the data sent in the previous clock cycle, specifically, when the clock signal is at low level, the MCU reads the data in the second data signal channel and compares the data with the data sent in the previous clock cycle, if the data are consistent, the next data transmission is continued, otherwise, the MCU resets and resends the data, specifically: the MCU changes the high and low levels of the chip selection signal, enables the chip selection signal to be enabled again, and sends data to the MPU through the first data signal channel in the next clock period.
The invention realizes safe and reliable data transmission between the MCU and the MPU through 4 General-purpose input/output interfaces (GPIOs), and realizes data verification through software and hardware. The MCU is designed to be in a host mode and the MPU is designed to be in a slave mode in the process of realizing the system, and the host realizes safe and stable interaction with the MPU through the GPIO. The functions allocated by the 4 GPIOs are as follows: 1. the master requests data interaction with the slave (CS signal), 2, the clock signal (CLK signal) used for master control data transmission, 3, the data (DOUT signal) used for master transmission, 4, the data (DIN signal) used for MCU transmission returned to the receiving MPU and received by the MCU for verification that the data transmitted by the MCU is consistent with the data received by the MPU. If the received data are not consistent, the communication is abnormal, the transmission is stopped and the data are retransmitted, which is a method for verifying the data cooperatively by software and hardware, and ensures the reliability of the data.
The operation of the system is described by taking the transmitted data N as an example, and it is assumed that the length of the data N is L.
MCU sets CS to 0, the communication system is reset and does not work
The MCU sets CS to 1, and the MPU starts communicating with the MPU
MCU set CS 1
1 st clock:
the MCU sets CLK to be 0, and the MCU sets DOUT to be 0 th bit of N, N0;
the MCU sets CLK to be 1, the MPU acquires data of DOUT, DOUT _ N0;
after the fetch, the MPU will fetch the write DIN of DOUT _ N0.
The 2 nd clock:
the MCU sets CLK to be 0, acquires data of DIN, DIN _ N0;
if DIN _ N0! N0, the MCU sets CS to 0 and CS to 1, and resets retransmission;
if DIN _ N0 ═ N0, the MCU sets bit 1 of DOUT ═ N, N1;
the MCU sets CLK to be 1, the MPU acquires data of DOUT, DOUT _ N1;
after the fetch, the MPU will fetch the write DIN of DOUT _ N1.
Clock 3:
the second clock is repeated, and if there is a transmission/reception error in the middle, the transmission is performed from the 0 th bit.
L +1 th clock:
the MCU sets CLK to be 0, acquires data of DIN, DIN _ N (L-1);
if DIN _ N (L-1)! N (L-1), the MCU sets CS to 0, and CS to 1 resets retransmission;
if DIN _ N (L-1) ═ N (L-1), data N transmission by the MCU is complete.
The MCU stops transmitting with CS-0.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (5)
1. An interaction method between two chips, wherein the two chips respectively refer to a signal control unit MCU and a signal display unit MPU in a vehicle-mounted instrument, is characterized by comprising
Configuring a control signal channel of the MCU to the MPU, wherein the control signal comprises a chip selection signal and a clock signal;
configuring a first data signal channel and a second data signal channel, wherein the first data channel is a data signal channel from an MCU (microprogrammed control Unit) end to an MPU (microprogrammed processing Unit) end, and the second data channel is a data signal channel from the MPU end to the MCU end;
the on-off of the first data signal channel and the second data signal channel is controlled by the control signal; the control signal channel, the first data signal channel and the second data signal channel are realized through universal input and output interfaces of the MCU and the MPU.
2. The method of claim 1, further comprising:
when the chip selection signal is enabled, in two adjacent clock cycles of the clock signal:
in the previous clock period, the MCU sends data to the MPU through the first data signal channel; the MPU transmits the received data back to the MCU through a second data signal channel;
and in the next clock period, the MCU receives the data returned by the MPU and compares the data with the data sent in the previous clock period, if the data are consistent, the next data is sent continuously, otherwise, the MCU resets and resends the data.
3. The method of claim 2, wherein in the previous clock cycle, the MCU sends data to the MPU via the first data signal path; the MPU transmits the received data back to the MCU through a second data signal channel, and comprises:
in the clock period, when the clock signal is at a low level, the MCU writes data to be transmitted into the first data signal channel, and when the clock signal is at a high level, the MPU reads the data in the first data signal channel and writes the data into the second data signal channel.
4. The method according to claim 2, wherein in the latter clock cycle, the MCU receives the data returned from the MPU and compares the data with the data sent in the previous clock cycle, and if the data are consistent, the method continues to send the next data, comprising:
in the clock period, when the clock signal is at low level, the MCU reads the data in the second data signal channel and compares the data with the data sent in the previous clock period, and if the data are consistent, the MCU writes the next data to be sent into the first data signal channel.
5. The method according to any of claims 2-4, wherein the MCU resets and retransmits data, in particular: the MCU changes the high and low levels of the chip selection signal, enables the chip selection signal to be enabled again, and sends data to the MPU through the first data signal channel in the next clock period.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010538890.7A CN111858421A (en) | 2020-06-13 | 2020-06-13 | Interaction method between double chips |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010538890.7A CN111858421A (en) | 2020-06-13 | 2020-06-13 | Interaction method between double chips |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111858421A true CN111858421A (en) | 2020-10-30 |
Family
ID=72986833
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010538890.7A Pending CN111858421A (en) | 2020-06-13 | 2020-06-13 | Interaction method between double chips |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111858421A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101055553A (en) * | 2006-04-14 | 2007-10-17 | 乐金电子(昆山)电脑有限公司 | Serial interface communication method and system for peripheral device of PDA and host CPU and peripheral apparatus |
CN101520744A (en) * | 2009-03-31 | 2009-09-02 | 上海远景数字信息技术有限公司 | Self-checking serial communication system and self-checking method thereof |
CN104253900A (en) * | 2013-06-28 | 2014-12-31 | 展讯通信(上海)有限公司 | Smart phone and data transmission method and data transmission system thereof |
US20160246743A1 (en) * | 2013-10-02 | 2016-08-25 | Continental Automotive Gmbh | Communication system for inter-chip communication |
US20180188768A1 (en) * | 2016-12-30 | 2018-07-05 | Gn Audio A/S | Apparatus with inter-communicating processors |
-
2020
- 2020-06-13 CN CN202010538890.7A patent/CN111858421A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101055553A (en) * | 2006-04-14 | 2007-10-17 | 乐金电子(昆山)电脑有限公司 | Serial interface communication method and system for peripheral device of PDA and host CPU and peripheral apparatus |
CN101520744A (en) * | 2009-03-31 | 2009-09-02 | 上海远景数字信息技术有限公司 | Self-checking serial communication system and self-checking method thereof |
CN104253900A (en) * | 2013-06-28 | 2014-12-31 | 展讯通信(上海)有限公司 | Smart phone and data transmission method and data transmission system thereof |
US20160246743A1 (en) * | 2013-10-02 | 2016-08-25 | Continental Automotive Gmbh | Communication system for inter-chip communication |
US20180188768A1 (en) * | 2016-12-30 | 2018-07-05 | Gn Audio A/S | Apparatus with inter-communicating processors |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7328399B2 (en) | Synchronous serial data communication bus | |
US6772251B1 (en) | Bit interleaved data serial interface | |
CN108052473B (en) | Serial communication device | |
CN112380157A (en) | IIC bus communication device with FIFO cache and check function | |
CN102073611B (en) | I2C bus control system and method | |
CN107750358B (en) | Data processing method | |
US20200201804A1 (en) | I3c device timing adjustment to accelerate in-band interrupts | |
CN109284248A (en) | UART bus communication method, equipment and its functional module using UART bus communication | |
US10002090B2 (en) | Method for improving the performance of synchronous serial interfaces | |
CN115963891A (en) | Method, apparatus, storage medium, and device for synchronous serial communication delay compensation | |
CN113946480A (en) | Detection device and method for I2C bus | |
KR100924989B1 (en) | Transfer acknowledgement for a mobile scalable linkmsl architecture | |
US6678756B1 (en) | Method for controlling a first-in-first-out array to facilitate data transmissions between a lower frequency domain and a higher frequency domain of a computer system | |
CN111858421A (en) | Interaction method between double chips | |
CN116049081B (en) | SMBus slave digital module design method and device | |
CN116049054B (en) | Data read-write method and system of SPI slave device in cross-clock domain | |
CN107797956B (en) | Double edge triggering circular buffers and communication system | |
US8347013B2 (en) | Interface card with extensible input/output interface | |
CN116126771A (en) | Communication system and method for two-wire SPI | |
CN115563049A (en) | Method for implementing SPI sending mode assignment structure | |
US10572439B1 (en) | I3C read from long latency devices | |
CN107741920B (en) | Simplified data transmission method for needle selector | |
CN107391406B (en) | Microprocessor for protocol processing and protocol processing method | |
US11387941B2 (en) | Signal transceiving system and method | |
CN100531189C (en) | method for implementing communication protocol replacement and host interface device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20201030 |