Author Topic: DFO: dual frequency oscillator  (Read 9253 times)

Offline micro

  • MassiveMember
  • ****
  • Posts: 392
DFO: dual frequency oscillator
« on: February 01, 2015, 02:50:37 am »
Something not related to videogame controllers for a change... ;)

DFO: dual frequency oscillator
A programmable oscillator that let you switch between two different frequencies

Some months ago I got a X-RGB Mini device, also known as Framemeister. I quickly found out that my modded consoles don't work well with the Framemeister. Switching my PAL Megadrive 2 to 60 Hz or using NTSC games on my PAL PSX introduced massive stuttering, messed up black levels and other picture problems. It just wasn't fun to play the games this way.

The reason why these PAL consoles work fine on 50 Hz but don't on 60 Hz is that PAL and NTSC consoles use oscillators/crystals with different frequencies. Here's a little excerpt from the Megadrive 2 schematics:

You can see the different oscillator frequencies in PAL and NTSC consoles.

NTSC: 53.693175 MHz (= 15 x NTSC subcarrier 3.579545 MHz)
PAL: 53.203424 MHz (= 12 x PAL subcarrier 4.3361875 MHz)

Because all other timings are derived from this master clock, it's easy to see what's the problem. A PAL Megadrive running on 60 Hz has a slightly different picture output rate than a genuine NTSC console. Back in the days this hardly was a problem because CRT TVs are quite tolerant regarding the output rate. But with modern devices like the X-RGB Mini Framemeister this can and will cause problems. This is a known issue, also mentioned in the Framemeister Wiki: http://junkerhq.net/xrgb/index.php/Sega_Genesis

So to restore compatibility with the Framemeister for both 50 and 60 Hz modes, we need an oscillator with two different frequencies to choose from. I've designed such an oscillator using the CDCE913 clock generation ICs by Texas Instruments (CDCE925 in the previous design).  :D



The CDCE913 on the dual frequency oscillator (DFO) has an built-in PLL (phase-locked loop). It can be programmed to output clock signals with (almost) any desired frequencies between 0.8 and 230 MHz. By tying the s0 input of the CDCE913 to either a low or a high logic level, it's possible to change the frequency of the clock output signal.

This pic shows the required hard- and software to successfully program the DFO:

The first step is use the Clock Pro software by Texas Instruments. With Clock Pro you can create a setup for the CDCE913 IC by specifying the desired frequencies. Clock Pro will then automatically calculate the register values for your configuration. The register values can be saved into an Intel Hex file.

To program the CDCE913 on the DFO PCB you will need a programmer hardware called "CDCE9XX Programmer" (see below). It is connected to your PCB with a Mini USB cable. You also need to connect the programmer with the DFO through 4 wires. (I2C -> 4 wires: GND, VCC, SDA & SCL).

On the PC you open the "CDCE9XX Programmer GUI" that I've written (see below). Load the .hex file you've created with Clock Pro before and program the CDCE913 on the DFO by hitting the program button on the GUI.


Get your own DFO:

I've designed 3 different DFO PCB's. You can order the PCB's at oshpark: https://oshpark.com/profiles/micro

a) DFO 5V DIL14 version


Schematic: http://www.mediafire.com/download/p0lhr1nq79y6mq3/DFO_DIL14_5V.pdf

This version has the same dimensions and pinout as usual DIL14 metal can oscillators. Supply voltage is 5V (5.5V max). Therefore this DFO version can be used as a drop-in replacement for the metal can oscillator found in consoles such as the Megadrive or the Amiga.

Parts list:
Quantity    Description                   mouser.com part name
1xCDCE913 clock generation IC595-CDCE913PWR
1xbuffer/level shifter595-SN74LV1T126DBVR
1x3.3V LDO595-TPS78233DDCR
1x1.8V LDO595-TPS78218DDCT
1x27 MHz crystal774-ATS270B
3x1 uF capacitor81-GRM188R61E105KA12
1x2.2 uF capacitor81-GRM188R61E225KA2D
1x18 Ohm resistor71-CRCW0603-18-E3
1x10 kOhm resistor71-CRCW0603-10K-E3
1x22 kOhm resistor71-CRCW0603-22K-E3
1xthin pin headerAW 122/20




