-1
\$\begingroup\$

Using STM32l476 controller. Master is running at 30 MHz and slave is running 15 MHz.

  • In SPImaster, clock should be system clock/2.
  • In slave, clock should be system clock/4.

Question:

  • My understanding is slave need clock from master. Data shifting completely depends on masters clock. In that case why datasheet mentions slave clock selection condition?
  • Which is max clock speed I can choose in the above scenario?
  • What if Master clock is 32 MHz ?How to choose frequency? If you divide 15/4 = 3.75 MHz, with 30 MHz Master clock can be scaled down to 30/8 = 3.75 MHz

Thanks

\$\endgroup\$
  • \$\begingroup\$ Maximum clock frequency is determined by wire length and EMC concerns and not so much by MCU clock capacity. \$\endgroup\$ – Lundin Jan 29 at 8:30
1
\$\begingroup\$

In SPImaster clock should be system clock/2 slave clock should be system clock/4

I didn't read the datasheet, but I'm pretty sure it says something like "... should NOT EXCEED system clock/..."

Question 2: Which is max clock speed I can choose in the above scenario?

With the requirement you mentioned, you would end up at max. 15/4 = 3.75 MHz.
But be aware that the max. clock speed also depends on your HW design (wire length, wire type, ...) and your environment (immunity to EMC, ...).

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.