I'm trying to simulate a certain µController to characterize and measure a certain chip.

I need to write my data on the negative edge of the master clock and read the data coming from the slave in the positive edge of the master clock. Is there any way I can have this kind of freedom in my code? Or do I have to do it manually without using the predefined SPI interface?

Also, I would like to have my master clock running continuously without going idle… is there a way to do that too?

1 Answer 1


To set the spi to shift out on falling edge and shifting in on rising edge of the clock you need to set the spi mode to 0 or 2 (depends on idle clock polarity).

More info here

To continuously generate clock signal as far as I remember you will need to write to the SPI dummy values.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.