Shop OBEX P1 Docs P2 Docs Learn Events
Switching between 5MHz and 6MHz — Parallax Forums

Switching between 5MHz and 6MHz

hippyhippy Posts: 1,981
edited 2007-12-20 22:11 in Propeller 1
Anyone any good ideas on switching between a 5MHz and 6MHz crystal at run-time ? I've done similar manually in the past with both in series and a SPDT switch to short across one or the other but was wondering about more program controlled ways.

The best I can think of is two oscillator modules and a one-of-two selector, or a single 30MHz divided down by 6 or 5.

Would an SPDT switch work with a Propeller ( ProtoBoard ) or do the crystal leads need to be particularly short ? It worked okay with a Hitachi 6301 4MHz/8MHz.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-12-20 19:52
    The oscillator module solutions would work. The SPDT switch would likely have problems with lead length and excess circuit capacitance. You could probably use a small reed relay if you were careful about mounting the crystals and reed relay close to the Prop with short leads. The main thing is that you have to switch to one of the internal clocks long enough for the oscillator and PLL to stabilize before switching back to the external clock.
  • parts-man73parts-man73 Posts: 830
    edited 2007-12-20 21:21
    @ Hippy - What would necessitate that? and would it best be accomplished in software?

    The software would need to be changed slightly anyway, as the program needs a declaration of crystal speed, pll etc, so changing the crystal also would require a change in code.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Brian

    uController.com - home of SpinStudio

    PropNIC - Add ethernet ability to your Propeller!

    SD card Adapter
  • hippyhippy Posts: 1,981
    edited 2007-12-20 22:11
    It's not a necessity, just a convenience. I hadn't considered Mike's point that one might have to switch off the oscillator, but the idea was an unused I/O would stay input ( thus float ) and select 80MHz and if I wanted 96MHz I'd just set the output which would select the 6MHz crystal.

    I'd like to write my own 'not to be published' code for 96MHz but appreciate most published code should be written for 80MHz ( the commonest used ) so it was an idea that I could switch between either without having to worry about the hardware and could use the same hardware for both.
Sign In or Register to comment.