b) DFO 3.3V SMD version


Schematic: http://www.mediafire.com/download/uyiftm3m5u3moh0/DFO_SMD_3.3V.pdf

This version is more suited for consoles that have no metal can oscillators inside. The input supply voltage is 3.3V (3.6 max). This version is suited for consoles such as the PSX or the MVS MV-1C.

Parts list:
Quantity    Description                   mouser.com part name
1xCDCE913 clock generation IC595-CDCE913PWR
1x1.8V LDO595-TPS78218DDCT
1x27 MHz SMD crystal774-ATS270BSM-1
3x1 uF capacitor81-GRM188R61E105KA12
1x18 Ohm resistor71-CRCW0603-18-E3
2x10 kOhm resistor71-CRCW0603-10K-E3




b) DFO 5V SMD version


Schematic: http://www.mediafire.com/download/h5xblii4zit2sk2/DFO_SMD_5V.pdf

This version is has the same rectangular shape as the 3.3V SMD version, but it's specified for a supply voltage of 5V. It's suited for systems that got a 5V clock circuit (SNES maybe?). It's also possible to use this version in a 3.3V enviroment such as the PSX but for these consoles I'd rather recommend the 3.3V SMD version above because it needs less parts and is significantly cheaper. ^^

Parts list:
Quantity    Description                   mouser.com part name
1xCDCE913 clock generation IC595-CDCE913PWR
1xbuffer/level shifter595-SN74LV1T126DBVR
1x3.3V LDO595-TPS78233DDCR
1x1.8V LDO595-TPS78218DDCT
1x27 MHz SMD crystal774-ATS270BSM-1
5x1 uF capacitor81-GRM188R61E105KA12
1x18 Ohm resistor71-CRCW0603-18-E3
1x10 kOhm resistor71-CRCW0603-10K-E3
1x22 kOhm resistor71-CRCW0603-22K-E3





Programmer:



The hardware for the programmer is finished. You can order the PCB's at https://oshpark.com/profiles/micro (CDCE9XX Programmer)

Parts list:
Quantity    Description                   mouser.com part name
1xFT232RL USB UART interface IC895-FT232RL
1xATMEGA48A microcontroller556-ATMEGA48A-AU
1xMini USB socket587-690-005-299-143
1xSliding switch688-SSSS810701
1xPin header855-M22-2010405
1xCrystal774-ATS080B
3x100 nF capacitor80-C0805C104K5R
1x4.7 uF capacitor581-08053D475K
2x18 pF capacitor77-VJ0805A180GXJCBC
1x330 Ohm resistor71-CRCW0805-330-E3
2x10 kOhm resistor71-CRCW0805J-10K-E3
2x4.7 kOhm resistor71-CRCW0805-4.7K-E3
1xLED720-LSR976-NR-1


Firmware for the programmer: http://www.mediafire.com/download/tn6kw1grj65s761/CDCE9XX_PROGRAMMER_FW_v1.zip
Source: http://www.mediafire.com/download/n6yon471o85ehan/CDCE9XX_PROGRAMMER_FW_v1_SOURCECODE.zip

Programming software for Windows PC:


Download link: http://www.mediafire.com/download/55gu3975qu2kmux/CDCE9XX_Programmer_GUI.zip

The software runs on Windows PC's and it needs the .NET framework 4.5.

Outdated! Instructions for the three new DFO's coming soon.
How to program the DFO:
1. Obtain a configuration file

To program the DFO you'll need a suitable configuration .hex file. You can use one of my example files. If you want/need different frequencies, you should download and install the Clock Pro software by Texas Instruments: http://www.ti.com/tool/CLOCKPRO

