KR101447154B1 - Universal spi core using fpga and operation method thereof - Google Patents
Universal spi core using fpga and operation method thereof Download PDFInfo
- Publication number
- KR101447154B1 KR101447154B1 KR1020130136899A KR20130136899A KR101447154B1 KR 101447154 B1 KR101447154 B1 KR 101447154B1 KR 1020130136899 A KR1020130136899 A KR 1020130136899A KR 20130136899 A KR20130136899 A KR 20130136899A KR 101447154 B1 KR101447154 B1 KR 101447154B1
- Authority
- KR
- South Korea
- Prior art keywords
- signal
- spi
- core
- communication
- spi core
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F1/00—Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
- G06F1/04—Generating or distributing clock signals or signals derived directly therefrom
- G06F1/06—Clock generators producing several clock signals
-
- 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/10—Program control for peripheral devices
- G06F13/12—Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor
- G06F13/124—Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor where hardware is a sequential transfer control unit, e.g. microprocessor, peripheral processor or state-machine
Abstract
Description
The present invention relates to a general-purpose SPI core operating method, and more particularly, to a general-purpose SPI core operating method that can be implemented using an FPGA.
The Serial to Peripheral Interface (SPI) is a synchronous serial data connection standard that operates in architecture full duplex communication mode, and is a serial peripheral interface. SPI is one of the serial communication methods used to transfer data at high speed between CPU and multiple CPUs or between CPU and many peripheral devices. In order to use SPI communication, devices operate as one of master and slave with built-in SPI core (SPI Core) to support SPI communication. Master uses SPI communication with several slave devices and individual chip select lines Can be performed. That is, a plurality of slaves can be connected to one master, and the master performs communication in a form of selecting one of a plurality of slaves using a chip select line.
The SPI is a four-wire serial communication interface that communicates over four signal lines and specifies four logic signals corresponding to four signal lines. The four logic signals are SCLK (Serial Clock or CLK), MOSI (Mater Output Slave Input or SDI, DI, DIN, SI), MISO (Maternal Input Slave Output or SDO, DO, DOUT, SO) SS, CSB, CSN, STE).
SCLK is a clock signal for synchronization between the master and the slave, generated by the master and transmitted to the slave. MOSI and MISO are signals for data transmission and reception, and MOSI is a signal output from a master and input to a slave. MISO is a signal that is output from the slave and input to the master as opposed to MOSI. And CS is a slave selection signal as a slave selection signal as described above.
1 is a diagram showing the concept of a clock polarity setting signal and a phase setting signal of SPI communication.
The SPI control register included in the SPI core is configured to set the clock polarity setting signal CPOL and the phase setting signal CPHA. In this case, the clock polarity setting signal CPOL is a value for designating the polarity of the clock, and the phase setting signal CPHA is a value for specifying the clock phase. If CPOL = 1, ), It starts at HIGH. When CPOL = 0, the synchronous clock (SCK) starts at LOW. That is, the bit for selecting the start of the synchronous clock signal SCK is the clock polarity setting signal CPOL.
For example, as shown in FIG. 1, when the phase setting signal CPHA is 1 and the clock polarity is 1, When the set signal CPOL is 1, a data latch occurs at the rising edge. When the phase setting signal CPHA is 1 and the clock polarity setting signal CPOL is 0, data latch occurs at the falling edge, If the signal CPHA is 0 and the clock polarity setting signal CPOL is 1 on the falling edge, if the phase setting signal CPHA is 0 and the clock polarity setting signal CPOL is 0, the data latch occurs at the rising edge.
However, in the conventional SPI core, the value of the clock polarity setting signal (CPOL) and the phase setting signal (CPHA) of the control register are designed in advance as one value. Therefore, since the SPI communication between the devices having different values of the clock polarity setting signal CPOL and the phase setting signal CPHA can not be performed, the values of the clock polarity setting signal CPOL and the phase setting signal CPHA are There is a problem that the same SPI core needs to be redesigned. In other words, it is troublesome to always modify the SPI core to support SPI communication between devices in which the values of the clock polarity setting signal (CPOL) and the phase setting signal (CPHA) do not match.
It is an object of the present invention to provide an operation method of an SPI core implemented in an FPGA so that a set value can be changed corresponding to use conditions of various SPI devices.
According to another aspect of the present invention, there is provided a method of operating an SPI core, the method comprising: receiving a signal from an SPI core having an SPI logic unit, a counter, and a synchronous clock generator, The SPI core receiving a control signal including a clock polarity setting signal and a phase setting signal from the apparatus and determining a level of the clock polarity setting signal; Setting an initial level of a synchronous clock for synchronization between the SPI core and at least one other device communicating with the device according to the level of the clock signal; A standby state in which the SPI core initializes a setting for performing communication between the apparatus and the at least another apparatus; Determining whether the SPI core is a signal for activating communication of the SPI core; In response to a selection input signal applied at the device for selecting the SPI core to communicate with the device and to perform another SPI communication with the SPI core, And toggling the synchronous clock whose initial level is set; Determining the sampling phase of data to be transmitted by the SPI core to the at least one other device according to the level of the phase setting signal and transmitting and receiving data with the at least one other device in accordance with the determined sampling phase; Determining whether the number of data transmitted and received by the SPI core reaches a value of the number of transmissions specified by the control signal; The SPI core activating a transmission completion signal to 1 and outputting the transmission completion signal to the device when the number of transmitted and received data reaches the number of transmission times, and deactivating the activated slave selection signal; Determining whether the SPI core is to deactivate the SPI communication in response to the control signal; And re-entering the idle state if the SPI communication is deactivated; .
Initializing a unit communication completion signal indicating completion of a unit communication every time communication of a predetermined unit is completed with a transmission number value for setting a number of times of performing transmission in a predetermined unit; And deactivating at least one slave selection signal for selecting one of the at least one other device to perform SPI communication with the device; And a control unit.
Wherein the step of determining whether the communication activation signal is a signal for activating the communication comprises activating a selection input signal for activating one of the at least one slave selection signal and applying a counter for activating the counter and the synchronous clock generation unit, And the logic execution signal for activating the SPI logic unit are all activated.
Wherein the SPI core activates a unit communication completion signal indicating that the unit communication is completed and maintains the transmission completion signal in an inactive state when the number of the transmitted and received data is less than the number of transmissions, And further comprising:
Wherein the step of determining whether the SPI communication is to be deactivated comprises: the SPI core deactivates the select input signal, deactivates the counter and clock execution signal and the logic execution signal to zero, and initializes the count values stored in the counter It is determined that the SPI communication is inactivated when the counter initialization signal for activating the counter initialization signal to 1 is activated.
The method of operating the SPI core includes: maintaining the unit communication completion signal in an active state and maintaining the transmission completion signal in an inactive state if the SPI communication is not inactivated; And further comprising:
The method of operating the SPI core includes counting a reset count value among the count values regardless of an operation state of the current SPI core when the SPI core is initially driven or a reset signal is applied from the device to the SPI core, Determining whether the time is reached; And further comprising:
Therefore, in the method of operating the general-purpose SPI core using the FPGA of the present invention, the SPI core receives a control signal designating various settings from a corresponding device having an SPI core and outputs a clock polarity setting signal CPOL or a phase setting signal CPHA), so that the corresponding device can directly designate various settings. Therefore, it is possible to have versatility in comparison with a conventional SPI core that operates only in accordance with a predetermined set value. Also, since it is implemented in FPGA, it can be easily included in various devices and can be easily modified later.
1 is a diagram showing the concept of a clock polarity setting signal and a phase setting signal of SPI communication.
2 shows a structure of an SPI core according to an embodiment of the present invention.
3 is a detailed view showing the operation of each configuration of the SPI core of FIG.
4 illustrates a method of operating an SPI core in accordance with an embodiment of the present invention.
In order to fully understand the present invention, operational advantages of the present invention, and objects achieved by the practice of the present invention, reference should be made to the accompanying drawings and the accompanying drawings which illustrate preferred embodiments of the present invention.
Hereinafter, the present invention will be described in detail with reference to the preferred embodiments of the present invention with reference to the accompanying drawings. However, the present invention can be implemented in various different forms, and is not limited to the embodiments described. In order to clearly describe the present invention, parts that are not related to the description are omitted, and the same reference numerals in the drawings denote the same members.
Throughout the specification, when an element is referred to as "including" an element, it does not exclude other elements unless specifically stated to the contrary. The terms "part", "unit", "module", "block", and the like described in the specification mean units for processing at least one function or operation, And a combination of software.
FIG. 2 shows a structure of an SPI core according to an embodiment of the present invention, for example, an
Referring to FIG. 2, the
In the
Accordingly, the
3 is a detailed view showing the operation of each configuration of the SPI core of FIG.
3, the
Meanwhile, the
Here, the bit count value BIT_CNT is a count value used for determining the data shift and the sampling timing in the
The synchronous
The
Also, the
The
3, the
FIG. 4 illustrates a method of operating an SPI core according to an embodiment of the present invention, and illustrates an operation method according to a state machine technique.
The
4, when the
If the clock polarity setting signal CPOL is 0, the initial level of the synchronous clock SCLK is set to the low level L (S13). However, if the clock polarity setting signal CPOL is 1, the initial level of the synchronous clock SCLK is set to the high level H (S14). Then, it is kept in the standby state (S15). In the standby state, the
Then, the
If the
Thereafter, the
Then, it is determined whether the number of data transmitted / received reaches the number of transmission times (BCNT) (S21). The
On the other hand, if the number of transmitted / received data reaches the number of transmission times (BCNT) and the transmission completion signal CHK_FIN is activated to 1, it is determined whether communication of the
Although not shown in FIG. 4, the
Also, although the activation and deactivation states of the respective signals are described as 0 or 1 in the above description, the activation and deactivation state values may vary depending on the
As described above, if each operation of the
The method according to the present invention can be implemented as a computer-readable code on a computer-readable recording medium. A computer-readable recording medium includes all kinds of recording apparatuses in which data that can be read by a computer system is stored. Examples of the recording medium include a ROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like, and a carrier wave (for example, transmission via the Internet). The computer-readable recording medium may also be distributed over a networked computer system so that computer readable code can be stored and executed in a distributed manner.
While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, it is evident that many alternatives, modifications and variations will be apparent to those skilled in the art.
Accordingly, the true scope of the present invention should be determined by the technical idea of the appended claims.
Claims (7)
The SPI core receiving a control signal including a clock polarity setting signal and a phase setting signal from the apparatus and determining a level of the clock polarity setting signal;
Setting an initial level of a synchronous clock for synchronization between the SPI core and at least one other device communicating with the device according to the level of the clock signal;
A standby state in which the SPI core initializes a setting for performing communication between the apparatus and the at least another apparatus;
Determining whether the SPI core is a signal for activating communication of the SPI core;
In response to a selection input signal applied at the device for selecting the SPI core to communicate with the device and to perform another SPI communication with the SPI core, And toggling the synchronous clock whose initial level is set;
Determining the sampling phase of data to be transmitted by the SPI core to the at least one other device according to the level of the phase setting signal and transmitting and receiving data with the at least one other device in accordance with the determined sampling phase;
Determining whether the number of data transmitted and received by the SPI core reaches a value of the number of transmissions specified by the control signal;
The SPI core activating a transmission completion signal to 1 and outputting the transmission completion signal to the device when the number of transmitted and received data reaches the number of transmission times, and deactivating the activated slave selection signal;
Determining whether the SPI core is to deactivate the SPI communication in response to the control signal; And
Re-entering the idle state if the SPI communication is deactivated; / RTI > of the SPI core.
Initializing a unit communication completion signal indicating completion of unit communication every time communication of a predetermined unit is completed with a transmission number value for setting a number of times of performing transmission in a predetermined unit; And
Deactivating at least one slave selection signal for selecting one of the at least one other device to perform SPI communication with the device; The method comprising the steps of:
A selection input signal for activating one of the at least one slave selection signal is activated and applied at the device, and a counter for activating the counter and the synchronous clock generator and a logic execution signal for activating the SPI logic unit Wherein the signal is a signal for activating the communication when all the signals are activated.
The SPI core activating a unit communication completion signal indicating that the unit communication is completed and keeping the transmission completion signal in an inactive state if the number of the transmitted and received data is less than the number of transmission times; Further comprising the step of:
The SPI core deactivates the selection input signal, the counter and clock execution signal and the logic execution signal are deactivated to zero, and when the counter initialization signal for initializing the count values stored in the counter is activated to 1, Is deactivated. ≪ Desc / Clms Page number 24 >
Maintaining the unit communication completion signal in an active state and keeping the transmission completion signal in an inactive state if the SPI communication is not inactivated; Further comprising the step of:
Counting a reset count value among the count values regardless of an operation state of the current SPI core when the SPI core is initially driven or a reset signal is applied from the device to the SPI core to determine whether a preset stabilization time has been reached ; Further comprising the step of:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020130136899A KR101447154B1 (en) | 2013-11-12 | 2013-11-12 | Universal spi core using fpga and operation method thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020130136899A KR101447154B1 (en) | 2013-11-12 | 2013-11-12 | Universal spi core using fpga and operation method thereof |
Publications (1)
Publication Number | Publication Date |
---|---|
KR101447154B1 true KR101447154B1 (en) | 2014-10-06 |
Family
ID=51996508
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020130136899A KR101447154B1 (en) | 2013-11-12 | 2013-11-12 | Universal spi core using fpga and operation method thereof |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR101447154B1 (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110060856A1 (en) | 2009-09-09 | 2011-03-10 | Hon Hai Precision Industry Co., Ltd. | Spi control device and method for accessing spi slave devices using the same |
CN202870808U (en) | 2012-07-04 | 2013-04-10 | 四川九洲电器集团有限责任公司 | FPGA realization device of SPI serial port module |
-
2013
- 2013-11-12 KR KR1020130136899A patent/KR101447154B1/en active IP Right Grant
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110060856A1 (en) | 2009-09-09 | 2011-03-10 | Hon Hai Precision Industry Co., Ltd. | Spi control device and method for accessing spi slave devices using the same |
CN202870808U (en) | 2012-07-04 | 2013-04-10 | 四川九洲电器集团有限责任公司 | FPGA realization device of SPI serial port module |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102384347B1 (en) | System on chip includiing clock management unit and operating method thereof | |
US9244872B2 (en) | Configurable communications controller | |
US7900078B1 (en) | Asynchronous conversion circuitry apparatus, systems, and methods | |
JP7212687B2 (en) | serial communication device | |
US9515686B2 (en) | Signal transmitting circuit using common clock, and storage device therewith | |
EP3039559B1 (en) | Configurable clock tree | |
CN105468548B (en) | Communication of serial peripheral interface | |
EP3323051B1 (en) | Spi interface with less-than-8-bit bytes and variable packet size | |
KR20170084043A (en) | Multi-channel i²s transmit control system and method | |
WO2016095435A1 (en) | Multi-chip cascading method, chip and device, and storage medium | |
KR102453113B1 (en) | Signal transmitting circuit reducing power at standby state | |
KR102101840B1 (en) | Universal serial interface and semiconductor device comprising the same | |
Hafeez et al. | IP core of Serial Peripheral Interface (SPI) with AMBA APB interface | |
US10002090B2 (en) | Method for improving the performance of synchronous serial interfaces | |
US11288223B2 (en) | Bridge chip with function of expanding external devices and associated expansion method | |
KR101447154B1 (en) | Universal spi core using fpga and operation method thereof | |
US20200212903A1 (en) | Operation method of signal receiver, pulse width controller, and electronic device including the same | |
US6032204A (en) | Microcontroller with a synchronous serial interface and a two-channel DMA unit configured together for providing DMA requests to the first and second DMA channel | |
KR101506279B1 (en) | Universal spi core using fpga | |
JP3651588B2 (en) | Data processing system with adjustable clock for a segmented synchronization interface | |
US20220327086A1 (en) | Bus system | |
CN115632903A (en) | Virtual peripheral communication bus control method and device and computer equipment | |
US11880332B2 (en) | Bus system with controllable communication priority | |
KR101345437B1 (en) | Interfacing apparatus and method for communication between chips | |
Ramesh et al. | Study of I2C Communication Protocol Using Nuvoton Microcontroller Device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
E701 | Decision to grant or registration of patent right | ||
GRNT | Written decision to grant | ||
FPAY | Annual fee payment |
Payment date: 20170720 Year of fee payment: 4 |
|
FPAY | Annual fee payment |
Payment date: 20180710 Year of fee payment: 5 |
|
FPAY | Annual fee payment |
Payment date: 20190731 Year of fee payment: 6 |