Serial peripheral interface (be like,SPI) is small controller and periphery IC(register of sensor, ADC, DAC, shift, SRAM) between use one of the most extensive interface. The article first interface of brief specification SPI, introduce ADI company to support the imitate switch of SPI and multichannel converter next, and how are they helped reduce a system the digital GPIO amount in circuit board design.
SPI is interface of type of a kind of synchronism, full duplex operation, principal and subordinate. Come from lead plane or rise in clock from the data of machine edge or drop the edge is synchronous. Lead plane and from machine is OK transmit data at the same time. SPI interface can be 3 lines type or 4 lines type. Article key introduces interface of commonly used 4 lines SPI.
Graph 1. Contain lead plane and configure from the SPI of machine
Parts of an apparatus of 4 lines SPI has 4 signal:
? 7? 8 clock (SPI CLK, SCLK)
? 7? 8 are chosen (CS)
? 7? Output of 8 lead plane, from machine input (MOSI)
? 7? Input of 8 lead plane, from machine output (MISO)
The parts of an apparatus or appliance that produces clock signal calls leader. Lead plane and the clock that produce from the data that transmits between machine and lead plane are synchronous. Compare with I2C interface photograph, SPI parts of an apparatus supports taller clock frequency. The user should consult product data manual in order to understand the clock frequency norms of SPI interface.
SPI interface can have a leader only, but can have one or more from machine. Graph 1 showed lead plane is mixed join from the SPI between machine.
Come from lead plane piece choose signal to be used at the choice from machine. This is a low n normally effective signal, pull tall when disconnect from machine and SPI bus line join. Should use many from machine, lead plane needs to be every from machine offer alone piece pick signal. In the article piece picking signal is low n from beginning to end effective signal.
MOSI and MISO are data line. MOSI transmits data from lead plane from machine, MISO general data from from machine send lead plane.
Number is defeated as it is said
Want to begin SPI communication, lead plane must send clock signal, pass make can CS signal chooses from machine. Piece choosing is low n normally effective signal. Accordingly, lead plane must send logic on this signal 0 in order to choose from machine. SPI is interface of full duplex operation, lead plane and from machine is OK transmit data at the same time through MOSI and MISO circuitry respectively. During SPI corresponds, of data send (serial move give MOSI/SDO bus line to go up) and receive (sampling or read in bus line (the data on MISO/SDI) ) undertake at the same time. The shift of data of synchronism of serial clock edge and sampling. The ascendant edge that SPI interface allows to use an agile choice clock or drop the edge comes sampling and / or shift data. Be about to use the data digit that SPI interface transmits certainly, consult please manual of data of parts of an apparatus.
Clock polarity and clock are phasic
In SPI, lead plane can choose clock polarity and clock phasic. During unwanted position, CPOL the polarity that installs clock signal. Unwanted position is to point to transmit in the begining CS is tall n and transforming to low n during, and the CS when transmission end is low n and transforming to tall n during. CPHA choice clock is phasic. According to CPHA condition, use clock ascendant edge or drop the edge comes sampling and / or shift data. Lead plane needs beard basis chooses clock polarity and clock from the requirement of machine phasic. According to CPOL and CPHA choice, mode of 4 kinds of SPI can be used. Watch 1 showed pattern of these 4 kinds of SPI.
Express 1. Pass CPOL and mode of CPHA choice SPI
The clock polarity below unwanted position of SPI mode CPOLCPHA is used at sampling to mix / or the clock of shift data is phasic
Data of 000 logistic low n is rising edge sampling, in drop the edge moves piece
Data of 101 logistic low n is in drop edge sampling, move in ascendant edge piece
Data of 211 logistic low n is in drop edge sampling, move in ascendant edge piece
Data of 310 logistic low n is rising edge sampling, in drop the edge moves piece
Graph 2 to the graph the 5 communication give a demonstration that showed mode of 4 kinds of SPI falls. In these give typical examples, data shows go up in MOSI and MISO line. Transmission beginning and end express with green dotted line, dotted line of orange of sampling edge continue to use expresses, dotted line of blue of shift edge continue to use expresses. Ask an attention, these graphs offer reference only. Want to undertake SPI corresponds successfully, the user must consult product data manual ensures the sequential norms of contented parts of an apparatus.
Graph 2.SPI mode 0, CPOL = 0, CPHA = 0: Low n of = of CLK unwanted position, data is rising edge sampling, be in drop the edge moves piece.
Graph 3.SPI mode 1, CPOL = 0, CPHA = 1: Low n of = of CLK unwanted position, data is in drop edge sampling, move in ascendant edge piece.
Graph 4.SPI mode 2, CPOL = 1, CPHA = 1: Tall n of = of CLK unwanted position, data is in drop edge sampling, move in ascendant edge piece.
Graph 5.SPI mode 3, CPOL = 1, CPHA = 0: Tall n of = of CLK unwanted position, data is rising edge sampling, be in drop the edge moves piece.
Graph 3 gave out SPI mode the sequential chart of 1. Here mode falls, clock polarity is 0, the disengaged state that represents clock signal is low n. The clock below this mode is phasic for 1, state data is in drop edge sampling (show) by orange dotted line, and data moves in the ascendant edge of clock signal go out (show) by blue dotted line.
Graph 4 gave out SPI mode the sequential chart of 2. Here mode falls, clock polarity is 1, the disengaged state that represents clock signal is tall n. The clock below this mode is phasic for 1, state data is in drop edge sampling (show) by orange dotted line, and data moves in the ascendant edge of clock signal go out (show) by blue dotted line.
Graph 5 gave out SPI mode the sequential chart of 3. Here mode falls, clock polarity is 1, the disengaged state that represents clock signal is tall n. The clock below this mode is phasic for 0, state data is rising edge sampling (show) by orange dotted line, and data is in the fall of clock signal the edge moves piece (show) by blue dotted line.
Much from machine configuration
Many from machine can use together with individual SPI lead plane. From machine is OK use groovy mode to join, or use connection of chrysanthemum catenary mode.
Graph 6. Configure from machine SPI more
Groovy SPI mode:
Below groovy mode, lead plane needs to be every from machine offer alone piece pick signal. Once lead plane makes can (pull low) piece pick signal, MOSI/MISO on-line clock and data can use at place to choose from machine. If make can many pick signal, criterion MISO on-line data can be destroyed, because lead plane cannot identify which from machine transmitting data.
From the graph 6 can see, as the addition from machine amount, come from a chooses a route amount of lead plane also increase. This meeting increases lead plane to need offerred input and output amount quickly, restrict what can use from machine amount. Can use other technology to increase groovy mode to fall from machine amount, use multichannel answer to use for example implement generation piece pick signal.
Chrysanthemum catenary mode:
Graph 7. Configure from catenary of machine SPI chrysanthemum more
Below chrysanthemum catenary mode, all from of machine piece choose signal to join together, data from arrive from machine transmission next from machine. In be being configured here, all from machine receive same SPI clock at the same time. The data that comes from lead plane sends the first directly from machine, should offer the next from machine general data from machine, the rest may be deduced by analogy.
When using this method, because data is from one arrives from machine transmission next from machine, in the clock periodicity that so transmission data place needs and chrysanthemum catenary become scale from seat number buy. It is for example in 8 systems that the graph shows 7 times, to make the 3rd obtains data quite from function, need 24 clock pulse, and 8 clock pulse needs only below groovy SPI mode. Graph 8 showed clock cycle and the data that pass chrysanthemum catenary travel. Be not all SPI parts of an apparatus to support chrysanthemum catenary pattern. Consult whether product data manual can be used with affirming chrysanthemum catenary please.
Graph 8. Chrysanthemum catenary configures: Data travels
ADI company supports the imitate switch of SPI and multichannel converter
The switch of SPI of support of ADI company newest generation is not affecting the circumstance of accurate switch function to fall to save a space significantly. This one part of the article will discuss a check study, the specification supports the switch of SPI or multichannel answer is used implement the GPIO amount that how can simplify to systematic level is designed and reduce place to need greatly.
ADG1412 is sheet of a 4 passageways, short-hilted broadsword casts (SPST) switch, need 4 GPIO to join the control of every switch is inputted. Graph 9 demonstrated small controller and a link between ADG1412.
Graph 9. Small controller GPIO uses as the control signal of switch.
As circuit board go up the addition of switch amount, the amount that requires GPIO also can increase significantly. For example, when should designing system of instrument of a test, can use a large number of switch to increase the passageway in the system to count. In configuration of 4×4 crossing matrix, use 4 ADG1412. This system needs 16 GPIO, restricted the usable GPIO in standard small controller. Graph 10 showed 16 GPIO that use small controller join 4 ADG1412.
To reduce GPIO amount, a kind of method is to use serial turn collateral converter, if pursue,11 are shown. The collateral signal that this parts of an apparatus outputs can join switch control is inputted, parts of an apparatus can pass configuration of serial interface SPI. The defect of this method is adscititious parts of an apparatus can bring about stock detailed account to increase.
Another kind of method is switch of use SPI pilot. The advantage of this method is the amount that can reduce place to need GPIO, and still can be eliminated adscititious and serial turn the expense of collateral converter. If the graph is shown 12 times, do not need GPIO of 16 small controller, need GPIO of 7 small controller to be able to provide SPI signal to 4 ADGS1412 only.
Switch can use chrysanthemum catenary configuration, with optimizing GPIO amount further. In chrysanthemum catenary configuration, no matter the system uses how many switch, use lead plane only (small controller) 4 GPIO.
Graph 10. In how from inside machine configuration, the amount that requires GPIO increases considerably.
Graph 11. Use serial turn of collateral converter much from machine switch
Graph 12. The switch that supports SPI saves small controller GPIO
Graph 13. The SPI switch that chrysanthemum catenary configures can optimize GPIO further.
Graph 13 use at showing an intent. Proposal of ADGS1412 data manual is brought in SDO one is used to go up on the foot help resistance. About the more information of chrysanthemum catenary mode, consult please ADGS1412 data manual. For simple for the purpose of, this give typical examples used 4 switch. As the addition of amount of the switch in the system, circuit board is mixed simply the good point of economic space is very main. Switch of SPST of 8 4 passageways is placed on 6 circuit board, when using 4×8 crossing to configure, the switch of SPI of ADI company support can save the total circuit of 20% board space. Configuration of switch of article “ accurate SPI raised passageway density ” to define how does configuration of accurate SPI switch increase passageway density. ADI company offers a variety of imitate switch that support SPI and multichannel converter.
ADuCM3029 data manual. ADI company, in March 2017.
Nugent, stephen. Configuration of switch of “ accurate SPI raises passageway density ” . ” imitate speaks ” , in May 2017.
Usach, miguel. Apply note AN-1248: SPI interface. ADI company, in September 2015.