Electrical – SPI master and slave operating frequency

frequencyoscillatorspi

If a master is operating at 4MHz and the slave is at 16MHz the data should still be sampled at the speed of the SCLK pin, the frequency difference shouldn't matter right?

I used a Mikroe Dev board and tried to communicate to a CAN peripheral using SPI.
The board module operated @ 16MHz using a external oscillator while my MCU only used its internal 4MHz clock no commands worked until an external oscillator was used at 16MHz.

Can a master and slave operate at two different frequencies not the SCLK pin frequencies but the actual clock cycles frequency?

Best Answer

It comes down to the speed of the peripheral you are trying to interface to. In general the microprocessor or port is at a multiple of the CAN frequency.

You have no problem communicating between SPI master to MCP2251. But 4MHz master would mean 500kHz (divide by 8) CAN-BUS peripheral. Odds are CAN peripheral did not recognize communications if it was 1MHz (or 250kHz).

Your microprocesor was attempting to communicate with a peripheral at a slower rate than the peripheral expected.

Mikro Dev CAN-SPI

Odds are the peripheral can be reconfigured to communicate at the lower speed if you need.