Author Topic: Switching between crystal oscillators?  (Read 11044 times)

0 Members and 1 Guest are viewing this topic.

Offline AmmoJammoTopic starter

  • Frequent Contributor
  • **
  • Posts: 808
  • Country: au
Switching between crystal oscillators?
« on: December 23, 2013, 09:05:11 pm »
I'm wanting to switch between an 8, and 10mhz crystal oscillator.

Ya know, those 4 pinned metal cans that run off 5volts, with the frequency out on one of the pins...

Can I simply leave the "out" pins in parallel, and switch the +5volt between the two devices.

Or, should I tie the +5volt to ground on the oscillator that isn't being used?

Or will the "out" pins being in parallel cause issues? I don't really want to simply switch the 8/10mhz signal, as it means longish wires.

Thanks! I've googled, I can't find much information on this :(
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Switching between crystal oscillators?
« Reply #1 on: December 23, 2013, 09:17:55 pm »
Switch the signals. Don't do it directly, with your clocks running up the wires, but use the signal coming back from the switch to select. Something like this (you could accomplish with (probably) two transistors, but IMO the 7400-based solution is quite clean)

Note that the clocks will be mixed while the switch is in transit if it's a break-before-make. You could use a SPST to return just one binary value, then use the fourth unit in the 7400 to invert it, and send one to each of the select inputs, rather than the SPDT, if that is a problem. A make-before-break will silence the clocks while in transit.
« Last Edit: December 23, 2013, 09:19:56 pm by c4757p »
No longer active here - try the IRC channel if you just can't be without me :)
 

Online tszaboo

  • Super Contributor
  • ***
  • Posts: 7366
  • Country: nl
  • Current job: ATEX product design
Re: Switching between crystal oscillators?
« Reply #2 on: December 26, 2013, 05:16:08 pm »
I'm wanting to switch between an 8, and 10mhz crystal oscillator.

Ya know, those 4 pinned metal cans that run off 5volts, with the frequency out on one of the pins...

Can I simply leave the "out" pins in parallel, and switch the +5volt between the two devices.

Or, should I tie the +5volt to ground on the oscillator that isn't being used?

Or will the "out" pins being in parallel cause issues? I don't really want to simply switch the 8/10mhz signal, as it means longish wires.

Thanks! I've googled, I can't find much information on this :(
Oscillators are so damn expensive, you are probably better if you use one crystal, and a microcontroller with PLL and clock out pin...
But seriously, I've just checked Farnell, and an LPC1111 and a 8 mhz crystal is cheaper like 40% than the two oscillator...
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19491
  • Country: gb
  • 0999
Re: Switching between crystal oscillators?
« Reply #3 on: December 26, 2013, 06:49:10 pm »
You're right, those oscillator modules are expensive.

If you go for the logic gate option, you might as well buy two crystals and make your own oscillators which you can switch between.
 

Offline AmmoJammoTopic starter

  • Frequent Contributor
  • **
  • Posts: 808
  • Country: au
Re: Switching between crystal oscillators?
« Reply #4 on: December 27, 2013, 09:58:09 pm »
I was wanting to switch crystals in a Sega Mega Drive, to switch between an 8Mhz oscillator, and 10Mhz.

The original clock speed is 7.61 MHz in PAL consoles, 7.67 MHz in NTSC (apparently)

The idea was to have 8mhz for "stock" speed, and 10mhz for overclocked.

I have however simply soldered the 10Mhz oscillator in, to see how it goes, if I find any games are unreliable at the higher speed, I'll look into adding a switch ;)
 

Offline Rory

  • Frequent Contributor
  • **
  • Posts: 410
  • Country: us
Re: Switching between crystal oscillators?
« Reply #5 on: December 28, 2013, 12:56:32 am »
I was wanting to switch crystals in a Sega Mega Drive, to switch between an 8Mhz oscillator, and 10Mhz.

The original clock speed is 7.61 MHz in PAL consoles, 7.67 MHz in NTSC (apparently)

The idea was to have 8mhz for "stock" speed, and 10mhz for overclocked.

I have however simply soldered the 10Mhz oscillator in, to see how it goes, if I find any games are unreliable at the higher speed, I'll look into adding a switch ;)

What kind of monitor are you using? Will it handle the different video clocking rate if you change the clock?
 

Offline AmmoJammoTopic starter

  • Frequent Contributor
  • **
  • Posts: 808
  • Country: au
Re: Switching between crystal oscillators?
« Reply #6 on: December 28, 2013, 01:52:08 am »
I was wanting to switch crystals in a Sega Mega Drive, to switch between an 8Mhz oscillator, and 10Mhz.

The original clock speed is 7.61 MHz in PAL consoles, 7.67 MHz in NTSC (apparently)

The idea was to have 8mhz for "stock" speed, and 10mhz for overclocked.

I have however simply soldered the 10Mhz oscillator in, to see how it goes, if I find any games are unreliable at the higher speed, I'll look into adding a switch ;)

What kind of monitor are you using? Will it handle the different video clocking rate if you change the clock?

Only the CPU clock is being changed.

Well, the video clock has already been modified to handle the NTSC/PAL switch (from memory)

 

Online tszaboo

  • Super Contributor
  • ***
  • Posts: 7366
  • Country: nl
  • Current job: ATEX product design
Re: Switching between crystal oscillators?
« Reply #7 on: December 29, 2013, 01:03:37 am »
I was wanting to switch crystals in a Sega Mega Drive, to switch between an 8Mhz oscillator, and 10Mhz.
0
So you just want to make insanely hard by changing the speed of every event to ~130%? Or arent the games based on the CPU clock? Am i missing something?
 

Offline AmmoJammoTopic starter

  • Frequent Contributor
  • **
  • Posts: 808
  • Country: au
Re: Switching between crystal oscillators?
« Reply #8 on: December 29, 2013, 11:40:29 pm »
I was wanting to switch crystals in a Sega Mega Drive, to switch between an 8Mhz oscillator, and 10Mhz.
0
So you just want to make insanely hard by changing the speed of every event to ~130%? Or arent the games based on the CPU clock? Am i missing something?

It doesn't speed up the games noticeably, but the stock speed is known to struggle with some games... From what I've read, 10Mhz helps with these games, without causing any issues I do believe...
 

Offline true

  • Frequent Contributor
  • **
  • Posts: 329
  • Country: us
  • INTERNET
Re: Switching between crystal oscillators?
« Reply #9 on: December 31, 2013, 12:59:14 am »
I was wanting to switch crystals in a Sega Mega Drive, to switch between an 8Mhz oscillator, and 10Mhz.
0
So you just want to make insanely hard by changing the speed of every event to ~130%? Or arent the games based on the CPU clock? Am i missing something?
If you overclock CPU in a Genesis, it's just the CPU. Some games are tied to the cycle speed, but many are instead tied to NMI from vblank and having a faster clock can actually reduce lag (slow stuttering).

I second the opinion of using an MCU. Maybe an LPC810? (modder friendly DIP8, RC osc is maybe good enough, has osc out. $1.20 in 1qty.)
 

Offline gxti

  • Frequent Contributor
  • **
  • Posts: 507
  • Country: us
Re: Switching between crystal oscillators?
« Reply #10 on: December 31, 2013, 03:18:20 am »
No sense building a multiplexer from logic gates when you could just buy a multiplexer. I have used a 74LVC1G157 in a 3.3v application without issue.

Something else to look for, is that many oscillators have an 'enable' input that disconnects the output pin. That would let you connect their outputs together like you originally suggested, but make sure it actually tri-states the output. The functionality varies from part to part.
 

Offline AmmoJammoTopic starter

  • Frequent Contributor
  • **
  • Posts: 808
  • Country: au
Re: Switching between crystal oscillators?
« Reply #11 on: January 07, 2014, 04:57:08 am »
I've ordered a couple of these

http://cds.linear.com/docs/en/datasheet/1799fc.pdf

I found someone else who seems to have used one to overclock a Mega Drive/Genesis, although it seems he really had no idea what he was doing, as instead of switching resistors to select the stock 7.6mhz/overclocked 10mhz, he still switched the oscillator frequency, via the switch, using the onboard 7.6mhz clock...
 

Offline AmmoJammoTopic starter

  • Frequent Contributor
  • **
  • Posts: 808
  • Country: au
Re: Switching between crystal oscillators?
« Reply #12 on: January 29, 2014, 04:25:45 am »
I've ordered a couple of these

http://cds.linear.com/docs/en/datasheet/1799fc.pdf

I found someone else who seems to have used one to overclock a Mega Drive/Genesis, although it seems he really had no idea what he was doing, as instead of switching resistors to select the stock 7.6mhz/overclocked 10mhz, he still switched the oscillator frequency, via the switch, using the onboard 7.6mhz clock...

Alrighty, so these parts arrived yesterday.

I set about wiring one up on the bench to make sure I was doing it right ;)

My multimeter doesn't read the frequency correctly when its in the higher range, so, 10mhz showed up as 9mhz, however, when I set the divider to 1/10, it showed up as 0.98mhz or something...

Anyway!

I installed it, keeping wires as short as possible, (the output pin is soldered directly to the CPU)

And it works, however, one games refuses to work at the "stock" 7.6mhz, and the 10mhz.

I used a 13.2k resistor (22k and 33k in parallel) with I believe works out to be a tad under 7.6Mhz. The 10Mhz resistor is a 10k.

Now, its possible its still being slightly overclocked... or, is it possible the game doesn't like being underclocked?
It should be noted, that its a non genuine version of the game, and the error it comes up with appears to be memory related... at 10Mhz it instantly comes up with an error.

Sorry, this is the best pic I could get of the 1799 frequency generator... (before I connected the switch wires)


How the wiring runs across the board, with the male header so the switches can be unplugged.


And the switches mounted in the side of the case.

 

Offline AmmoJammoTopic starter

  • Frequent Contributor
  • **
  • Posts: 808
  • Country: au
Re: Switching between crystal oscillators?
« Reply #13 on: January 29, 2014, 11:10:59 am »
Alright, I've found a few games now that don't work with the LTC1799...

So, I think I'm going to have to go back to the original plan.... probably a 10Mhz oscillator, and something to switch between that, and the original onboard clock frequency...

So, what's the deal with the 74LVC1G157? :P
 

Offline brabus

  • Frequent Contributor
  • **
  • Posts: 326
  • Country: it
Re: Switching between crystal oscillators?
« Reply #14 on: January 29, 2014, 12:18:17 pm »
Congratulations for the very neat wiring! At the beginning, I was unsure if it was original from the factory, or if it was your mod.

I hope you manage to successfully finish your mod. :)
 

