SPI Master clock set to about 8 MHZ in KL25Z

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

SPI Master clock set to about 8 MHZ in KL25Z

384件の閲覧回数
arthshah
Contributor II

kerryzhou

hello,

i am working on KL25Z.

i need to set SPI Clock rate about 8 MHz how can i set this ?

In SPI BR register i can not set to 8 MHz..

0 件の賞賛
1 返信

272件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hello Arth Shah,

    You can use the SPI1, the clock source is the system clock, the system clock can up to 48Mhz, let's take system clock = 48Mhz as an example.

Now, follow this picture to calculate the SPPR and SPR.

  pastedImage_1.png

8Mhz= 48M/(SPPR+1)*2^(SPR+1)

So, SPPR=2, SPR=0 can get 8Mhz baudrate.

You can configure SPI1_BR=0X20.

  If your bus is 24Mhz, you can't use the SPI0 get 8Mhz, SPI0 clock source is bus clock.

pastedImage_2.png

Wish it helps you!


Have a great day,
Kerry

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

0 件の賞賛