Start Clock Pro and you will see this window:

First set the number of outputs to 5. Then enter both the frequencies you desire in the the Y1 and Y5 window. Y1 will be selected if the CLK1/!CLK2-pad of the DFO is tied to a high level (or just left open). Y5 will selected if you tie the CLK1/!CLK2 pad to GND.
After you have entered your frequencies, click on "Generate Setup".

Clock Pro should propose a CDCE925 device for your task. Click on "View Setup".

(If it proposes a CDCE913 instead, go back and enter some frequencies for Y2, Y3 and Y4 too.)

In the next window change the crystal load to 18 pF:


Now click on File->"Save Hex Intel File"


That's it, now you got the .hex file for your DFO. :)

2. Program the DFO with your .hex file

Plug your assembled CDCE9XX programmer hardware into your PC with an USB cable. It's important that you've also flashed the programmer with the firmware I've provided above.

Start the programming software, you will get this:


If the software doesn't recognize your programmer hardware, chances are you haven't flashed it with the right firmware and fuse bytes. (Or you might have made a mistake while assembling the PCB.)

Click on "Load Configuration File" and load the .hex file you've created with Clock Pro before. If the .hex file is valid, the "Program CDCE925" button on the bottom will be enabled.

Now you should connect the programmer hardware with the DFO you want to program. Just insert the pin header into the 4 approriate holes:

(Pic for demonstration purposes only. Of course you need to assemble the DFO itself too.  ;D)

It's important to set the V_Target switch on the programmer hardware right. If you have the DFO sitting on your table and you want to program it, set V_Target to on. The LED should start to shine red.
If you want to program a DFO that's already installed in a system (let's say in a Megadrive for example), then turn V_Target off. Instead turn on the Megadrive itself. It will power the DFO.
If you mess this up you can damage your console, the programmer and even your PC!


Now click on "Program CDCE925". The CDCE9XX programming software will tell you if the programming was successful or not. :)



« Last Edit: April 26, 2015, 11:51:54 pm by micro »

Offline albino_vulpix

  • Professional warranty voider
  • MassiveMember
  • ****
  • Posts: 189
Re: Idea: Oscillator with two diff. frequencies to choose from
« Reply #1 on: February 01, 2015, 09:56:29 am »
Looks like an interesting project! Do keep us posted.

Strange though, my PAL MDII works fine at 60Hz on my Framemeister. I'm using firmware 1.11, SCART cable wired this way and no sync stripper.

Offline micro

  • MassiveMember
  • ****
  • Posts: 392
Re: Idea: Oscillator with two diff. frequencies to choose from
« Reply #2 on: February 04, 2015, 03:12:22 am »
I guess this can be explained by the fact that oscillators got an initial error (something about 50 to 100 ppm I guess) but also a frequency drift (x ppm/year).

Switching my japanese Saturn to 50 Hz or playing NTSC games on my modded PAL Playstation consoles also result in picture problems on the Framemeister. But it's not as bad as my PAL MD2. I suspect that this is also caused by oscillators/crystals with (marginally) different frequencies used in PAL and NTSC consoles. These problems are also documentated in the X-RGB Mini Wiki:

http://junkerhq.net/xrgb/index.php/Sega_Genesis
http://junkerhq.net/xrgb/index.php/Playstation

Inside the Saturn there's no oscillator but a crystal. It should be possible to use my dual frequency oscillator in the Saturn, too. I just have to find out which of the crystal's two pins is clock in and clock out.

The PSX will require a different/bigger solution. The PSX already got a PLL clock synthesizer IC to generate 3 different clocks. (1x main clock for CPU, 1x GPU clock, 1x subcarrier for video signal  encoding). The main clock is the same for both NTSC and PAL consoles but the subcarrier and GPU clock are different:


But yes, I'll keep you all posted how this thing turns out.  ;D

Offline micro

  • MassiveMember
  • ****
  • Posts: 392