Offline AmmoJammoTopic starter

  • Frequent Contributor
  • **
  • Posts: 808
  • Country: au
Re: Switching between crystal oscillators?
« Reply #15 on: January 29, 2014, 12:29:28 pm »
Congratulations for the very neat wiring! At the beginning, I was unsure if it was original from the factory, or if it was your mod.

I hope you manage to successfully finish your mod. :)

Thanks, I assume you realised it wasn't factory when you traced it back to the cpu  :-DD

The three wires running to the front of the board in the second pic, are for the power led, so it changed from the standard red, to blue, when the console is set to 10Mhz.
 

Offline AmmoJammoTopic starter

  • Frequent Contributor
  • **
  • Posts: 808
  • Country: au
Re: Switching between crystal oscillators?
« Reply #16 on: February 01, 2014, 05:01:16 am »
Switch the signals. Don't do it directly, with your clocks running up the wires, but use the signal coming back from the switch to select. Something like this (you could accomplish with (probably) two transistors, but IMO the 7400-based solution is quite clean)

Note that the clocks will be mixed while the switch is in transit if it's a break-before-make. You could use a SPST to return just one binary value, then use the fourth unit in the 7400 to invert it, and send one to each of the select inputs, rather than the SPDT, if that is a problem. A make-before-break will silence the clocks while in transit.

Thanks! that's exactly what I ended up doing.

In fact, I used a 25+ year old 7400 :p Because it was there!

I built it on the bench first, and tried switching between a 16Mhz, and 10Mhz crystal oscillators, just to make sure it had the bandwidth needed.

seems to switch between the on board 7.6mhz, and the 10mhz oscillator... maybe I should test that it actually works to play games  :-DD





« Last Edit: February 01, 2014, 05:04:31 am by AmmoJammo »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf