Shop OBEX P1 Docs P2 Docs Learn Events
Si5351/Prop/BITX40 ham radio project — Parallax Forums

Si5351/Prop/BITX40 ham radio project

Hi All,

I'm working on a ham radio project that uses the Si5351 clock chip. The target is the VFO of a BITX40, SSB 5 watt HF transceiver. A quick shout out, any hams who want a ton of fun for $60 go check out the BITX40. Very fun and hackable rig. The radio currently use an Arduino that comes with it, so of course we need to ditch that and get a Prop in charge! So, I got a Si5351 board from QRP labs to play with. I got it up and running with the Si5351 object in the OBEX. But it is way off frequency. I did some fooling around with the Arduino/Si5351 and while it is a little off and needs some correction, once corrected it is spot on. Meaning that the offset is consistent over a wide range of frequencies. Whereas the one I have hooked up to the Prop is WAY off and the offset is NOT consistent over a range of frequencies. For example:

MHz
2 = 2.16
4 = 4.32
8 = 8.64

Or rather, seems consistent as a percentage. Any ideas what could be causing it? Is it possible that it is a coding issue? Or is the Si5351 having issues?


Comments

  • jmgjmg Posts: 15,173
    Jonathan wrote: »
    ... Whereas the one I have hooked up to the Prop is WAY off and the offset is NOT consistent over a range of frequencies. For example:

    MHz
    2 = 2.16
    4 = 4.32
    8 = 8.64
    Or rather, seems consistent as a percentage. Any ideas what could be causing it? Is it possible that it is a coding issue? Or is the Si5351 having issues?
    Hmm, lets see.... :
    2.16*25/27 = 2
    That suggests your maths based on 25MHz, but the board instead uses a 27MHz Xtal ?


  • And the smart guy of the day award goes to... JMG! Bingo! You are exactly right. Went and looked at the calc_freq part of the driver, changed 25MHz to 27 and off we went!

    Thanks brother! Now I have to go and try to add the needed commands to the driver as I need access to functions not in the OBEX driver. So I'm sure I'll be back with more questions! But at least I can start fooling with it and look forward to have a Prop controlled BITX40.
  • jmgjmg Posts: 15,173
    I presume you have seen this,
    https://github.com/NT7S/Si5351
    could be useful reference ?
  • JMG,

    Thanks. I have been looking at the library used by the Arduino and the Si data sheet and yikes! Pretty tough for a bottom feeder coder like myself. I'll confess that I am feeling a little daunted after getting off to a good start. I'll see if I can unravel enough of the C to figure out what I need. Which luckily isn't anything fancy, just control over two fo the outputs and setting the output drive level and a couple other things. I'm surprised that there isn't a more complete library for this chip.

    Thanks for the help and wish me luck! If I can't get it to run on the Prop alone I can maybe use the Arduino to run the clocks and the prop for everything else. A clumsy two layered solution to be sure.
  • The prop with its counters should be able to handle clocks!
    Jim
  • Jim, I probably shouldn't have used the term clocks. What is needed is a VFO and BFO, both of which need to go to at least 14MHz with a high degree accuracy. So the Prop on it's own isn't going to cut it.
  • I have been looking for a long time to get a decent Ham band SSB transceiver kit. The BITX40 looks like a great start and base to do this, BUT using the Prop would be a huge plus. It would have to cover 80, 40 20 and 15 meters - and have at least 40 or 50 Watts output. Surely there are enough options (and local expertise) to use the BITX40, Prop, and a RF power output module? Lets use the new FLiP Module as a start and go from there. Any takers, funding, whatever? de W1HV
  • The BITX is a really neat rig. I'd call it "kit lite" as all the board parts are already mounted. All the user needs to do is wire up controls and power. The fun of rig is all the hacks and mods that are out there and ever evolving.

    Let's start getting the VFO/BFO working. Grab a Si5351 board from QRP labs, or there are others out there. Once we get that working with the BITX, we are off to the races. Sadly I know with my limited programming the Si5351 is going to be a heavy lift for me. Once I get that working, the rest of the menu code etc will be easy.

    So yeah, anyone wanting to jump in on a Prop/BITX40 collaboration chime in!
  • I always liked the TenTec Argonaut and Triton series - simple, reliable and anyone could fix them. easy on the pocketbook too. It is crazy to spend $800 or more for a basic SSB Ham band radio - can we stay under $300 here!!! Just give me the popular bands and be done with it. Minimum of extras, just get me on the air. I don't need RIT, auto tuning, dozens of bells, whistles and filters. Anything you can do in software the better. Keep the BITX SSB transceiver and VFO Si5351but I do need more power. 50 Watts would be nice so I never loose a contact, and save my battery to boot ( 6 or 7 Amps at 12 volts is nice) Using the FLiP module and judicious selection of basic components: BITX, Si5351, display and front panel, to keep costs under control. Carry on...
  • jmgjmg Posts: 15,173
    Jonathan wrote: »
    Thanks. I have been looking at the library used by the Arduino and the Si data sheet and yikes!

    Taking a quick look at the Ardunio code, it does not use floating point, but it does use 32*32->64 and 64/32 -> 32 math operations.
    It sparingly uses uint64_t, and calls do_div(uint64_t,uint32_t)

    The PropC docs do show uint64_t, uint_least64_t, uint_fast64_t , so a PropC expert may know how to port the 64:32 mixed code.
    Jonathan wrote: »
    If I can't get it to run on the Prop alone I can maybe use the Arduino to run the clocks and the prop for everything else. A clumsy two layered solution to be sure.
    True, but you can prove the code works on AVR, then port to Prop, and confirm it still works :)
  • I'm going to give it a shot but to be honest I don't even know where to start. I have never done C and so far I am not seeing what I need to see in the Arduino code but I'll keep puzzling over it.
  • Using native SPIN on the Prop makes more sense. And if you get stuck there are plenty of us to help you out. There has never been a project that I have gotten in a bind with, using the Prop and SPIN. Code is code, right?
  • Yeah, it does make more sense to have it all Prop. And perhaps with the help here I can make it work. I'm at work for a 48 hour shift but when I get home I'll take a stab at it. While I'm here at work I'll do some studying of the Arduino C code and see what I can puzzle out.

    And while code is code, not all of us are created equal in our ability to create it! I'm more of a hardware guy.

    And as to QRO, there are plenty of ways to do that. I get over 50 watts out of a SB-200 driving it with the BITX. You can get more drive than claimed with a higher PA voltage and a good heat sink.

  • jmgjmg Posts: 15,173
    Jonathan wrote: »
    What is needed is a VFO and BFO, both of which need to go to at least 14MHz with a high degree accuracy.
    What exact numbers do you need here ?
    The Si5351 uses fractions in two places, one in the VCO feedback, which will be somewhat averaged, but they can also use fractions in the VCO output divider.
    I'm not quite sure how SiLabs get their claimed jitter, give the VCO MHz and output divider fractions, but I have seen mention of locking the post VCO divider to integer only, to improve Jitter.
    That does give compromises on Synth Steps, because you now have only one fractional choice, not two.

    This is the Data sheet:
    3. Jitter is highly dependent on device frequency configuration. Specifications represent a “worst case, real world”
    frequency plan; actual performance may be substantially better. 
    Three-output 10 MSOP package measured with clock outputs of 74.25, 24.576, and 48 MHz.
    
    Period Jitter2,3 JPER   
       20-QFN, 4 outputs running,  1 per VDDO       — 40 95 ps, pkpk
       10-MSOP or 20-QFN,   all outputs running     — 70 155 ps, pkpk
    Cycle-to-Cycle Jitter2,3 JCC
       20-QFN, 4 outputs running,  1 per VDDO       — 50 90 ps, pk
       10-MSOP or 20-QFN, all outputs running       — 70 150 ps, pk
    Period Jitter VCXO2,3 JPER_VCXO
       20-QFN, 4 outputs running, 1 per VDDO        — 50 95 ps, pkpk
       10-MSOP or 20-QFN, all outputs running       — 70 155 ps, pkpk
    Cycle-to-Cycle Jitter VCXO2,3 JCC_VCXO
       20-QFN, 4 outputs running, 1 per VDDO        — 50 90 ps, pk
       10-MSOP or 20-QFN, all outputs running       — 70 150 ps, pk
    
    and this is how ClockBuilder creates 74.25, 24.576, and 48 MHz.
    PLL_A:
       Enabled Features = None
       Fvco             = 768 MHz
       M                = 30.72 [ 30 + 18/25 ]
       Output0:
          R              = 1  (2^0)
          Fout           = 74.25 MHz [ 74 + 1/4 MHz ]
          N              = 10.3434343434343434... [ 10 + 34/99 ] 
       Output1:
          R              = 1  (2^0)
          Fout           = 24.576 MHz [ 24 + 72/125 MHz ]
          N              = 31.25 [ 31 + 1/4 ]
       Output2:
          R              = 1  (2^0)
          Fout           = 48 MHz
          N              = 16
    
    In two cases, N is fractional.
  • JMG,

    The current BITX VFO tunes in 100Hz increments. This is fine but I wouldn't mind 10Hz increments. The low end would be 3.5MHz, so we don't run into the issues of the lower end of the Si5351 where some tricks need to be pulled. The high end would be 14.35MHz.

    The BFO is less particular, for LSB it is set to ~ 12MHz and USB I think it is ~ 19MHz.
  • jmgjmg Posts: 15,173
    PropGuy2 wrote: »
    Using native SPIN on the Prop makes more sense. And if you get stuck there are plenty of us to help you out. There has never been a project that I have gotten in a bind with, using the Prop and SPIN. Code is code, right?

    Yes, but there is some 64/32 code, that I think Spin has no native support for, so that would need some PASM support in a 'maths cog'.
    Then, there is a question of how slow Spin will be, as some of the code scans, looking for a 'best result' fit.
  • jmgjmg Posts: 15,173
    PropGuy2 wrote: »
    Using native SPIN on the Prop makes more sense. And if you get stuck there are plenty of us to help you out. There has never been a project that I have gotten in a bind with, using the Prop and SPIN. Code is code, right?

    Yes, but there is some 64/32 code, that I think Spin has no native support for, so that would need some PASM support in a 'maths cog'.
    Then, there is a question of how slow Spin will be, as some of the code scans, looking for a 'best result' fit.
  • My umath object includes a 64/32 = 32 unsigned division routine in Spin:
    {
    ┌──────────────────────────────────────────────────────────┐
    │      32- and 64-bit unsigned math routines in Spin.      │
    │(c) Copyright 2008 Philip C. Pilgrim (propeller@phipi.com)│
    │            See end of file for terms of use.             │
    └──────────────────────────────────────────────────────────┘
    
    This Propeller object provides the following unsigned integer math functions:
    
      div: Divides a 64-bit integer by a 32-bit integer to yield a 32-bit quotient.
    
      multdiv: Multiplies a 32-bit integer by the rational fraction formed by
        the ratio of two 32-bit numbers.
    
      unsigned comparisons: <, =<, =>, and >
    
    }
    
    CON
    
      UGT           = %100
      EQ            = %010
      ULT           = %001
    
    VAR
    
      long  producth, productl
    
    PUB multdiv(x, num, denom)
    
    '' Multiply x by num, forming a 64-bit unsigned product.
    '' Divide this by denom, returning the result.
    '' x ** num must be less than (unsigned) denom.
    
      mult(x, num)
      return div(producth, productl, denom)   
    
    PUB div(dvndh, dvndl, dvsr) | carry, quotient
    
    '' Divide the 64-bit dividend, dvdnh:dvndl by the 32-bit divisor, dvsr,
    '' returning a 32-bit quotient. Returns 0 on overflow.
    
      quotient~
      if (ge(dvndh, dvsr))
        return 0
      repeat 32
        carry := dvndh < 0
        dvndh := (dvndh << 1) + (dvndl >> 31)
        dvndl <<= 1
        quotient <<= 1
        if (ge(dvndh, dvsr) or carry)
          quotient++
          dvndh -= dvsr
      return quotient
    
    PUB gt(x,y)
    
    '' Return true if x > y unsigned.
    
      return cpr(x,y) & UGT <> 0
    
    PUB ge(x,y)
    
    '' Return true if x => y unsigned.
    
      return cpr(x,y) & constant(UGT | EQ) <> 0
    
    PUB le(x,y)
    
    '' Return true if x =< y unsigned.
    
      return cpr(x,y) & constant(ULT | EQ) <> 0
    
    PUB lt(x,y)
    
    '' Return true if x < y unsigned.
    
      return cpr(x,y) & ULT <> 0
      
    PRI mult(mplr, mpld) | umplr, umpld
    
      producth := (mplr & $7fff_ffff) ** (mpld & $7fff_ffff)
      productl := (mplr & $7fff_ffff) * (mpld & $7fff_ffff)
      if (mplr < 0)
        dadd(producth, productl, mpld >> 1, mpld << 31)
      if (mpld < 0)
        dadd(producth, productl, mplr << 1 >> 2, mplr << 31)
    
    PRI dadd(addh, addl, augh, augl)
    
      producth := addh + augh
      productl := addl + augl
      if (lt(productl, addl))
        producth++
    
    PRI cpr(x, y)
    
      if (x == y)
        return EQ
      elseif (x ^ $8000_0000 > y ^ $8000_0000)
        return UGT
      else
        return ULT
        
    {{
    ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
    │                                                   TERMS OF USE: MIT License                                                  │                                                            
    ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
    │Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation    │ 
    │files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,    │
    │modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software│
    │is furnished to do so, subject to the following conditions:                                                                   │
    │                                                                                                                              │
    │The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.│
    │                                                                                                                              │
    │THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE          │
    │WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR         │
    │COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,   │
    │ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                         │
    └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
    }
    

    -Phil
  • Mark_TMark_T Posts: 1,981
    edited 2017-05-25 12:55
    I have been wondering about hooking a Prop to one of the VHF capable DDS chips like the AD9951 and
    seeing what can be done on the 2m band (although I'm a long lapsed amateur (G1XMO), I recently
    bought a spectrum analyser, which has rekindled an RF interest.

    I might start playing with the dirt cheap AD9833 modules (10 bit DDS upto about 10MHz) and direct quadrature
    SSB with a pair of them.

    [ No problem with frequency resolution with DDS :) ]
  • Ozpropdev, it is your object and that thread that I am using for a start. Still in way over my head, I can't seem to figure out what I need to set drive levels, PLL settings and what not. Busy week in the physical world this week but should have some time on Sunday to dig deeper.

    Mark, if you do play with the AD9833 keep me informed! Sounds like a fun project! Renew yer ticket too!

Sign In or Register to comment.