How to Set SPI's Clock

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to Set SPI's Clock

跳至解决方案
2,498 次查看
jiehunt
Contributor II

I use the imx6ql-sabreauto board to communicate with a slave board.

I want to know the highest speed of spi block.

I read the document and i think the highest speed is up to 60MHz.

and i use the ioctl like this

 ioctl (fd, SPI_IOC_WR_MAX_SPEED_HZ, 60MHz)

But , I don't confirm whether this is effective or not.

How do I know the actual speed of the SPI work with?

Thank you!

标签 (2)
0 项奖励
回复
1 解答
2,165 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Jie

max. ecspi frequency can be found in sect.4.11.2 ECSPI Timing Parameters

i.MX6DQ Datasheet

http://cache.freescale.com/files/32bit/doc/data_sheet/IMX6DQCEC.pdf

example of usage with spi-nor flash using dts "spi-max-frequency" parameter in

imx6qdl-sabresd.dtsi

linux-2.6-imx.git - Freescale i.MX Linux Tree 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
2 回复数
2,166 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Jie

max. ecspi frequency can be found in sect.4.11.2 ECSPI Timing Parameters

i.MX6DQ Datasheet

http://cache.freescale.com/files/32bit/doc/data_sheet/IMX6DQCEC.pdf

example of usage with spi-nor flash using dts "spi-max-frequency" parameter in

imx6qdl-sabresd.dtsi

linux-2.6-imx.git - Freescale i.MX Linux Tree 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
2,165 次查看
jiehunt
Contributor II

Thank you for your answer.

Actually my imx6qdl-sabreauto.dtsi is like this:

&ecspi1{
  fsl,spi-num-chipselects = <1>;
  cs-gpios = <&gpio5 25 0>;
  pinctrl-names = "default";
  pinctrl-0 = <&pinctrl_ecspi1>;
  status = "okay";
  spidev0: spi@0 {
  compatible = "spidev";
  spi-max-frequency = <40000000>;
  reg = <0>;
  };
};

So, I think the SPI is work with 40MHz. 

0 项奖励
回复