Re: Idea: Oscillator with two diff. frequencies to choose from
« Reply #3 on: February 24, 2015, 12:18:02 am »
Small update:

The PCB's have arrived today. I've assembled one of them. Although the foot print of the parts is rather small (0603 for resistors and capacitors), assembly of the PCB was quite easy. Except for the huge 27 MHz crystal. It turned out the solder pads are totally unusable for hand soldering because 98% of the solder pad area is covered by the crystal. However I've managed to solder the crystal in place somehow, but damn...



So far the circuit seems to work. Right now we got a 27 MHz clock signal on the output of the PCB. I still have to build the hardware and software of a I2C programmer in order to be able to program the CDCE925 to get all these crazy frequencies out of it...  ;D

Offline micro

  • MassiveMember
  • ****
  • Posts: 392
Re: Idea: Oscillator with two diff. frequencies to choose from
« Reply #4 on: March 01, 2015, 01:45:45 am »
GREAT news:

I have succeeded in programming the CDCE925 clock synthesizer IC. But I still have to build the proper hard- and software for the programmer. Right now the programmer's hardware is a mess consisting of a breadboard, a FT232R-USB-UART bridge for power and connection to the PC as well as a Atmega microcontroller:


The required register values for the CDCE925 IC calculated by the TI Clock Pro software are (manually) copied into the microcontroller's source code at the moment:



Programming the CDCE925 is iniated by sending a character through a terminal program from the PC to the microcontrollers. The micrcontroller will then program the CDCE925's registers through i2c. I've used Peter Fleury's i2c library for AVR microcontrollers: http://homepage.hispeed.ch/peterfleury/avr-software.html After programming, the registers are read back to ensure everything's ok.

Okay, I've programmed the CDCE925 with the whole oscillator still being on the breadboard. After the programming I desoldered the PAL Megadrive 2 oscillator and installed the new dual frequency oscillator:


After that I've connected the clk1/!clk2 selection pad to the 50/60 Hz switch:


Soooo, does the PAL Megadrive 2 running on 60 Hz finally work with the Framemeister? Yes, it does!!!  ;D

One of the many quirks of the Framemeister is that when the vertical refresh rate is not exactly what the Framemeister expects (PAL Megadrive running on 60 Hz; jap. Saturn running on 50 Hz) the black levels get also messed up:


You can see before installing the new oscillator, the black levels of the 60 Hz picture were way too high. After the mod, everything's fine no matter if the MD2 is running on 50 or 60 Hz. Of course, the other problems like stuttering on 60 Hz etc. have also been resolved.  :)

Offline micro

  • MassiveMember
  • ****
  • Posts: 392
Re: Idea: Oscillator with two diff. frequencies to choose from
« Reply #5 on: March 02, 2015, 10:05:36 pm »
Fixing the Playstation

Yesterday I've installed the dual frequency oscillator (from now on I call this thing DFO -> dual frequency oscillator) into my SCPH-7502 PAL Playstation. Playing NTSC games on a PAL Playstation with a modchip introduces the same problems with the XRGB-Mini Framemeister: Stuttering and messed up black levels. This is a known issue, see also XRGB Wiki: http://junkerhq.net/xrgb/index.php/Playstation

The SCPH-750X PSX got a video DAC / video encoder made by Rohm, BH7240AKV. The datasheet is available freely, here's an excerpt:


As you can see, pin no. 13 of the DAC (labeled as IC502 on the PSX mainboard) tells the DAC if the video format is NTSC or PAL. I've measured the voltage levels, the voltage is 0V for PAL and 3.4V for NTSC. We can use this signal to switch between the two different clock signals of the DFO.

Here's a pic showing where to find the appropriate pin on the SCPH-7502 mainboard:


