SPI speed changing

Hopefully not too much of a silly question.
I’m talking to SD cards over SPI just using a breakout plank.

Documentation seems to suggest you initialise in 100-400khz and after that bump it up.

There doesn’t seem to be a way I can see to edit spi speed in session and exiting shuts off voltage. This means you can’t initiate in 400 and then move up later on.

Am I missing something or just not understanding something?

Any help would be appreciated.

1 Like

You can just “reinitialize” the SPI mode (just type m spi) to change the configuration. This will however disable the power supplies. I do not think there is a way to change the speed without disabling the power supplies.

However i do not think this is necessary anyways, as this is not a “typical” SPI requirement. I read the “initialise in 100-400khz and after that bump it up” as: “ensure that your wiring and commands work at a lower speed and afterwards test it at higher speeds”. Lower speeds are not as error prone from an hardware point of view. If you have long wires, high speeds might not be possible.

I am not an expert, but i hope my thoughts help.

2 Likes

Yes it seems that its more data transfer that needs to be in the MHz not just sending commands and reading info which can be 400kHz.

I think you could comment the line 175 in the file ui_mode.c and test if this works for you:

modes[HIZ].protocol_setup_exc();                  // disables power supply etc.

This should stop the disabling of of the power supplies when running the “m” command. However, this could create some unforeseen issues. I tested this quickly and i could change the speed by running the “m” command a second time, without turning the power supplies off. (I just measured the clk as a test)

Is this what you would need to test your card?

1 Like

O that could it be I will give it a try. Thank you.