Hello I would like to know if there is anyway to create a synchronous clock signal to the SPI clock pin using another GPIO.

I have this IC that needs another signal that is synchronous to the SLCK of the SPI, aside from being i would also like for it to be possible so that i can divide is frequency by a factor of 2 and 3 from the SLKC. The Fastest frequency the SPI will run at is 10MHz.

enter image description here

The code can be either Python/C++ anyway i can always just import the function to another.What makes it harder is that i need it to be as non blocking as possible because it needs to run alongside the SPI clock

  • 1
    Just a quick comment. I agree using software is a bit hard. On the other hand, using hardware: logic gates, flip flops, shift registers, binary counters, etc would be 10 times easier. I have no idea at all how to use software. Good luck and cheers.
    – tlfong01
    May 15, 2020 at 14:57
  • 1
    @tlfong01 i was hoping if it was possible to elimanate the hardware and just sacrifice GPIO pin
    – Jack
    May 15, 2020 at 15:18
  • Well, it is too low level, and those low level stuff is not open source. You might make guesses and trial and errors workarounds, but then as version changes and you get stuck. On the other hand, hardware solution is not only OS invariant, but platform independent, ie, add on hardware works for any SPI in this Earth and also Galaxy.
    – tlfong01
    May 16, 2020 at 7:38

1 Answer 1


You will not be able to generate those signals from SCLK using Pi software.

You will need external hardware to derive the signals.

  • Thats unfortunate, A quick question though what does a asynchronous signal mean, i seem to be getting mixed information about it. For example one site says synchronous means deriving from one master clock. But in the 4-bit Modulo-16 Counter section of the article it says asynchronous even though its deriving from one master clock
    – Jack
    May 15, 2020 at 15:36
  • I'm not sure what distinction they are trying to make, it seems like a hardware/electronics technical point. You will need to feed SCLK into some sort of hardware divider.
    – joan
    May 15, 2020 at 16:11

Your Answer

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

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