The original clock generation circuit of the SCPH-750X consists of a PLL clock generator by Cypress (CY2081SL-500T (NTSC)/CY2081SL-509T (PAL)). It generates three different clock signals:
1.) CPU clock 67.7376 MHz (NTSC and PAL)
2.) GPU clock 53.693175 MHz (NTSC) / 53.203424 MHz (PAL)
3.) video subcarrier 3.58 MHz (NTSC) / 4.33 MHz (PAL)


In order to fix the problems we got to switch the GPU clock from 53.20 Mhz to 53.69 MHz (typo in the pic above, 53.63 Mhz is wrong) when the NTSC/!PAL signal goes high. When NTSC/!PAL goes low, we need to switch the clock back to 53.20 Mhz.

The actual circuit looks like this:


To disconnect the original GPU clock we simply remove the 220 Ohm resistor (wrongly labeled as C205 on the pic above). There's a test point where we can inject the new switchable clock signal of the DFO:


Fitting the DFO PCB inside the PSX wasn't easy. After all the PCB was designed to be a drop-in-replacement for metal can oscillators.  I wanted to keep the clock wire as short as possible. So in the end I've cut off a chunk of the metal shield. And placed the PCB directly over the original PSX clock generation circuit. (Don't worry, bottom side of the PCB is insulated.)



(I've also added an additional 220 Ohm resistor to the output of my DFO. It seems inside the GPU is another resistor, forming some kind of voltage divider. I've had a look at the 53.XX Mhz clock signal of the original clock generation signal. The amplitude after the 220 Ohm resistor clearly is smaller than before.)

So what's the result? NTSC games on my modded PAL Playstation in conjuction with the XRGB-Mini Framemeister now work perfectly!

* no more stuttering
* no more messed up black levels
* Bonus: Konami's anti-PAL protection found in the Bemani games is useless now, the Bemani games now work flawlessly. (Without the fix NTSC Bemani games are unplayable on PAL PSX consoles, the icons don't line up with the rhythm of the music)
« Last Edit: March 02, 2015, 10:28:49 pm by micro »

Offline micro

  • MassiveMember
  • ****
  • Posts: 392
Re: DFO: dual frequency oscillator
« Reply #6 on: March 03, 2015, 03:06:22 am »
In case someone wants to build his own DFO, I've added a link to the shared oshpark project as well as a parts list to the bottom of the first post.  :)

As soon as the layout of the programmer is finished I will add that, too.

EDIT: Hardware for the programmer is finished, see bottom of first post. :D
« Last Edit: March 05, 2015, 08:48:16 am by micro »

Offline micro

  • MassiveMember
  • ****
  • Posts: 392
Re: DFO: dual frequency oscillator
« Reply #7 on: April 03, 2015, 11:58:27 pm »
HUGE update:

I've received the PCB's for the programmer. I've assembled one PCB, works fine:


I've also completed the firmware for the programmer as well as the CDCE9XX programming software for Windows. Everything's in the first post now.  :D

Well, let's see how useful and interesting this project for other people really is. ;)
(You could also use the DFO to overclock your console, SNES FX cartridge, etc. By re-programming the DFO you can find out how high you can go.)

Offline micro

  • MassiveMember
  • ****
  • Posts: 392
Re: DFO: dual frequency oscillator
« Reply #8 on: April 26, 2015, 11:57:40 pm »
Well, I gave the DFO a redesign. Now there are three different versions available.
(Updated Clock Pro instructions and preset .hex files for the new DFO's are coming as soon as I got the PCB's  :D)

Offline Unseen

  • SmallMember
  • **
  • Posts: 2
Re: DFO: dual frequency oscillator
« Reply #9 on: May 15, 2015, 01:24:13 am »
I was too lazy to order another board and parts to build your programmer, so I wrote a little script that can program a DFO (currently only the old CDCE925 version) from a Raspberry Pi with no additional hardware.

Available on on github, pull requests for cleanups/features/etc welcome - it's a bit bare-bones because I don't really know Python.

Offline MockyLock

  • SmallMember
  • **
  • Posts: 27
