Need help with calculation SPI Frequency
Your calculations are correct (sort of), but this is not a good way to do SPI given you have a feature packed microcontroller. You should use the SPI module on your microcontroller - this will generate all the signals and protocol correctly. You've missed that you also need to update the data at each clock tick. So (depending on the SPI phase), it will be more like: clock down > change data > clock up.

Having a toggling pin is not optimal for a couple of reasons:


You also need to update your data, so just toggling the pin tends to give uneven mark/space.
Any interrupts that happen will stop transmission.


Bit-banging is great if you have a low-power microcontroller without proper hardware, and just want something quick and easy. It's a fun exercise to write your own reusable code for such situations, but these days even the lowest end micros come with hardware SPI (it's essentially just a shift register).