CN112242169B - Method for adjusting sampling phase and serial flash memory controller - Google Patents

Method for adjusting sampling phase and serial flash memory controller Download PDF

Info

Publication number
CN112242169B
CN112242169B CN201910640015.7A CN201910640015A CN112242169B CN 112242169 B CN112242169 B CN 112242169B CN 201910640015 A CN201910640015 A CN 201910640015A CN 112242169 B CN112242169 B CN 112242169B
Authority
CN
China
Prior art keywords
signal
delay
phase difference
clock signal
data 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.)
Active
Application number
CN201910640015.7A
Other languages
Chinese (zh)
Other versions
CN112242169A (en
Inventor
华杰
李明扬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Jiekai Technology Co ltd
Original Assignee
Wuhan Jiekai Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Wuhan Jiekai Technology Co ltd filed Critical Wuhan Jiekai Technology Co ltd
Priority to CN201910640015.7A priority Critical patent/CN112242169B/en
Publication of CN112242169A publication Critical patent/CN112242169A/en
Application granted granted Critical
Publication of CN112242169B publication Critical patent/CN112242169B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C16/00Erasable programmable read-only memories
    • G11C16/02Erasable programmable read-only memories electrically programmable
    • G11C16/06Auxiliary circuits, e.g. for writing into memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • G06F13/4291Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus using a clocked protocol
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0658Controller construction arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03LAUTOMATIC CONTROL, STARTING, SYNCHRONISATION OR STABILISATION OF GENERATORS OF ELECTRONIC OSCILLATIONS OR PULSES
    • H03L7/00Automatic control of frequency or phase; Synchronisation
    • H03L7/06Automatic control of frequency or phase; Synchronisation using a reference signal applied to a frequency- or phase-locked loop
    • H03L7/08Details of the phase-locked loop
    • H03L7/081Details of the phase-locked loop provided with an additional controlled phase shifter
    • H03L7/0812Details of the phase-locked loop provided with an additional controlled phase shifter and where no voltage or current controlled oscillator is used
    • H03L7/0818Details of the phase-locked loop provided with an additional controlled phase shifter and where no voltage or current controlled oscillator is used the controlled phase shifter comprising coarse and fine delay or phase-shifting means
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03LAUTOMATIC CONTROL, STARTING, SYNCHRONISATION OR STABILISATION OF GENERATORS OF ELECTRONIC OSCILLATIONS OR PULSES
    • H03L7/00Automatic control of frequency or phase; Synchronisation
    • H03L7/06Automatic control of frequency or phase; Synchronisation using a reference signal applied to a frequency- or phase-locked loop
    • H03L7/08Details of the phase-locked loop
    • H03L7/085Details of the phase-locked loop concerning mainly the frequency- or phase-detection arrangement including the filtering or amplification of its output signal
    • H03L7/091Details of the phase-locked loop concerning mainly the frequency- or phase-detection arrangement including the filtering or amplification of its output signal the phase or frequency detector using a sampling device

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Transfer Systems (AREA)
  • Read Only Memory (AREA)
  • Dram (AREA)

Abstract

The application discloses a method for adjusting sampling phase and a serial flash memory controller, wherein the serial flash memory controller comprises a processing path, the processing path comprises a delay circuit, and a register in the delay circuit receives a phase difference adjusting signal; the delay circuit is connected with the register, and delays the associated clock signal or the first data signal according to the phase difference adjusting signal so that the phase difference between the associated clock signal and the first data signal is within a first preset range; the adjusting delay circuit comprises a plurality of serially connected sub delay circuits, the delay time of each sub delay circuit is a first time, the initial phase difference between the associated clock signal and the first data signal is a second time, and the preset quantity is related to the first time and the second time. By means of the mode, the phase difference between the associated clock signal and the first data signal can be adjusted, accurate sampling of the first data signal is achieved, and stable transmission of the data signal is achieved.

Description

Method for adjusting sampling phase and serial flash memory controller
Technical Field
The present disclosure relates to the field of electronic technologies, and in particular, to a method for adjusting sampling phase and a serial flash memory controller.
Background
When the serial flash controller is used to access an external serial flash chip through a serial peripheral interface (SPI, serial Peripheral Interface) bus, the path delay inside the micro control unit (MCU, microcontroller Unit) chip and inside the serial flash chip is obviously changed due to the change of the ambient temperature and the working voltage. In addition, the printed circuit board (PCB, printed Circuit Board) routing delays of the different signal lines in the SPI bus may also be inconsistent.
When a bus Master Output/Slave Input (MOSI) signal in the SPI bus reaches the external serial flash memory chip, it is difficult to be sampled by the channel clock at the optimal sampling position due to the existence of signal delay, and in addition, when a bus Master Input/Slave Output (MISO) signal is sent back to the controller by the external serial flash memory chip under the driving of the channel clock, a problem of sampling point error may also occur.
The inventor of the application finds in long-term research and development that when an external serial flash chip is accessed by utilizing a serial flash controller, if the SPI bus time sequence is not satisfied due to the change of the ambient temperature and the working voltage or the inconsistent delay of a PCB bus, the common practice is to change the function correctly by reducing the frequency of the SPI bus under the condition of performance degradation. By reducing the SPI bus frequency, i.e., reducing the access speed of the serial flash, while normal functions may be achieved, performance is sacrificed and the speed requirements of some applications may not be met.
Disclosure of Invention
The problem that this application mainly solves is to provide a method and serial flash memory controller of adjustment sampling phase place, can adjust the phase difference of following way clock signal and first data signal, realizes the accurate sampling to first data signal, realizes data signal's stable transmission.
In order to solve the technical problem, another technical scheme adopted in the application is to provide: a serial flash controller comprising a processing path, the processing path comprising a delay circuit, the delay circuit comprising: the register is used for receiving the phase difference adjusting signal; the delay adjusting circuit is connected with the register and is used for delaying the associated clock signal or the first data signal according to the phase difference adjusting signal so that the phase difference between the associated clock signal and the first data signal is within a first preset range; the delay adjusting circuit comprises a plurality of serially connected sub-delay circuits, the delay time corresponding to each sub-delay circuit is a first time, the initial phase difference between the associated clock signal and the first data signal is a second time, and the phase difference adjusting signal is used for indicating the associated clock signal or the first data signal to pass through a preset number of the sub-delay circuits, wherein the preset number is related to the first time and the second time.
In order to solve the technical problems, the technical scheme adopted by the application is that: a method of adjusting sampling phase, the method being applied to a serial flash memory controller, the serial flash memory controller comprising a processing path, the processing path comprising a delay circuit, the delay circuit comprising a register and an adjustment delay circuit coupled to the register, the method comprising: the register receives the phase difference adjusting signal; the delay adjusting circuit delays the associated clock signal or the first data signal according to the phase difference adjusting signal so that the phase difference between the delayed associated clock signal and the first data signal is within a first preset range; the delay adjusting circuit comprises a plurality of serially connected sub-delay circuits, the delay time corresponding to each sub-delay circuit is a first time, the initial phase difference between the associated clock signal and the first data signal is a second time, and the phase difference adjusting signal is used for indicating the associated clock signal or the first data signal to pass through a preset number of the sub-delay circuits, wherein the preset number is related to the first time and the second time.
Through above-mentioned scheme, the beneficial effect of this application is: the register is used for receiving a phase difference adjusting signal, and the delay adjusting circuit adjusts delay time of the following clock signal or the first data signal according to the phase difference adjusting signal, so that the phase difference between the following clock signal and the first data signal is within a first preset range; the phase difference between the channel associated clock signal and the first data signal can be adjusted, so that the first data signal can be accurately sampled at the effective edge of the channel associated clock signal, and stable transmission of the data signal can be realized.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art. Wherein:
FIG. 1 is a schematic diagram of an embodiment of a serial flash controller according to the present application;
FIG. 2 is a schematic diagram of another embodiment of a serial flash controller provided herein;
FIG. 3 is a schematic diagram of a delay circuit in another embodiment of a serial flash controller according to the present application;
FIG. 4 is a schematic diagram of a serial flash controller according to another embodiment of the present application;
FIG. 5 is a timing diagram of the associated clock signal and the MOSI signal provided by the present application;
FIG. 6 is a timing diagram of a second clock signal and a MISO signal provided by the present application;
FIG. 7 is a flow chart of an embodiment of a method for adjusting sampling phase provided in the present application;
fig. 8 is a flowchart of another embodiment of a method for adjusting sampling phase provided in the present application.
Detailed Description
The following description of the technical solutions in the embodiments of the present application will be made clearly and completely with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an embodiment of a serial flash memory controller provided in the present application, where the serial flash memory controller includes a processing path 10, the processing path 10 includes a delay circuit 11, and the delay circuit 11 includes: register 111 and adjustment delay circuit 112.
The register 111 is configured to receive a phase difference adjustment signal, where the phase difference adjustment signal is configured to instruct the associated clock signal or the first data signal to pass through a preset number of sub-delay circuits 1121; the phase difference adjusting signal may be generated by an adjusting instruction input by an operator, and the operator obtains the phase difference between the associated clock signal and the first data signal through measurement, and performs a correlation operation according to the phase difference between the associated clock signal and the first data signal, so that the register 111 receives the phase difference adjusting signal.
The adjustment delay circuit 112 is connected to the register 111, and is configured to delay the associated clock signal or the first data signal according to the phase difference adjustment signal, so that the phase difference between the associated clock signal and the first data signal is within a first preset range, where the smaller the first preset range, the better the smaller the first preset range, for example, the phase difference range including 0 ° such as 0 ° to 10 °; specifically, when the associated clock signal lags the first data signal, the adjustment delay circuit 112 delays the first data signal according to the phase difference adjustment signal, so that the phase difference between the associated clock signal and the delayed first data signal is within a first preset range; when the first data signal lags the associated clock signal, the delay adjustment circuit 112 delays the associated clock signal according to the phase difference adjustment signal, so that the phase difference between the delayed associated clock signal and the first data signal is within a first preset range.
The adjusting delay circuit 112 includes a plurality of serially connected sub-delay circuits 1121, wherein a delay time corresponding to each sub-delay circuit 1121 is a first time, an initial phase difference between the associated clock signal and the first data signal is a second time, and a preset number is associated with the first time and the second time; specifically, the preset number may be a ratio of the second time to the first time.
In contrast to the prior art, the present embodiment provides a serial flash memory controller, in which the delay adjustment circuit 112 adjusts the delay time of the associated clock signal or the first data signal according to the phase difference adjustment signal obtained by the register 111, so as to control the phase difference between the associated clock signal and the first data signal within a first preset range; the phase difference between the channel associated clock signal and the first data signal can be adjusted, so that the first data signal can be accurately sampled at the effective edge of the channel associated clock signal, and stable transmission of the data signal can be realized.
Referring to fig. 2, fig. 2 is a schematic structural diagram of another embodiment of a serial flash memory controller provided in the present application, where the serial flash memory controller further includes: the clock source 21, the processing path includes: the delay circuit includes a first delay circuit 221 and a second delay circuit 231, and a first path 22 and a second path 23.
The clock source 21 is used to generate a standard clock signal, and furthermore, a clock signal of a different phase may be generated using a high-speed clock.
The first path 22 is connected to the clock source 21, and is configured to generate a following clock signal according to a standard clock signal, and transmit the following clock signal to an external device (not shown in the figure), where the following clock signal is a signal obtained by delaying the clock signal by a first preset delay time, and the first preset delay time includes a time when the standard clock signal is transmitted to the external device.
Further, the first passage 22 includes: the first delay circuit 221, the first delay circuit 221 is connected to the clock source 21, and is configured to receive the first phase difference adjustment signal, and delay the associated clock signal by a third preset delay time according to the first phase difference adjustment signal, where the third preset delay time is a difference between the second preset delay time and the first preset delay time, and the second preset delay time includes a time when the data signal to be sent is transmitted to the external device.
The second path 23 is connected to the clock source 21, and is configured to generate a first data signal according to a data signal to be sent, and send the first data signal to an external device; the first data signal is the same as the information contained in the data signal to be transmitted, and is a signal of which the data signal to be transmitted is delayed by a second preset delay time.
Further, the second passage 23 includes: the second delay circuit 231 and the first trigger 232, the second delay circuit 231 is configured to receive the second phase difference adjustment signal, and delay the first data signal by a fourth preset delay time according to the second phase difference adjustment signal, where the fourth preset delay time is a difference between the first preset delay time and the second preset delay time.
The first flip-flop 232 is connected to the clock source 21 and the second delay circuit 231, and is configured to generate a first data signal according to the first clock signal and a data signal to be transmitted, where the first clock signal is a signal obtained by delaying a standard clock signal by a fifth preset delay time.
The registers include a first register 2211 and a second register 2311, and the adjustment delay circuit includes a first adjustment delay circuit 2212 and a second adjustment delay circuit 2312; the first delay circuit 221 includes a first register 2211 and a first adjustment delay circuit 2212, and the first adjustment delay circuit 2212 includes a plurality of first sub-delay circuits 22121 connected in series; the second delay circuit 231 includes a second register 2311 and a second adjustment delay circuit 2312, and the second adjustment delay circuit 2312 includes a plurality of second sub-delay circuits 23121 connected in series.
The first phase difference adjustment signal is used for indicating that the associated clock signal passes through a preset number of first sub-delay circuits 22121, wherein the preset number is a ratio of a third preset delay time to the first time; the second phase difference adjustment signal is used for indicating that the first data signal passes through a preset number of second sub-delay circuits 23121, wherein the preset number is a ratio of a fourth preset delay time to the first time.
With continued reference to fig. 2, the serial flash controller further includes a third path 24, the third path 24 being connected to the clock source 21, the third path 24 including a third delay circuit 241 and a second flip-flop 242 connected to each other.
The third delay circuit 241 is connected to the second flip-flop 242 and the clock source 21, respectively, and includes a third register 2411 and a third adjustment delay circuit 2412 connected to each other; the third register 2411 is configured to receive a third phase difference adjustment signal, and the third adjustment delay circuit 2412 is configured to delay the second clock signal according to the third phase difference adjustment signal, so that a phase difference between the delayed data signal to be received and the delayed second clock signal is within a second preset range; the second preset range may be the same as the first preset range, and the second clock signal is a signal obtained by delaying the standard clock signal by a sixth preset delay time.
The second flip-flop 242 is configured to receive a data signal to be received sent by the external device, and generate a second data signal according to the delayed second clock signal and the data signal to be received.
Further, the third adjusting delay circuit 2412 includes a plurality of third sub-delay circuits 24121 connected in series, and the third phase difference adjusting signal is used to instruct the data signal to be received to pass through a preset number of the third sub-delay circuits 24121.
In a specific embodiment, as shown in fig. 3, each delay circuit further includes a selector, and an output terminal of each sub-delay circuit is connected to the selector, and the selector is connected to a register, and the register may receive the phase difference adjustment signal, and the selector is configured to determine the number of connected sub-delay circuits according to an output of the register.
The delay value of each sub-delay circuit is substantially the same under the same condition (in the case of the same temperature or voltage), and the sub-delay circuit is composed of a certain number and type of circuit units, such as inverters or buffers (not shown in the figure). By configuring the corresponding registers, the number of sub-delay circuits through which the signals pass can be selected, thereby realizing different delay value settings. When the register configuration value is 0, it means that no sub-delay circuit is passed, the delay circuit (including the first delay circuit 221 to the third delay circuit 241) has the minimum delay value, and the larger the register configuration value is, the larger the number of sub-delay circuits the signal passes through, and the larger the delay value of the corresponding delay circuit is.
For each sub-delay circuit, the higher the temperature, the larger the delay value, the higher the voltage, and the smaller the delay value. When the temperature is highest and the voltage is lowest, the sub-delay circuit has the largest delay value; the sub-delay circuit has the smallest delay value when the temperature is lowest and the voltage is highest.
Based on the sensitivity of the individual sub-delay circuits to temperature and voltage, STA (Static Timing Analysis ) analysis is typically used to obtain the maximum delay value, the typical delay value, and the minimum delay value.
In this embodiment, the phase difference between the associated clock signal and the first data signal is adjusted by the first delay circuit 221 and the second delay circuit 231, so that the first data signal is sampled at the rising edge of the associated clock signal, and the delay time of the second clock signal is adjusted by the third delay circuit 241 according to the associated clock signal, so that the data signal to be received can be sampled at the rising edge of the delayed second clock signal, thereby realizing stable transmission of the data signal.
In a specific embodiment, as shown in fig. 4, the clock source 21 is configured to generate the standard clock signal CLK, and may be further configured to generate other clock signals as needed, where the delay time of the slave clock signal SCK compared to the standard clock signal CLK is t1_a+t2_a+t3_a+t4_a, and the delay time generated by the first delay circuit 221 is t2_a. The MOSI signal is a data signal sent from the serial flash controller 20 to the serial flash chip 25, and is generated by the D flip-flop 232 driven by the first clock signal CLK1, wherein the phase relationship between the first clock signal CLK1 and the standard clock signal CLK is fixed regardless of the delay factor.
The selection principle of the delay times t2_a and t2_b of the first delay circuit 221 and the second delay circuit 231 is to select a delay value having a smaller value of t2_a as much as possible in the case where the delay difference between the channel clock signal SCK and the MOSI signal is minimum.
The external serial flash memory chip 25 samples the MOSI signal line with the rising edge of the clock of the channel clock signal, which should be located in the middle of the MOSI signal line data in order to achieve the best immunity and the fastest transmission speed, as shown in fig. 5.
To achieve optimal sampling, the relationship between the different delays needs to satisfy the following formula:
T1_A+T2_A+T3_A+T4_A=T1_B+T2_B+T3_B+T4_B+Tdq
where Tdq is the delay of D flip-flop 232, tdq is typically small and can be selectively ignored. The PCB delay times t4_a and t4_b are estimated based on the trace length and dielectric constant of the PCB after the PCB design is completed, and the values of t1_ A, T3_ A, T1_b and t3_b are analyzed by the STA.
After the external serial flash chip 25 receives the associated clock signal clock SCK, the MISO signal is sent to the serial flash controller 20 after a certain processing delay, and the serial flash controller 20 samples the MISO signal using the sampling clock second clock signal generated by the standard clock signal CLK.
Similar to the MOSI signal, the rising edge of the second clock signal should be in the middle of the MISO signal line, as shown in fig. 6, for optimal immunity and fastest transmission speed.
To achieve optimal sampling, the relationship between the different delays needs to satisfy the following formula:
T1_A+T2_A+T3_A+T4_A+Tproc+T4_C+T3_C=T1_C+T2_C-T SCK /2
where Tproc is the processing time of the external serial flash chip 25, generally available from a data manual; the PCB delay clock t4_c can be estimated according to the trace length and the dielectric constant of the PCB board, and the values of t1_ C, T2_c and t3_c can be obtained by STA analysis.
Based on the relation between the channel associated clock signal SCK and the MOSI signal, the delay value t2_a of the first delay circuit 221 is obtained, and then, according to the above equation, the delay value t2_c of the third delay circuit 241 is calculated.
As can be seen from the above analysis, by introducing 3 delay circuits, the MOSI signal and the MISO signal can be ensured to be sampled at the optimal sampling point all the time, and the serial flash controller 20 provided in this embodiment can be applied to an integrated circuit that realizes serial flash access by using the SPI bus.
Under different environmental temperature and operating voltage conditions, in order to ensure that the access speed of the serial flash memory is not affected, delay circuits are inserted into the paths of the channel associated clock signals SCK and MOSI signals in the serial flash memory controller 20, so that the delay difference that the channel associated clock signals SCK and MOSI signals reach the corresponding ports of the external serial flash memory chip 25 is changed. In addition, by inserting the third delay circuit 241 to adjust the sampling clock phase of the MISO signal, it is ensured that the MISO signal can be correctly sampled. In addition, the delay value of each delay circuit can be selected through an independent register, and the current SPI bus speed, the ambient temperature, the working voltage and the PCB wiring can be comprehensively considered, so that the most suitable delay value can be selected.
Referring to fig. 1 and 7, fig. 7 is a flowchart of an embodiment of a method for adjusting sampling phase provided in the present application, where the method is applied to a serial flash memory controller, the serial flash memory controller includes a processing path 10, the processing path 10 includes a delay circuit 11, the delay circuit 11 includes a register 111 and an adjusting delay circuit 112 connected to the register, and the method includes:
step 71: the register receives the phase difference adjustment signal.
The adjusting delay circuit 112 includes a plurality of serially connected sub-delay circuits 1121, where a delay time corresponding to each sub-delay circuit 1121 is a first time; the phase difference adjustment signal is used to indicate that the associated clock signal or the first data signal passes through a preset number of sub-delay circuits 1121.
Step 72: the delay adjusting circuit delays the associated clock signal or the first data signal according to the phase difference adjusting signal so that the phase difference between the delayed associated clock signal and the first data signal is within a first preset range.
The channel associated clock signal is a clock signal generated by the serial flash memory controller, the clock signal is sent to the SPI slave device, the first data signal can be MOSI signal, and under the conditions of different environment temperatures and working voltages, in order to ensure that the access speed of the serial flash memory is not affected, the first data signal is accurately sampled according to the channel associated clock signal, and the channel associated clock signal can be realized by adjusting the phase difference between the channel associated clock signal and the first data signal; the initial phase difference between the associated clock signal and the first data signal is a second time, and the preset amount is associated with the first time and the second time.
The operator may obtain the phase difference between the associated clock signal and the first data signal by measuring, and in a specific embodiment, the delay of each node in the circuit may be analyzed by using static timing analysis, so as to obtain the phase difference. After acquiring the phase difference between the associated clock signal and the first data signal, the operator sends an adjustment instruction to the register 111 according to the phase difference to adjust the delay time of the associated clock signal or the first data signal, so that the first data signal can be sampled at the effective edge of the associated clock signal, that is, the phase difference between the associated clock signal and the first data signal is within a first preset range; by setting the delay time of the associated clock signal or the first data signal, the delay difference that the associated clock signal and the first data signal reach the corresponding port of the external slave device is changed.
According to the embodiment, the delay time of the associated clock signal or the first data signal is adjusted according to the phase difference adjusting signal, so that the phase difference between the associated clock signal and the first data signal is within a first preset range; the phase difference between the channel associated clock signal and the first data signal can be adjusted, so that the first data signal can be accurately sampled at the effective edge of the channel associated clock signal, and stable transmission of the data signal can be realized.
Referring to fig. 2 and 8, fig. 8 is a flowchart illustrating another embodiment of a method for adjusting sampling phase provided in the present application, where the registers include a first register 2211, a second register 2311, and a third register 2411, the adjusting delay circuit includes a first adjusting delay circuit 2212, a second adjusting delay circuit 2312, and a third adjusting delay circuit 2412, the first adjusting delay circuit 2212 includes a plurality of first sub-delay circuits 22121 connected in series, the second adjusting delay circuit 2312 includes a plurality of second sub-delay circuits 23121 connected in series, and the third adjusting delay circuit 2412 includes a plurality of third sub-delay circuits 24121 connected in series; the method comprises the following steps:
step 81: a first flip-flop in the serial flash memory controller generates a first data signal according to a first clock signal and a data signal to be transmitted.
The data signal to be transmitted is a data signal to be transmitted to the SPI slave device by the serial flash controller, the first clock signal is a signal obtained by delaying the standard clock signal by a fifth preset delay time, and the standard clock signal is a signal generated by the clock source 21 in the serial flash controller.
The first clock signal and the data signal to be transmitted are input into the first flip-flop 232, and the first flip-flop 232 samples the data signal to be transmitted at a rising edge of the first clock signal, so as to obtain a first data signal, where the first data signal is a MOSI signal, and the first data signal is a signal after the data signal to be transmitted is delayed by a second preset delay time, and the second preset delay time includes a time when the data signal to be transmitted is transmitted to an external device.
Step 82: the register receives the phase difference adjustment signal.
Step 83: the first register receives a first phase difference adjusting signal, and the first adjusting delay circuit delays the associated clock signal by a third preset delay time according to the first phase difference adjusting signal.
The associated clock signal is a signal obtained by delaying the standard clock signal, which is generated by the clock source 21, by a first predetermined delay time, which includes the time the standard clock signal is transmitted to the external device.
The first phase difference adjustment signal is used for indicating that the associated clock signal passes through a preset number of first sub-delay circuits 22121, the third preset delay time is a difference value between the second preset delay time and the first preset delay time, and the preset number is a ratio of the third preset delay time to the first time.
Step 84: the second register receives a second phase difference adjusting signal, and the second adjusting delay circuit delays the first data signal by a fourth preset delay time according to the second phase difference adjusting signal.
The fourth preset delay time is a difference between the first preset delay time and the second preset delay time, and the second phase difference adjustment signal is used for indicating that the first data signal passes through a preset number of second sub-delay circuits 23121, wherein the preset number is a ratio of the fourth preset delay time to the first time.
Step 85: the serial flash memory controller transmits the delayed channel associated clock signal and the first data signal to the external device, or transmits the channel associated clock signal and the delayed first data signal to the external device.
If the second preset delay time is greater than the first preset delay time, the following clock signal is indicated to be advanced compared with the first data signal, and the following clock signal is delayed by a third preset delay time in order to accurately sample the first data signal at the rising edge of the following clock signal.
If the second preset delay time is less than or equal to the first preset delay time, the delay of the first data signal by a fourth preset delay time is indicated to be delayed by the channel associated clock signal compared with the first data signal so as to accurately sample the first data signal at the rising edge of the channel associated clock signal.
In a specific embodiment, the rising edge of the associated clock signal may correspond to an intermediate position of the first data signal, that is, the phase difference between the associated clock signal and the first data signal is 0, as shown in fig. 5.
After the channel associated clock signal or the first data signal is delayed, the channel associated clock signal and the first data signal are transmitted to an external device, which may be an external slave device.
Step 86: the second trigger receives a data signal to be received sent by the external device.
The serial flash memory controller samples the first data signal at a rising edge of the associated clock signal, and also receives a data signal to be received sent by the external device, where the data signal to be received may be a MISO signal.
Step 87: the third register receives a third phase difference adjustment signal.
The third phase difference adjustment signal is used to instruct the data signal to be received to pass through the preset number of third sub-delay circuits 24121.
Step 88: the third adjusting delay circuit delays the second clock signal according to the third phase difference adjusting signal so that the phase difference between the delayed data signal to be received and the delayed second clock signal is within a second preset range.
Step 89: the serial flash memory controller generates a second data signal according to the delayed second clock signal and the data signal to be received.
The second clock signal is a signal obtained by delaying the standard clock signal by a sixth preset delay time, and in order to accurately sample the signal to be received at the rising edge of the second clock signal, the delay time of the second clock signal is adjusted according to the associated clock signal, so that the phase difference between the data signal to be received and the delayed second clock signal is within a second preset range.
In a specific embodiment, the rising edge of the second clock signal may correspond to an intermediate position of the data signal to be received, that is, the phase difference between the second clock signal and the data signal to be received is 0, as shown in fig. 6.
After the phase difference between the second clock signal and the data signal to be received is adjusted, the data signal to be received and the delayed second clock signal are input into the second flip-flop 242 to generate a second data signal, where the second data signal is a signal delayed from the signal to be received, and the data information contained in the second data signal is the same.
According to the embodiment, the phase difference between the random clock signal and the first data signal is adjusted, so that the first data signal is sampled at the rising edge of the random clock signal, the delay time of the second clock signal is adjusted according to the random clock signal, and the data signal to be received can be sampled at the rising edge of the delayed second clock signal, so that stable transmission of the data signal is realized.
In the several embodiments provided in the present application, it should be understood that the disclosed methods and apparatuses may be implemented in other manners. For example, the above-described device embodiments are merely illustrative, e.g., the division of modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist alone physically, or two or more units may be integrated into one unit. The integrated units may be implemented in hardware or in software functional units.
The foregoing is only examples of the present application, and is not intended to limit the scope of the patent application, and all equivalent structures or equivalent processes using the descriptions and the contents of the present application or other related technical fields are included in the scope of the patent application.

Claims (13)

1. A serial flash memory controller comprising a processing path, the processing path comprising a delay circuit, the delay circuit comprising:
a register for receiving a phase difference adjustment signal;
the delay adjusting circuit is connected with the register and used for delaying the associated clock signal or the first data signal according to the phase difference adjusting signal so that the phase difference between the associated clock signal and the first data signal is within a first preset range;
the delay adjusting circuit comprises a plurality of serially connected sub-delay circuits, the delay time corresponding to each sub-delay circuit is a first time, the initial phase difference between the associated clock signal and the first data signal is a second time, the phase difference adjusting signal is used for indicating that the associated clock signal or the first data signal passes through a preset number of the sub-delay circuits, and the preset number is related to the first time and the second time;
wherein the processing path comprises a first path and a second path, and the delay circuit comprises a first delay circuit and a second delay circuit;
the first path comprises the first delay circuit, and is used for receiving a first phase difference adjusting signal and delaying the associated clock signal by a third preset delay time according to the first phase difference adjusting signal;
the second path includes the second delay circuit for receiving a second phase difference adjustment signal and delaying the first data signal by a fourth preset delay time according to the second phase difference adjustment signal.
2. The serial flash controller of claim 1, further comprising a clock source for generating a standard clock signal;
the first path is connected with the clock source and is used for generating a channel associated clock signal according to the standard clock signal and transmitting the channel associated clock signal to external equipment; the channel associated clock signal is a signal of the standard clock signal delayed by a first preset delay time, wherein the first preset delay time comprises the time of the standard clock signal transmitted to external equipment;
the second path is connected with the clock source and is used for generating the first data signal according to a data signal to be sent and sending the first data signal to the external equipment; the first data signal is the same as the information contained in the data signal to be sent, and is a signal of the data signal to be sent delayed by a second preset delay time, wherein the second preset delay time comprises the time of transmission of the data signal to be sent to the external equipment.
3. The serial flash controller of claim 2, wherein the third predetermined delay time is a difference between the second predetermined delay time and the first predetermined delay time;
the fourth preset delay time is a difference value between the first preset delay time and the second preset delay time.
4. The serial flash controller of claim 3, wherein the serial flash controller comprises a memory controller,
the register comprises a first register and a second register, and the adjustment delay circuit comprises a first adjustment delay circuit and a second adjustment delay circuit; the first delay circuit comprises the first register and the first adjustment delay circuit, and the first adjustment delay circuit comprises a plurality of first sub-delay circuits connected in series; the second delay circuit comprises the second register and the second adjustment delay circuit, and the second adjustment delay circuit comprises a plurality of second sub-delay circuits connected in series; the first phase difference adjusting signal is used for indicating the channel associated clock signal to pass through the preset number of the first sub-delay circuits, wherein the preset number is the ratio of the third preset delay time to the first time; the second phase difference adjustment signal is configured to instruct the first data signal to pass through the preset number of the second sub-delay circuits, where the preset number is a ratio of the fourth preset delay time to the first time.
5. The serial flash controller of claim 4, wherein the serial flash controller comprises a memory controller,
the second path further comprises a first trigger which is respectively connected with the clock source and the second delay circuit and is used for generating the first data signal according to a first clock signal and the data signal to be transmitted;
the first clock signal is a signal obtained by delaying the standard clock signal by a fifth preset delay time.
6. The serial flash controller of claim 2, further comprising a third path comprising:
a third delay circuit connected to the clock source and including a third register and a third adjustment delay circuit; the third register is configured to receive a third phase difference adjustment signal, and the third adjustment delay circuit is configured to delay a second clock signal according to the third phase difference adjustment signal, so that a phase difference between a delayed data signal to be received and the delayed second clock signal is within a second preset range, where the second clock signal is a signal obtained by delaying the standard clock signal by a sixth preset delay time;
the second trigger is connected with the third delay circuit and is used for receiving a data signal to be received sent by the external equipment and generating a second data signal according to the delayed second clock signal and the data signal to be received;
the third adjusting delay circuit comprises a plurality of third sub-delay circuits connected in series, and the third phase difference adjusting signal is used for indicating the data signal to be received to pass through the preset number of third sub-delay circuits.
7. The serial flash controller of claim 1, wherein the serial flash controller comprises a memory controller,
the delay circuit further comprises a selector, the output end of each sub delay circuit is connected with the selector, the selector is connected with the register, and the selector is used for determining the number of the connected sub delay circuits according to the output of the register.
8. A method of adjusting sampling phase, applied to a serial flash controller, the serial flash controller comprising a processing path including a delay circuit, the delay circuit including a register and an adjustment delay circuit coupled to the register, the method comprising:
the register receives a phase difference adjustment signal;
the delay adjustment circuit delays an associated clock signal or a first data signal according to the phase difference adjustment signal so that the phase difference between the associated clock signal and the first data signal is within a first preset range;
the delay adjusting circuit comprises a plurality of serially connected sub-delay circuits, the delay time corresponding to each sub-delay circuit is a first time, the initial phase difference between the associated clock signal and the first data signal is a second time, the phase difference adjusting signal is used for indicating that the associated clock signal or the first data signal passes through a preset number of the sub-delay circuits, and the preset number is related to the first time and the second time;
wherein the processing path comprises a first path and a second path, and the delay circuit comprises a first delay circuit and a second delay circuit;
the first path comprises the first delay circuit, and is used for receiving a first phase difference adjusting signal and delaying the associated clock signal by a third preset delay time according to the first phase difference adjusting signal;
the second path includes the second delay circuit for receiving a second phase difference adjustment signal and delaying the first data signal by a fourth preset delay time according to the second phase difference adjustment signal.
9. The method of adjusting a sampling phase according to claim 8, wherein,
the associated clock signal is a signal of a standard clock signal delayed by a first preset delay time, wherein the first preset delay time comprises the time of the standard clock signal transmitted to external equipment; the first data signal is a signal of which the data signal to be sent is delayed by a second preset delay time; the standard clock signal is a signal generated by a clock source in the serial flash memory controller, and the second preset delay time comprises the time when the data signal to be sent is transmitted to the external device.
10. The method of adjusting sampling phase according to claim 9, wherein the register comprises a first register and a second register, the adjustment delay circuit comprising a first adjustment delay circuit and a second adjustment delay circuit, the first adjustment delay circuit comprising a plurality of first sub-delay circuits connected in series, the second adjustment delay circuit comprising a plurality of second sub-delay circuits connected in series; the step of delaying the associated clock signal or the first data signal by the delay adjustment circuit according to the phase difference adjustment signal so that the phase difference between the associated clock signal and the first data signal is within a first preset range includes:
the first register receives a first phase difference adjustment signal, wherein the first phase difference adjustment signal is used for indicating the channel-associated clock signal to pass through the preset number of first sub-delay circuits; the first delay adjusting circuit delays the associated clock signal by a third preset delay time according to the first phase difference adjusting signal, wherein the third preset delay time is a difference value between the second preset delay time and the first preset delay time, and the preset number is a ratio of the third preset delay time to the first time; or alternatively
The second register receives a second phase difference adjustment signal, wherein the second phase difference adjustment signal is used for indicating the first data signal to pass through the preset number of second sub-delay circuits; the second adjustment delay circuit delays the first data signal by a fourth preset delay time according to the second phase difference adjustment signal, wherein the fourth preset delay time is a difference value between the first preset delay time and the second preset delay time, and the preset number is a ratio of the fourth preset delay time to the first time.
11. The method of adjusting sampling phase according to claim 9, wherein prior to the step of the register receiving a phase difference adjustment signal, comprising:
a first trigger in the serial flash memory controller generates a first data signal according to a first clock signal and the data signal to be transmitted;
the first clock signal is a signal obtained by delaying the standard clock signal by a fifth preset delay time.
12. The method of adjusting sampling phase according to claim 9, further comprising:
the serial flash memory controller transmits the delayed associated clock signal and the first data signal to an external device, or transmits the associated clock signal and the delayed first data signal to the external device.
13. The method of adjusting sampling phase of claim 12, wherein the register further comprises a third register, the adjustment delay circuit further comprising a third adjustment delay circuit comprising a plurality of third sub-delay circuits in series, the method further comprising:
a second trigger receives a data signal to be received sent by the external equipment;
the third register receives a third phase difference adjusting signal, wherein the third phase difference adjusting signal is used for indicating the data signal to be received to pass through the preset number of third sub-delay circuits;
the third adjusting delay circuit delays a second clock signal according to the third phase difference adjusting signal so that the phase difference between the delayed data signal to be received and the delayed second clock signal is within a second preset range;
the serial flash memory controller generates a second data signal according to the delayed second clock signal and the data signal to be received;
the second clock signal is a signal obtained by delaying the standard clock signal by a sixth preset delay time.
CN201910640015.7A 2019-07-16 2019-07-16 Method for adjusting sampling phase and serial flash memory controller Active CN112242169B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910640015.7A CN112242169B (en) 2019-07-16 2019-07-16 Method for adjusting sampling phase and serial flash memory controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910640015.7A CN112242169B (en) 2019-07-16 2019-07-16 Method for adjusting sampling phase and serial flash memory controller

Publications (2)

Publication Number Publication Date
CN112242169A CN112242169A (en) 2021-01-19
CN112242169B true CN112242169B (en) 2024-03-01

Family

ID=74166719

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910640015.7A Active CN112242169B (en) 2019-07-16 2019-07-16 Method for adjusting sampling phase and serial flash memory controller

Country Status (1)

Country Link
CN (1) CN112242169B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116052742A (en) * 2022-07-13 2023-05-02 成都海光集成电路设计有限公司 Data processing method, device, storage controller, equipment and medium
CN116879725B (en) * 2023-09-06 2023-12-08 西安紫光国芯半导体股份有限公司 Sampling circuit, self-test circuit and chip
CN117590897A (en) * 2023-11-23 2024-02-23 北京国科天迅科技股份有限公司 Chip and chip control method
CN117785069B (en) * 2024-02-26 2024-05-24 合肥康芯威存储技术有限公司 Memory and parameter adjustment method thereof

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20030025785A (en) * 2001-09-20 2003-03-29 주식회사 하이닉스반도체 A digital delay line
CN1463494A (en) * 2001-05-17 2003-12-24 哉英电子股份有限公司 Semiconductor integrated circuit
US6691241B1 (en) * 1999-12-21 2004-02-10 Intel Corporation Delay tuning to improve timing in multi-load systems
JP2007336503A (en) * 2006-05-15 2007-12-27 Denso Corp Digitization apparatus
CN101394167A (en) * 2007-09-18 2009-03-25 富士通株式会社 Variable delay circuit, delay time control method and unit circuit
CN103378827A (en) * 2012-04-18 2013-10-30 德克萨斯仪器股份有限公司 Methods and delay circuits for generating a plurality of delays in delay lines
CN104199341A (en) * 2014-08-11 2014-12-10 福州瑞芯微电子有限公司 Electric circuit signal phase adaptive system, device and method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3450293B2 (en) * 2000-11-29 2003-09-22 Necエレクトロニクス株式会社 Clock control circuit and clock control method
JP2003316736A (en) * 2002-04-19 2003-11-07 Oki Electric Ind Co Ltd Usb circuit and data structure
JP5375330B2 (en) * 2009-05-21 2013-12-25 富士通セミコンダクター株式会社 Timing adjustment circuit, timing adjustment method, and correction value calculation method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6691241B1 (en) * 1999-12-21 2004-02-10 Intel Corporation Delay tuning to improve timing in multi-load systems
CN1463494A (en) * 2001-05-17 2003-12-24 哉英电子股份有限公司 Semiconductor integrated circuit
KR20030025785A (en) * 2001-09-20 2003-03-29 주식회사 하이닉스반도체 A digital delay line
JP2007336503A (en) * 2006-05-15 2007-12-27 Denso Corp Digitization apparatus
CN101394167A (en) * 2007-09-18 2009-03-25 富士通株式会社 Variable delay circuit, delay time control method and unit circuit
CN103378827A (en) * 2012-04-18 2013-10-30 德克萨斯仪器股份有限公司 Methods and delay circuits for generating a plurality of delays in delay lines
CN104199341A (en) * 2014-08-11 2014-12-10 福州瑞芯微电子有限公司 Electric circuit signal phase adaptive system, device and method

Also Published As

Publication number Publication date
CN112242169A (en) 2021-01-19

Similar Documents

Publication Publication Date Title
CN112242169B (en) Method for adjusting sampling phase and serial flash memory controller
US6031847A (en) Method and system for deskewing parallel bus channels
US7240231B2 (en) System and method for synchronizing multiple instrumentation devices
US6070260A (en) Test methodology based on multiple skewed scan clocks
CN107209225B (en) High speed data transmission using a calibrated single clock source synchronous serializer-deserializer protocol
JP2007317016A (en) Interface circuit and memory control device
JP2000322378A (en) Adjustable data delay using programmable clock shift
US6680636B1 (en) Method and system for clock cycle measurement and delay offset
CN103809659A (en) Apparatus and methods for clock alignment for high speed interfaces
US20080046771A1 (en) Adjustable delay compensation circuit
CN212622809U (en) Detection circuit
CN115542131B (en) Chip testing method and circuit
CN115656776A (en) Delay deviation measuring method and device of digital channel and electronic device
EP3264605A1 (en) Method and apparatus for phase-aligned 2x frequency clock generation
Yang et al. A configurable SPI interface based on APB bus
US20170317862A1 (en) Data transmission beetween asychronous environments
JP5221609B2 (en) Host controller that sets the sampling phase by sharing the DLL
CN114420030B (en) PWM generating circuit, driving chip, and electronic apparatus
US20010050952A1 (en) Circuit configuration for receiving at least two digital signals
CN115085894B (en) Signal synchronization system
US7574549B2 (en) Bridge design for SD and MMC multiplexing
Sawyer Source-synchronous serialization and deserialization (up to 1050 Mb/s)
CN117407346B (en) Sampling point adjusting system and method for FLASH outside vehicle-gauge chip
KR101100756B1 (en) skew arranging output circuit
RU2806240C1 (en) Detection scheme and detection method

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
TA01 Transfer of patent application right

Effective date of registration: 20210303

Address after: 6 / F, building C3, future science and Technology City, 999 Gaoxin Avenue, Donghu New Technology Development Zone, Wuhan City, Hubei Province (Wuhan area of free trade zone)

Applicant after: Wuhan Jiekai Technology Co.,Ltd.

Address before: 230000, 10 floor, A3 building, innovation industrial park, 800 Wangjiang West Road, Hefei, Anhui.

Applicant before: Hefei Jiefa Technology Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant