How to set SPI Clock Speed in MIMXRT1064 EVK with MCUXpresso

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to set SPI Clock Speed in MIMXRT1064 EVK with MCUXpresso

597 Views
wanmowong
Contributor I

We are modifying the "evkmimxrt1064_flexspi_nor_polling_transfer" project with MCUXpresso to support SPI NAND flash mounted on the MIMXRT1064 EVK.

In the "app.h" file of the project "evkmimxrt1064_flexspi_nor_polling_transfer", it sets the SPI clock speed to 133M with the statement:

CLOCK_SetDiv(kCLOCK_FlexspiDiv, 2); /* flexspi clock 133M. */

How do you set the SPI clock speed to 60 MHz as shown in "IMXRT1064IEC.pdf"  and "IMXRT1064CEC.pdf" documents? 

Thanks, Wanmo

Tags (1)
0 Kudos
1 Reply

530 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi Wanmo,

 

If you check the registers that this function is enabling you will see the following. This is where we are getting 133 MHz.

pastedImage_2.png

 

If you like to set 60 MHz you will need to select pll3_sw_clk and divide by 8 because of the following.

pastedImage_7.png

I hope this helps!

 

Best regards,

Felipe

0 Kudos