Re: DFO: dual frequency oscillator
« Reply #10 on: May 16, 2015, 03:18:41 am »
Hey Unseen, are you the one from the famous gcVideo ?

Offline Unseen

  • SmallMember
  • **
  • Posts: 2
Re: DFO: dual frequency oscillator
« Reply #11 on: May 17, 2015, 11:56:01 pm »
Hey Unseen, are you the one from the famous gcVideo ?
Yes

Offline BuckoA51

  • SmallMember
  • **
  • Posts: 2
Re: DFO: dual frequency oscillator
« Reply #12 on: May 22, 2015, 05:02:09 am »
Has anyone heard from Micro lately? I was talking to him on another board about this project but I haven't heard from him in weeks now. I've a number of the first gen DFOs and programmers made up but I wanted to make sure it was 100% ok with him before I sent them out to any of my contacts (sadly I am completely useless at soldering yes I've tried :'( ).

Offline micro

  • MassiveMember
  • ****
  • Posts: 392
Re: DFO: dual frequency oscillator
« Reply #13 on: May 23, 2015, 08:58:53 pm »
@Unseen: Good work!  8)

@BuckoA51: Sorry for the delay, I've replied to your messages.

Offline micro

  • MassiveMember
  • ****
  • Posts: 392
Re: DFO: dual frequency oscillator
« Reply #14 on: September 12, 2015, 09:57:39 am »
Just a quick update:

There's a new version of the CDCE9XX Programmer GUI (v1.1): http://www.mediafire.com/download/dx4k1yt349tb7ct/CDCE9XX_Programmer_GUI_v1.1.zip

And here are some example configuration files for the three DFO types described in the 1st post:

1.) http://www.mediafire.com/download/wb1zu8a5cju9lp6/MD_PSX_15xNTSC_12xPAL.HEX
For use in the Megadrive 1/2 and the Playstation. (Tested on a SCPH-7500 but it should also work in a SCPH-9000 and SCPH-101 (aka PSOne))

2.) http://www.mediafire.com/download/pzgipkd508mdgd6/SAT_4xNTSC_4xPAL.HEX
For use in the Saturn. Pin 79 of IC14 should _not_ be lifted. Should work in PAL and NTSC consoles.

There's also a comprehensive DFO thread on www.circuit-board.de (german only): http://circuit-board.de/forum/index.php/Thread/18016-DFO-dual-frequency-oscillator/

Online Link83

  • MassiveMember
  • ****
  • Posts: 270
Re: DFO: dual frequency oscillator
« Reply #15 on: July 24, 2016, 01:03:24 am »
So I really love this project, in fact I have been looking for something similar for years!

However from chatting with micro I understand there are some issues with the Saturn:-
Quote from: micro
However, switching frequencies (50/60 Hz) with Sega Saturn and the DFO installed there's a 50% chance the saturn will freeze caused by the complex clock generation and distribution system of the Saturn.

I know that some Saturn revisions have the region select traces interconnected between the clock generator, VDP2 and video encoder chips, whilst others dont:-
http://assemblergames.com/l/threads/sega-saturn-pcb-revisions.45766/
Quote from: Druid II
...the three pal/ntsc selection pins are interlinked differently depending on motherboard. There are three of them, the PLL pin 1 (main oscillator selection), VDP2 pin 79 (50/60hz output), and CXA1645 pin... uh,7 I think (PAL/NTSC color encoding). Only relevant if you do a 50/60 mod and end up with a rolling image, in which case the PLL is switched to the wrong frequency mode.

[the trace connections differ] from model to model. NTSC VA0-5 have them all interlinked, so you switch the crystal, switch a jumper, and it's done. PAL VA7 and VA9 have them like that as well. NTSC VA6+ and PAL VA13 use a different PLL, only the video encoder and the VDP2 are interlinked. PAL VA0 and VA3/5 have them separated fully and have some of them on their own extra jumpers, PAL VA1 is the same but the VDP2 and PLL are still interlinked, a snafu in design I guess, so you can't even use the SW4 switch on the back without cutting the trace leading to PLL pin 1.
So this got me wondering what Saturn motherboard revision the DFO was tested on, and if it had all three traces interconnected or not?

