BigEd wrote:
Interesting thought. Using the SPI clock on a recent Pi, then, would be to take an even divisor off 400MHz, which means we can set a clock period on a 5ns granularity.
I have not investigated recent Pi (ie. the v4)'s SPI clock, but on the earlier ones it's not regular - it appears approximately like 8 cycles of high, low, then an extra half cycle of low. There's no glitch just that extra half cycle (approximately) Also you need to get the Pi to send data to make the clock wiggle - not a real issue but that will limit the time you can run the clock for.
This does not appear to have any effect on peripherals but might give arise to some irregularities when clocking CPUs..
However there is actually a programmable clock output on all Pi's, so use that instead.. You can select which internal oscillator drives the divider and the divide ratio although I don't have notes to hand about the actual range of frequencies but its been used to create FM radio signals in the past...
(just remember it's all 3.3v)
-Gordon
_________________
--
Gordon Henderson.
See my
Ruby 6502 and 65816 SBC projects here:
https://projects.drogon.net/ruby/