SPI rate change in code

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DaHu_285096
Level 5
Level 5
10 likes received 250 replies posted 100 replies posted

I have an application that needs to set up a device at low SPI rate (< 3MHz) and then switch to SPI rate up to 20MHz for normal speed operation.

Could someone please explain or give example how to change the SPI rate for these in code.

Thank you

0 Likes
1 Solution

You can specify the PLL and MASTER clock by the Configure System Clocks dialogue which is invoked by the "Edit Clock..." button at the top of the "Clocks" tab of the CYpress Design Wide Resource (CYDWR) file in the workspace explorer.

GS003211.png

You can specify the clock frequency by this dialogue.  PSoC Creator calculate a suitable frequency realized by the PSoC 5LP and show as the "Nominal" frequency.

GS003212.png

The datasheet of the SPIM component can be opened from the context menu of the component instance.  There is an AC characteristics table in the datasheet as follows.

GS003213.png

The maximum bit rate is depend on the operation mode.  In 8-bit High-speed mode case, the maximum frequency is 18MHz.  Sorry, this SPIM does not support 20MHz bit rate.

Regards,

Noriaki

View solution in original post

0 Likes
18 Replies