Also I wondered if this freezing is caused by the Saturn's clock generator (IC20) being unable to cope with the DFO switching the clock frequency whilst powered on? Or is it the CPU/GPU etc that cant handle the switch?

If its the clock generator causing the problem, would it be possible to bypass it and send the correct clock signal directly to the GPU? (Like the PlayStation DFO shown above)

It may also help to know that depending on the Saturn motherboard revision Sega used two different clock generator IC's with the part numbers 315-5746 or 315-6021. Below is all the information I could find about the two different clock generators.

315-5746

From this picture of a Sophia dev unit, it is believed the 315-5746 is actually a Hitachi HD49422F:-

Unfortunately I can't find any datsheets for this part, so its probably custom.

315-6021

(Note this schematic is for the Brazillian TecToy Saturn, so features the crystal required for PAL-M output)

The later 315-6021 chip is in fact a Cypress CY2292SC-04 "Three-PLL General-Purpose EPROM Programmable Clock Generator" for which the datasheet is available here:-
https://retrocdn.net/images/f/fc/CY2292_datasheet.pdf

Finally here is a picture I made showing the X1 crystal location on a number of different Saturn motherboard revisions:-

(Just posting this because I think its interesting how many changes Sega made between revisions!)
« Last Edit: October 05, 2016, 01:21:40 pm by Link83 »

Offline Konsolkongen

  • SmallMember
  • **
  • Posts: 10
Re: DFO: dual frequency oscillator
« Reply #16 on: October 06, 2016, 04:43:57 am »
Anywhere I can find the updated information on how to program these things? I can see that the original post hasn't been updated in a while.

I just finished assembling the programmer and 12 DFO boards today :)

Offline BuckoA51

  • SmallMember
  • **
  • Posts: 2
Re: DFO: dual frequency oscillator
« Reply #17 on: November 29, 2016, 09:04:05 am »
Been a while but I'm hoping to pick this project up again and produce some of these for PS1 initially. Micro if you're there please drop me a message!

Offline micro

  • MassiveMember
  • ****
  • Posts: 392
Re: DFO: dual frequency oscillator
« Reply #18 on: December 14, 2016, 11:45:54 am »
@BuckoA51: Done!

@Konsolkongen: You need to build the CDCE9XX Programmer to program the DFOs with the hex file of your choice. And the microcontroller on this CDCE9XX Programmer PCB has to be programmed with the firmware provided above and the use of a ISP programmer for Atmel AVR microcontrollers. I admit that this can be quite confusing.

But I've read on the assemblergames forums that you succeeded in programming your CDCE9XX programmer and your DFOs so you've figured it out by now. :)

The most elaborate thread/guide for this project can still be found on the circuitboard forums (German language): https://circuit-board.de/forum/index.php/Thread/18016-DFO-Dual-Frequency-Oscillator/

One thing I'd like to mention about the CDCE9XX Programmer:
When connecting a DFO to my programmer, the programmer often resets and is unable to communicate with the PC. That's because the DFO draws too much current. Usually the DFO's current consumption is quite moderate (about 14 mA, but depends on the frequency programmed). The problem seems to be the inrush current. The capacitors on the DFO draw much current for a brief moment when connected to the supply voltage through the programmer.

To fix this issue I recommend soldering a small resistor (22 Ohm) in series with the voltage supply for the DFO. It's marked VTG on the PCB (V target). You can cut the trace with a sharp knife and bridge the gap with the 22 Ohm resistor. That sorted out the issue for me. :)

@Link83: I can't tell you what revision my white japanese Saturn is (as I won't open it at the moment). I suspect that one of the many ICs has a counter/timer and can detect the change in the X1 frequency and then deliberately locking up the system.

