Page 2 of 2
Re: Si5351A 8KHz-160MHz clock generator
Posted: Sat May 08, 2021 3:49 am
by enso
Ah, thanks.
Re: Si5351A 8KHz-160MHz clock generator
Posted: Sun May 16, 2021 2:51 pm
by Sheep64
frequencies in the range 8 or 12MHz to 16MHz.
For testing purposes, a Raspberry Pi's SPI circuitry works in the desired manner and in the desired frequency range. The original model divides 700MHz or so to 350MHz or so and then the SPI circuitry uses this to obtain frequencies up to 16MHz or so to access the SD/MicroSD boot volume. Current versions operate at 1.2GHz or so and may offer 3ns or similar granularity on each phase of a square wave.
It may be awkward to modify Raspbian, NetBSD or RiscOS for this purpose but it may be relatively easy to add this functionality to 8BIT's
65C02 Simulator on a bare metal Raspberry PI. Indeed, there is a certain symmetry to test the speed of a physical 6502 with a fast simulated 6502.
I have another partial solution. Add a register to a clock stretching circuit. This would set a minimum cycle time but otherwise does not disrupt clock stretching functionality. This may lack the desired granularity but it has the useful property that power-up reset to the latch sets the system to the most conservative cycle time. The minimum hardware requirement is a spare address strobe, one or more counter chips for clock stretching, one 74x161 counter chip to operate as a 4 bit latch (or 74x574 8 bit latch) and one or more 74x08 quad AND gates.
Re: Si5351A 8KHz-160MHz clock generator
Posted: Sun May 16, 2021 3:32 pm
by BigEd
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.
It might be the case - especially with bare-metal code - that we can use one of the PLLs to do even better. The video PLL for example might not be in use.
But, I notice the head post mentions the Si5351A - and thanks to @revaldinho, I now have one of
the adafruit boards, as does he, and as does @hoglet. And it does indeed seem to be very flexible and fit for purpose. The only thing is, it must be configured after power on by I2C, so we need something or other (presently Arduino, or actually Teensyduino on a Teensy) to tell it what to do.
Re: Si5351A 8KHz-160MHz clock generator
Posted: Sun May 16, 2021 3:59 pm
by hoglet
We've been using the Si5351A for a few days now as a flexible clock source for Beeb816.
It's actually been working quite well.
Here are a few snaps.
It's currently just sitting on a breadboard being driven by a spare Teensy:
This is the code that's running on the Teensy:
https://github.com/hoglet67/si5351stand ... dalone.ino
You can set the frequency using the push buttons (in 100KHz steps) or by sending a number over the USB serial port.
Here's the output at 32MHz:
And at 100MHz:
The jitter is about +/- 100ps, and this doesn't seem to vary much as the frequency changes.
You can also seem to be able to change the frequency without the clock glitching.
The edge time is ~1ns when the drive is configured to the maximum of 8mA.
Dave
Re: Si5351A 8KHz-160MHz clock generator
Posted: Sun May 16, 2021 4:59 pm
by drogon
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
Re: Si5351A 8KHz-160MHz clock generator
Posted: Sun May 16, 2021 5:19 pm
by hoglet
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...
Are you referring to the General Purpose Clock outputs (GPCLK0-2):
https://www.raspberrypi.org/app/uploads ... f#page=105
You can choose any of the PLLs as the clock source.
PLLC (the ARM clock) on a Pi Zero defaults to 1,000MHz.
This should result in a jitter of +/- 500ps, so about 5x worse than the SI5351A, but fine for many applications.
Dave
Re: Si5351A 8KHz-160MHz clock generator
Posted: Fri May 21, 2021 11:32 am
by Sheep64
I thought that Raspberry Pi might be vaguely off topic. However, I assumed that 6502 hardware enthusiasts - and especially those of Acorn persuasion - might have overlooked functionality of their existing equipment. Regardless, the difficulty of high speed oscillators leaves us with a classic "Good, fast, cheap - choose any two." In this particular case, choose any two from:-
- High speed oscillator or other fine frequency control.
- Stable output.
- Sane defaults.
- Trivially programmed from its own host.
I presume Si5351A uses I2C and provides no preset pins or memory because this uses the absolute least resources or is otherwise the lowest manufacturing cost. I would dearly like Si5351A with, for example, increment/decrement pins and a range of defaults. Unfortunately, such a device would be ridiculously expensive due to economy of scale and people fudging solutions with cheaper variants.
I am amused and slightly exasperated that Raspberry Pi SPI drops ticks. They should have divided by another factor of two but it is good enough - and possibly preferable - for its primary purpose.
Re: Si5351A 8KHz-160MHz clock generator
Posted: Sat May 22, 2021 12:45 am
by enso
I suppose anything outside Si5351A os somewhat off topic, but I should have broadened the topic in the first place.
I would appreciate code examples for the Raspi - for a reasonable range of square wave output frequencies. Any language is fine. Thanks.
Sheep64, I dont think dividing the clock would help. It sounds like the SPI state machine takes some time off to flop the byte for output and the freshly shifted-in byte for input.
As for a self-configuring Si, a 3-cent controller would do the trick...Hardly a major expense, but you can do it yourself with your own favorite controller, and get exactly what you need. I doubt most users would agree on presets or step amounts...
Hoglet, what is the default frequency out of Si5351A upon power up and reset? Or is it silent until configured? Could a system start up with one and self-configure the Si to bump up the clock? I think Dr.Jefyll was wondering about that earlier.
Re: Si5351A 8KHz-160MHz clock generator
Posted: Sat May 22, 2021 6:57 am
by hoglet
Hoglet, what is the default frequency out of Si5351A upon power up and reset? Or is it silent until configured? Could a system start up with one and self-configure the Si to bump up the clock?
The initial device configuration is stored in a one-time-programmable NVRAM that is factory programmed.
The part number format/options are explained on page 4 of the datasheet:
https://www.silabs.com/documents/public ... pdf#page=4
My one is silent on startup, but it's possible other versions exist. I'll do some more research...
Unfortunately the programming algorithim is not public.
This post provides some more details:
https://forums.adafruit.com/viewtopic.p ... 02#p419390
Dave
Re: Si5351A 8KHz-160MHz clock generator
Posted: Sat May 22, 2021 8:22 am
by hoglet
This page lets you lookup the frequency of a given SI5351A part:
https://www.silabs.com/timing/lookup-customize
Here's an example that defaults to 24.576MHz on CLK0: Si5351A-B02075-GT
https://www.silabs.com/TimingUtility/ti ... -B02075-GT
(Click on the Data Sheet Addendum for further details on the configuration)
Mouser have these:
https://www.mouser.co.uk/ProductDetail/ ... KY5Q%3D%3D
They also have lots of other variants, but it's not straightforward to find a part of a given frequency.
Dave
Re: Si5351A 8KHz-160MHz clock generator
Posted: Sun May 23, 2021 3:34 am
by enso
That is most peculiar!