Changing speed of SPIM in code (5LP)

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

Hi,

   

Just a quickie, how do you change the SPI speed in code?

   

I am interfacing with a device that needs the SPI to run slow (3MHz or less) and then later switched to high (up to 20MHz).

0 Likes
3 Replies
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

There is no API as such provided by the component for clock speed change,but you can use a Mux .

   

Please check for delay in that case.

0 Likes
DaHu_285096
Level 5
Level 5
10 likes received 250 replies posted 100 replies posted

Is there en example using the mux to change SPI bitrate in code?

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

You can use an external clock for the SPIM, and then change the divider of this clock component.

0 Likes