On the circuitboard forums I've uploaded another hex file for NTSC Saturn consoles called "SAT_4xNTSC_PAL_CORRECTION.HEX".
https://circuit-board.de/forum/index.php/Thread/18016-DFO-Dual-Frequency-Oscillator/?postID=464215#post464215
It can be used on NTSC consoles with pin 79 of IC14 lifted. In that case the frequency of X1 will be only slightly altered from 14.31818 MHz to 14.22148xxx MHz when in 50 Hz mode to get a proper PAL refresh rate. Still, this minor change will cause the console to freeze with 50% probablity.

Offline zyrobs

  • SmallMember
  • **
  • Posts: 14
Re: DFO: dual frequency oscillator
« Reply #19 on: April 22, 2017, 09:37:35 am »
For the Saturn, you can only use a dual oscillator with a few board versions that use the 315-5764 PLL. That one has an extra clock divider inside, so it can generate the correct clocks from the 17.734 MHz PAL crystal. You can switch this divider on PLL Pin 1.

So with a dual frequency oscillator, you'd need to replace the main crystal with the DFO, then set up your switch to switch both the DFU clocks, and JP1/2 on the motherboard (which is the master ntsc/pal selector, connected to PLL for clockspeeds, VDP2 for 50/60Hz, and AV encoder for PAL/NTSC colourburst selection). 14.31818MHz and +5V on those lines (JP1 closed) for fully NTSC , and 17.734 MHz and GND (JP2 closed) for PAL.


But it gets more complicated:
- VA0 PAL and VA SD PAL (aka VA3/5) have the PLL pin 1 on different jumpers, and the VDP2 pin 79 on a pulldown resistor (and traced out to a pre-built switch connector near the battery). What this means is that you cannot just connect one 5V/GND switch to JP1/2, you have to connect one to the PLL pin1 jumpers, and one to the SW4 switch pins too.
- VA1 PAL is the same as above, but due to a board snafu, PLL pin 1 has no selector jumpers of its own, and is connected to VDP2 pin 79. This sucks because it makes installing 50/60Hz switches harder, but for the purpose of installing a DFO, it means you only need to install one less line.

For these two boards, the AV encoder is, I think, on a separate pulldown resistor of its own, so it will keep itself in PAL mode for that PAL60 output if you use the pre-made 50/60Hz switch port.


And even more complicated:
VA6-8, VA10-15, and VA 13 PAL boards use Cypress CY2922 PLLs. These don't have a pal/ntsc clock selector; they are hardwired via firmware to handle one or the other. The last two numbers denote the firmware id: CY2292SC-04 is in VA6-8, CY2292SC-32 is in VA10-15 (separate because these units handle the CD Drive clocks differently), and CY2292SC-45 for VA13 PAL.
For these boards, you most likely could not use the DFO, as to my knowledge they cannot use a different clock by design.


There are also two special cases, VA9 and VA7 PAL. VA9 is a "universal" board that can be configured as either PAL or NTSC. It uses the 315-5764 PLL for that reason.
And VA7 PAL is basically a VA7 board that is also universal like the VA9, uses the 315-5764 PLL, can select C-Sync / +12V on the AV output. This board seems to be designed later than the VA9 was, despite the numbering.
These two could have the DFO installed as easily as NTSC VA0-5 - just replace the crystal and put a selector on JP1/2.



tl;dr you can only install the DFO easily on certain motherboards:
- VA0-5 NTSC units (all model 1, early model 2s),
- VA9 (many PAL model 2s but not all of them, all Hi-Saturn model 2, and rarely in some V-Saturn model 2s)
- VA7 PAL (rare PAL model 2 variant)
- and you can also put them in VA0-5 PAL units, but that requires adding a bunch of more wires for everything to switch.

For everything else, you end up desyncing the system.

Also, I'm not sure if it is even needed, since PAL Saturns do pretty good PAL60 output. I don't know how the Framemeister handles them, but I never heard anyone mentioning to have problems with them.