SPI devices and method for transferring data between the SPI devices
AssigneeHon Hai Precision Industry Co., Ltd.
InventorCheng-Wen Huang
Life of this patent
Estimating the term…
Abstract
A method for transferring data between a serial peripheral interface (SPI) master device and an SPI slave device generates a first clock signal for the SPI master device and a second clock signal for the SPI slave device. Clock frequency of the first clock signal and the second clock signal is twice than a serial clock signal between the SPI master device and the SPI slave device. Data are transferred with double data rate or single data rate based on the first clock signal and the second clock signal.
Claims16
A serial peripheral interface (SPI) master device, the SPI master device in communication with at least one SPI slave device, the SPI master device comprising:
- a first clock generator operable to generate a first clock signal;
- a slave selection unit operable to generate a slave selection signal for each of the at least one SPI slave device to determine whether each of the at least one SPI slave device is selected;
- a clock frequency divider operable to divide a clock frequency of the first clock signal by two to generate a serial clock signal for the at least one SPI slave device;
- a first clock counter operable to count clock cycles of the first clock signal;
- a first output logic unit operable to generate one or more read/write instructions, and transfer the one or more read/write instructions, one or more destination addresses and data to be written to the selected SPI slave device according to the first clock signal and a count value of the first clock signal;
- and
- a first input logic unit operable to receive data from the selected SPI slave device according to the first clock signal and the count value of the first clock signal.
A serial peripheral interface (SPI) slave device, the SPI slave device in communication with an SPI master device, the SPI slave device comprising:
- a clock frequency doubler operable to double a clock frequency of a serial clock signal received from the SPI master device to generate a second clock signal;
- a second clock counter operable to count clock cycles of the second clock signal;
- a second input logic unit operable to receive one or more read/write instructions, one or more destination addresses, and data to be written from the SPI master device according to the second clock signal and a count value of the second clock signal, and generate one or more read/write control signals according to the one or more read/write instructions;
- an operation control unit operable to write the data to be written to a destination storage of the SPI slave device according to the one or more destination addresses in response to a read control signal, or read data from the destination storage according to the one or more destination addresses in response to a read control signal;
- and
- a second output logic unit operable to transfer the data read from the destination storage to the SPI master device according to the second clock signal and the count value of the second clock signal.
A method for transferring data between a serial peripheral interface (SPI) master device and at least one SPI slave device, comprising:
- generating a first clock signal for the SPI master device;
- selecting one of the at least one SPI slave device;
- dividing a clock frequency of the first clock signal by two to generate a serial clock signal, and transmitting the serial clock signal to the selected SPI slave device;
- doubling the serial clock signal to generate a second clock signal;
- counting clock cycles of the first clock signal, and counting clock cycles of the second clock signal;
- generating one or more read/write instructions and transferring the one or more read/write instructions and one or more destination addresses to the selected SPI slave device according to the first clock signal and a count value of the first clock signal;
- if the generated instructions are write instructions, transferring data to be written to the selected SPI slave device according to the first clock signal and the count value of the first clock signal, and writing the transferred data to a destination storage of the selected SPI slave device according to the one or more destination addresses;
- or if the generated instructions are read instructions, reading data from the destination storage of the selected SPI salve device according to the one or more destination addresses, and transferring the read data to the SPI master device according to the second clock signal and a count value of the second clock signal;
- and
- deselecting the SPI slave device.
Dependencies are inferred from the claim text.