SPI Master clock set to about 8 MHZ in KL25Z

cancel
Showing results for 
Search instead for 
Did you mean: 

SPI Master clock set to about 8 MHZ in KL25Z

119 Views
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 Kudos
1 Reply

7 Views
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 Kudos