Si5351A 8KHz-160MHz clock generator
Re: Si5351A 8KHz-160MHz clock generator
Ah, thanks.
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
- Sheep64
- In Memoriam
- Posts: 311
- Joined: 11 Aug 2020
- Location: A magnetic field
Re: Si5351A 8KHz-160MHz clock generator
BigEd on Sat 1 May 2021 wrote:
frequencies in the range 8 or 12MHz to 16MHz.
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
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.
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.
Last edited by BigEd on Sun May 16, 2021 4:02 pm, edited 1 time in total.
Re: Si5351A 8KHz-160MHz clock generator
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
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
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.
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/
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
Re: Si5351A 8KHz-160MHz clock generator
drogon wrote:
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...
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
- Sheep64
- In Memoriam
- Posts: 311
- Joined: 11 Aug 2020
- Location: A magnetic field
Re: Si5351A 8KHz-160MHz clock generator
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:-
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.
- High speed oscillator or other fine frequency control.
- Stable output.
- Sane defaults.
- Trivially programmed from its own host.
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
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.
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.
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
Re: Si5351A 8KHz-160MHz clock generator
enso wrote:
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 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
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
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
That is most peculiar!
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut