CN100507892C - Communication method suitable for serial peripheral equipment interface bus - Google Patents
Communication method suitable for serial peripheral equipment interface bus Download PDFInfo
- Publication number
- CN100507892C CN100507892C CNB2004100740553A CN200410074055A CN100507892C CN 100507892 C CN100507892 C CN 100507892C CN B2004100740553 A CNB2004100740553 A CN B2004100740553A CN 200410074055 A CN200410074055 A CN 200410074055A CN 100507892 C CN100507892 C CN 100507892C
- Authority
- CN
- China
- Prior art keywords
- head
- frame
- subframe
- main equipment
- slave unit
- 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.)
- Expired - Fee Related
Links
- 238000004891 communication Methods 0.000 title claims abstract description 33
- 230000002093 peripheral effect Effects 0.000 title claims description 13
- 238000000034 method Methods 0.000 title abstract description 15
- 230000005540 biological transmission Effects 0.000 claims abstract description 29
- 230000001360 synchronised effect Effects 0.000 claims abstract description 16
- 239000003550 marker Substances 0.000 claims description 2
- 230000000694 effects Effects 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 3
- 238000010276 construction Methods 0.000 description 2
- 235000015429 Mirabilis expansa Nutrition 0.000 description 1
- 244000294411 Mirabilis expansa Species 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 235000013536 miso Nutrition 0.000 description 1
Images
Abstract
The method defines a length variable data frame including frame head and payload. Frame head defines variety of length. Mode of synchronous transmission is adopted between master device and slave devices. All transmission is initiated from the master device, and frame head of data frame is always sent from master device to slave devices. The disclosed method supports data transmission with addressing requirement between master device and slave devices. Using scheme of sub frame heads and length variable data frame in the structure of frame, the method supports communication in full duplex or half-duplex modes between master device and slave devices in high efficiency and raises transmission efficiency. Using synchronization scheme combining self-synchronization with forced synchronization in order to reach optimal effect in two sides: reliability and burden of master device
Description
Technical field
The present invention relates to the master-slave communication between the electronic installation, particularly a kind of serial peripheral equipment interface bus that is applicable to carries out the communication means of data transmission.
Background technology
Serial communication is a very important data communication mode between main equipment and the external unit.Compare with parallel communication bus, only need less data line.(SerialPeripheral Interface is a kind of synchronous serial bus that company of Motorola (Motorola) proposes SPI) to Serial Peripheral Interface, is used for the exchanges data between main equipment and the peripherals.
Spi bus is a master-slave communication mechanism, and main equipment is a main equipment, and peripherals is slave unit.It is made of 4 buses, is respectively serial time clock line (SCK), main equipment input/slave unit output data line (MISO), main equipment output/slave unit input data line (MOSI) and the effective selection wire of slave unit (SSN).Compare with other bus, the spi bus agreement is simple, signal wire is few, transfer rate is high and advantage such as full-duplex communication.
But spi bus is the physical layer protocol of no addressing function, can only carry out the transmission of point-to-point bit stream between main equipment and slave unit, and this then obviously is unappeasable for the data transmission that the addressing requirement is arranged.
At present, some EEPROM factories have proposed the upper-layer protocol of part based on spi bus.The frame of this upper-layer protocol is made of order, address and data as shown in Figure 1 successively, and the SSN high level is the beginning of a frame during to low level.
The shortcoming of this upper-layer protocol is not support full duplex transmission; Do not support SPI to interrupt transmission, require promptly that SSN must keep low level in the entire frame transmission course; And because its order and address size are fixed, therefore expense is big in the time of the transmission low volume data, and efficient is low.
Summary of the invention
The object of the present invention is to provide a kind of serial peripheral equipment interface bus that is applicable to carry out the communication means of data transmission, can support to have between main equipment and the slave unit data transmission of addressing requirement;
A further object of the present invention is to provide a kind of serial peripheral equipment interface bus that is applicable to carry out the communication means of data transmission, and it can change the length of frame structure according to the length of transmission data, to improve transfer efficiency;
Another object of the present invention is to provide a kind of serial peripheral equipment interface bus that is applicable to carry out the communication means of data transmission, can support to carry out between main equipment and the slave unit full duplex or half-duplex operation;
According to above-mentioned purpose of the present invention, the present invention proposes following scheme:
A kind of serial peripheral equipment interface bus that is applicable to carries out the communication means of data transmission, and its characteristics are:
Define a kind of adjustable length Frame, comprise frame head and payload, the variation of length is defined by frame head;
Adopt synchronous transfer module between main equipment and the slave unit;
All transmission are initiated by main equipment, and the frame head of Frame always sends to slave unit by main equipment.
According to above-mentioned communication means, other characteristics of the present invention are as follows:
The frame head of Frame can be made of one or more subframe heads;
The data bit LSHF that includes last subframe of definition zone bit in the described subframe head;
The data bit that includes a definition subframe attribute in the described subframe head by the different definition to this attribute bit, is judged as the subframe head and writes the subframe head and read the subframe head; Write the subframe head and be used to define the transformat that sends data to slave unit from main equipment; Read the subframe head and be used to define the transformat that sends data to main equipment from slave unit; When this attribute bit is 1, represent that this subframe head is for writing the subframe head; When this attribute bit was 0, this subframe head was for reading the subframe head;
If only comprise a kind of subframe head of attribute in the frame head of Frame, then be half-duplex operation; If include the subframe head of two kinds of different attributes in the frame head of Frame, then be full-duplex communication;
Described payload length is defined by the subframe head of correspondence;
Adopt slave unit motor synchronizing pattern between main equipment and the slave unit;
Adopt main equipment to force synchronous mode between main equipment and the slave unit;
Adopt slave unit motor synchronizing and main equipment to force synchronous combined synchronization pattern between main equipment and the slave unit.
The contrast prior art the invention has the advantages that:
The method of the invention can support to have between main equipment and the slave unit data transmission of addressing requirement;
By adopting a subframe scheme in the frame structure in the method for the invention, this method that makes can efficiently support to carry out between main equipment and the slave unit full duplex or half-duplex operation;
In addition, the frame structure of employing vary in length comprises that frame head and payload are all variable, adopts short frame head when the transmission low volume data, but improves feasible its variable data amount bearer service of high efficiency of transmission of transfer efficiency;
The method of the invention supports SPI to interrupt transmission, does not require that in the transmission course of entire frame SSN keeps low level always;
In communication means of the present invention, adopt in conjunction with motor synchronizing with force synchronous combined synchronization scheme, to guarantee in the effect that reaches the best aspect two of reliability and the main equipment burdens.
Above and other objects of the present invention, feature and advantage are from below in conjunction with accompanying drawing be not will become more obvious the specific descriptions of certain embodiments.
Description of drawings
Fig. 1 is a frame structure synoptic diagram used in the prior art upper-layer protocol;
The frame structure synoptic diagram of using in Fig. 2 the method for the invention;
The head construction synoptic diagram of frame in Fig. 3 the method for the invention;
The structural representation of Fig. 4 the method for the invention neutron frame head.
Specific embodiment
In the following description, known function or structure will no longer describe in detail, to avoid there be unnecessary obscuring with content of the present invention.
A kind of serial peripheral equipment interface bus that is applicable to carries out the communication means of data transmission, and its characteristics are:
Define a kind of adjustable length Frame, comprise frame head and payload, the variation of length is defined by frame head;
Adopt synchronous transfer module between main equipment and the slave unit;
All transmission are initiated by main equipment, and the frame head of Frame always sends to slave unit by main equipment.
Wherein, Frame is made of frame head and payload two parts, and payload is exactly the data that are transmitted, and its length is to change.As shown in Figure 2.Because the variable business of its carrying data volume in order to improve transfer efficiency, adopts adjustable length frame structure.In the method, frame head and payload are variable-length, and are defined by frame head.
The head construction of frame is made of one or more subframe heads as shown in Figure 3.The head of frame always sends to slave unit from main equipment.
The subframe header structure is as shown in Figure 4:
AD is the slave unit port address;
PHF is that the payload length most-significant byte is an effective marker; When this position was 1, expression payload length most-significant byte was effective, equals PH, and subframe head length degree is 3 bytes; When this position was 0, expression payload length most-significant byte was 0, and subframe head length degree is 2 bytes;
RW is used to define the attribute of book frame head.In the method, two seed frame heads are arranged, write the subframe head and read the subframe head.Write the subframe head and be used to define the transformat that sends data to slave unit from main equipment, read the subframe head and be used to define the transformat that sends data to main equipment from slave unit.When this position is 1, represent that this subframe head is for writing the subframe head; When this position was 0, this subframe head was for reading the subframe head; If frame head only comprises a kind temper frame head, then be half-duplex operation; If frame head includes 2 kinds of different attribute subframe heads, then be full-duplex communication.
PL is used to represent low 4 of payload length;
LSHF is last subframe zone bit.When this position was 1, expression book frame head was last subframe head; When this position was 0, expression book frame head was not last subframe head;
PH is used to represent the most-significant byte of payload length.These 8 is optionally, and is determined by PHF;
Res. be to keep the position.
Payload length is by the subframe head definition of correspondence, and the payload length of writing the definition of subframe head is exactly the byte number that sends to the data of slave unit from main equipment, and the payload length of reading the definition of subframe head is exactly the byte number that sends to the data of main equipment from slave unit.The variation range of payload length is from 1 to 4093 byte, and when payload length is not more than 15 bytes, the PHF position of subframe head is 0, and payload length equals PL, and when payload length during greater than 15 bytes, payload length equals PH * 16+PL.
The slave unit motor synchronizing is exactly automatically synchronous each frame of slave unit, and its method is after slave unit receives last byte of previous frame, changes the beginning of next frame automatically over to.This synchronization scenario advantage is exactly that synchronizing circuit is simple, need not main equipment and participates in; Shortcoming is a poor reliability, can not recover automatically after the step-out.
It is exactly that main equipment sends synchronizing signal synchronously that main equipment forces, and its method is that the main equipment transmission forces synchronizing signal FEN.The advantage of this synchronization scenario is the reliability height; Shortcoming is to need main equipment to participate in, and increases the main equipment burden.
In order to bring into play the advantage of these two kinds of synchronization scenarios, overcome its shortcoming, present embodiment adopts slave unit motor synchronizing and main equipment to force synchronous combined synchronization scheme.The combined synchronization scheme is exactly that main equipment sends one every some frames and forces synchronizing signal, forces slave unit synchronous.Do not send when forcing synchronizing signal at main equipment, slave unit is synchronous automatically.
The serial peripheral equipment interface bus that is applicable to of the present invention carries out the communication means of data transmission, be not restricted to listed utilization in instructions and the embodiment, it can be applied to various suitable the present invention's field fully, for those skilled in the art, can easily realize additional advantage and make amendment, therefore under the situation of the spirit and scope of the universal that does not deviate from claim and equivalency range and limited, the examples shown that the present invention is not limited to specific details, representational equipment and illustrates here and describe.
Claims (12)
1, a kind of serial peripheral equipment interface bus that is applicable to carries out the communication means of data transmission, it is characterized in that:
Define a kind of adjustable length Frame, comprise frame head and payload, the variation of length is defined by frame head;
Adopt synchronous transfer module between main equipment and the slave unit;
All transmission are initiated by main equipment, and the frame head of Frame sends to slave unit by main equipment;
The frame head of described Frame is made of one or more subframe heads, described payload length is defined by the subframe head of correspondence, the variation range of payload length is from 1 to 4093 byte, when payload length is not more than 15 bytes, the PHF position of subframe head is 0, payload length equals PL, and when payload length during greater than 15 bytes, payload length equals PH * 16+PL; Wherein: PHF is that the payload length most-significant byte is an effective marker; PL is used to represent low 4 of payload length; PH is used to represent the most-significant byte of payload length.
2, communication means according to claim 1 is characterized in that, when the PHF position was 1, expression payload length most-significant byte was effective, equals PH, and subframe head length degree is 3 bytes; When the PHF position was 0, expression payload length most-significant byte was 0, and subframe head length degree is 2 bytes.
3, communication means according to claim 1 is characterized in that, includes the data bit LSHF of last subframe of definition zone bit in the described subframe head; When this position was 1, expression book frame head was last subframe head; When this position was 0, expression book frame head was not last subframe head.
4, communication means according to claim 1 is characterized in that, includes the data bit of a definition subframe attribute in the described subframe head, by the different definition to this attribute bit, the subframe head is judged as writes the subframe head and read the subframe head.
5, communication means according to claim 4 is characterized in that, writes the subframe head and is used to define the transformat that sends data to slave unit from main equipment.
6, communication means according to claim 4 is characterized in that, reads the subframe head and is used to define the transformat that sends data to main equipment from slave unit.
7, communication means according to claim 4 is characterized in that, when this attribute bit is 1, represents that this subframe head is for writing the subframe head; When this attribute bit was 0, this subframe head was for reading the subframe head.
8, communication means according to claim 4 is characterized in that, if only comprise a kind of subframe head of attribute in the frame head of Frame, then is half-duplex operation.
9, communication means according to claim 4 is characterized in that, if include the subframe head of two kinds of different attributes in the frame head of Frame, then is full-duplex communication.
10, communication means according to claim 1 is characterized in that, adopts main equipment to force synchronous mode between main equipment and the slave unit, and promptly main equipment sends to slave unit and forces synchronizing signal.
11, communication means according to claim 1 is characterized in that, adopts slave unit motor synchronizing pattern between main equipment and the slave unit, promptly after slave unit receives last byte of previous frame, changes the beginning of next frame automatically over to.
12, communication means according to claim 1, it is characterized in that, adopt slave unit motor synchronizing and main equipment to force synchronous combined synchronization pattern between main equipment and the slave unit, promptly main equipment sends one every some frames and forces synchronizing signal, forces slave unit synchronous; Do not send when forcing synchronizing signal at main equipment, slave unit is synchronous automatically.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2004100740553A CN100507892C (en) | 2004-09-02 | 2004-09-02 | Communication method suitable for serial peripheral equipment interface bus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2004100740553A CN100507892C (en) | 2004-09-02 | 2004-09-02 | Communication method suitable for serial peripheral equipment interface bus |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1744069A CN1744069A (en) | 2006-03-08 |
CN100507892C true CN100507892C (en) | 2009-07-01 |
Family
ID=36139449
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2004100740553A Expired - Fee Related CN100507892C (en) | 2004-09-02 | 2004-09-02 | Communication method suitable for serial peripheral equipment interface bus |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100507892C (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2008089685A1 (en) * | 2007-01-21 | 2008-07-31 | Print-Rite Technology Development Co., Ltd Of Zhuhai | A communication apparatus, synchronization serial communication system and the method thereof |
US8103936B2 (en) * | 2007-10-17 | 2012-01-24 | Micron Technology, Inc. | System and method for data read of a synchronous serial interface NAND |
CN109522262B (en) * | 2018-10-10 | 2022-12-13 | 上海亚明照明有限公司 | Receiving method, system, electronic terminal and storage medium suitable for indefinite length data frame |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6229821B1 (en) * | 1997-04-22 | 2001-05-08 | At&T Corp. | Serial data transmission of variable length mini packets using statistical multiplexing |
CN1294798A (en) * | 1999-03-01 | 2001-05-09 | 松下电器产业株式会社 | Variable-length frame transmission device, and variable-length frame transmission method |
CN1319300A (en) * | 1999-05-27 | 2001-10-24 | 三星电子株式会社 | Apparatus and method for transmitting variable-length data according to radio link protocol in mobile communication system |
-
2004
- 2004-09-02 CN CNB2004100740553A patent/CN100507892C/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6229821B1 (en) * | 1997-04-22 | 2001-05-08 | At&T Corp. | Serial data transmission of variable length mini packets using statistical multiplexing |
CN1294798A (en) * | 1999-03-01 | 2001-05-09 | 松下电器产业株式会社 | Variable-length frame transmission device, and variable-length frame transmission method |
CN1319300A (en) * | 1999-05-27 | 2001-10-24 | 三星电子株式会社 | Apparatus and method for transmitting variable-length data according to radio link protocol in mobile communication system |
Also Published As
Publication number | Publication date |
---|---|
CN1744069A (en) | 2006-03-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101504633B (en) | Multi-channel DMA controller | |
CN1713164A (en) | DMA controller and data transmission with multi-transaction discretionary process | |
CN103346977A (en) | Dynamic allocation method for data resources | |
CN102147778B (en) | Data transmission system based on half-duplex serial bus and transmission control method | |
KR20120055034A (en) | Apparatus for connecting peripheral device in portable terminal using serial peripheral interface and method for transmitting data | |
JP3835459B2 (en) | Data transfer control device and electronic device | |
CN103092806A (en) | Data transmission method and data transmission system based on serial peripheral interface (SPI) data transmission timing sequences | |
CN103605625A (en) | Nor Flash chip control method based on AXI bus | |
CN101963947A (en) | Universal serial bus transmission transaction translator and transmission method in large amount | |
CN1744068B (en) | Master apparatus and slave apparatus combined synchronous realization method | |
CN100389413C (en) | Serial communiction bus external equipment interface | |
CN100507892C (en) | Communication method suitable for serial peripheral equipment interface bus | |
CN101415027B (en) | Communication module based on HDLC protocol, and control method for data real time forwarding and storage | |
US9678904B2 (en) | PCI express data transmission | |
CN106339348A (en) | Data transmission method and device based on mobile terminal interface extension | |
CN101655825B (en) | Device for achieving LPC-USB two-way communication by using FPGA and data conversion method of LPC-US and USB-LPC | |
EP2750046A2 (en) | Media peripheral interface, electronic device with media peripheral interface, and communication method between processor and peripheral device | |
CN103034610A (en) | Methods and devices for transmission and reception of advanced extensible interface (AXI) bus signal between split modules | |
CN111026691A (en) | OWI communication equipment based on APB bus | |
CN113722261A (en) | Method for expanding chip selection number and enhancing flexibility of read-write response time by SPI | |
JP3786121B2 (en) | Data transfer control device and electronic device | |
CN101261615B (en) | Computer dot-to-dot direct EMS memory communication method and its network card | |
CN101976230A (en) | Transaction translator of universal serial bus and input request isochronous transaction method | |
CN102981988B (en) | Data transfer equipment and data transferring method | |
CN114116559B (en) | High-speed bus method suitable for PLC application |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
C17 | Cessation of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20090701 Termination date: 20120902 |