Shop OBEX P1 Docs P2 Docs Learn Events
SiLabs Si5351 Clock generator SPIN driver — Parallax Forums

SiLabs Si5351 Clock generator SPIN driver

ozpropdevozpropdev Posts: 2,791
edited 2016-01-27 06:10 in Propeller 1
Hi All

I have been playing with the SiLabs Si5351 Clock genertor in the form of the Adafruit Si5351 Breaksout board.
The device is neat, but requires a little bit of work configuring the registers.

Silabs have a design tool "ClockBuilder" which assists in the configuration of the device.
This tool produces a configuration file containg all the necessary register settings to get it all up and running.

I have included three programs to help get things going from a Propeller.

1. "si5351_spin_demo_2.spin"
This program allows the user to provide a single frequency and it does all the necessary calculations and configures the device.
The demo allows for freqquencies in the range of 2MHz to 150MHz.
It does not support any of the advanced functions of the device (Prescalers,offsets,etc).
Si5351 Clock Generator test
Enter frequency in MHz? 12.34
 Set to 12340000 Hz
 Measured freq. = 12339414 Hz
Enter frequency in MHz? 23.45
 Set to 23450000 Hz
 Measured freq. = 23448886 Hz
Enter frequency in MHz? 34.56
 Set to 34560000 Hz
 Measured freq. = 34558355 Hz
Enter frequency in MHz?



2. "extract_v1.spin"
This program is used to extract the register data from the file generated by ClockBuilder and outputs spin code
that is properly formatted to paste into the "cb_loader.spin" program.
'Si5351 Register map
'Extracted from ClockBuilder output file

'#Channel 0 # Output Frequency (MHz) = 67.890000000
'#Channel 1 # Output Frequency (MHz) = 45.670000000
'#Channel 2 # Output Frequency (MHz) = 56.780000000

regmap
        byte    $00,$00,$18,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
        byte    $6F,$2F,$4F,$80,$80,$80,$80,$80,$00,$00,$02,$71,$00,$0B,$A0,$00
        byte    $01,$60,$02,$71,$00,$0E,$4B,$00,$00,$65,$00,$01,$00,$04,$00,$00
        byte    $00,$00,$11,$D7,$00,$06,$EB,$00,$05,$A3,$00,$01,$00,$04,$00,$00
        byte    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
        byte    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
        byte    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
        byte    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
        byte    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
        byte    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
        byte    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
        byte    $00,$00,$00,$00,$00,$30,$00,$D2,$60,$60,$00,$C0,$00,$00,$00,$00
        byte    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
        byte    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$0D,$00,$00
        byte    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
        byte    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

3. "cb_loader.spin"
This program will configure the device using the extracted register data from ClockBuilder.
Using Clockbuilder allow full function support of the device (3 channels and prescalers,speed spectrum,offsets,inversion,etc)

Comments

  • jmgjmg Posts: 15,148
    That's cool.
    I've been testing Si5351 into C8051F850 & EFM8LB1 (CLU) as prescalers, and they seem to work all the way to 200MHz.
    I think a Si5351 can push to >225MHz (VcoMAX/4), but I cannot test that yet.
    I did find using a Serial-i2c bridge, that above ~ 100MHz, cable length & grounding matters, or the RF clocks can get into the i2c bus, giving confusing operation.
  • TubularTubular Posts: 4,622
    edited 2016-01-27 23:28
    Awesome work

    I think this will be really useful for 'redlining' P8x32As, and also P1Vs - clocking them at their max speed before some instruction on the critical path just begins to fail.

    It'll be interesting to see what instruction fails first, and whether its the same for all cogs. If one cog fails at a slightly lower frequency than others, that cog can be used in a test mode to control the Si5351 clock generator
Sign In or Register to comment.