nfg.forums

GameSX.com => Console Mods => Topic started by: micro on February 01, 2015, 02:50:37 AM

Title: DFO: dual frequency oscillator
Post by: micro 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:
(http://i.imgur.com/V5nRu0Z.png)
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 (http://www.ti.com/product/cdce913) (CDCE925 in the previous design).  :D

(http://i.imgur.com/CTpqqSj.png) (http://i.imgur.com/uDYUhHv.png)

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:
(http://i.imgur.com/0hPFhJs.jpg)
The first step is use the Clock Pro software by Texas Instruments (http://www.ti.com/tool/clockPro). 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

(http://i.imgur.com/CaS2poF.png) (http://i.imgur.com/mj9XaUu.png)
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 (http://www.reichelt.de/Sockets-IC/AW-122-20/3/index.html?ACTION=3&GROUPID=3215&ARTICLE=4426&OFFSET=500&WKID=0&)

(http://i.imgur.com/gEbCjysm.png) (http://imgur.com/gEbCjys)


b) DFO 3.3V SMD version

(http://i.imgur.com/ebeqvhe.png) (http://i.imgur.com/07ts8Py.png)
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

(http://i.imgur.com/DEkVIq6m.png) (http://imgur.com/DEkVIq6)


b) DFO 5V SMD version

(http://i.imgur.com/YbtPpRO.png) (http://i.imgur.com/xWvmgGU.png)
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

(http://i.imgur.com/kjIGDFLm.png) (http://imgur.com/kjIGDFL)




Programmer:

(http://i.imgur.com/ElAB7a1.png)

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:

(http://i.imgur.com/0WnyAq5.png)
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:
(http://i.imgur.com/GEMuENV.png)
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".
(http://i.imgur.com/kus9tO8.png)
(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:
(http://i.imgur.com/vP82bqt.png)

Now click on File->"Save Hex Intel File"
(http://i.imgur.com/yvmVwSO.png)

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:
(http://i.imgur.com/0WnyAq5.png)

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:
(http://i.imgur.com/EpjjmAgm.jpg) (http://imgur.com/EpjjmAg)
(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!
(http://i.imgur.com/hgyZLbf.jpg)

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



Title: Re: Idea: Oscillator with two diff. frequencies to choose from
Post by: albino_vulpix 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 (http://"http://members.optusnet.com.au/eviltim/gamescart/gamescart.htm#mega2") and no sync stripper.
Title: Re: Idea: Oscillator with two diff. frequencies to choose from
Post by: micro 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/Sega_Genesis)
http://junkerhq.net/xrgb/index.php/Playstation (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:
(http://i.imgur.com/a5bQ2Ah.png)

But yes, I'll keep you all posted how this thing turns out.  ;D
Title: Re: Idea: Oscillator with two diff. frequencies to choose from
Post by: micro 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...

(http://i.imgur.com/09topbJl.jpg) (http://imgur.com/09topbJ)

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
Title: Re: Idea: Oscillator with two diff. frequencies to choose from
Post by: micro 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:
(http://i.imgur.com/apnpDVKl.jpg) (http://imgur.com/apnpDVK)

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:
(http://i.imgur.com/PBlgTEgl.png) (http://imgur.com/PBlgTEg)


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:
(http://i.imgur.com/0eA6vzml.jpg) (http://imgur.com/0eA6vzm)

After that I've connected the clk1/!clk2 selection pad to the 50/60 Hz switch:
(http://i.imgur.com/UsqyzYSl.jpg) (http://imgur.com/UsqyzYS)

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:
(http://i.imgur.com/fBlxt3yl.jpg) (http://imgur.com/fBlxt3y)

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.  :)
Title: Re: Idea: Oscillator with two diff. frequencies to choose from
Post by: micro 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:
(http://i.imgur.com/9zfTB4rl.png) (http://imgur.com/9zfTB4r)

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:
(http://i.imgur.com/oyxwFI8l.jpg) (http://imgur.com/oyxwFI8)

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)
(http://i.imgur.com/a5bQ2Ah.png)

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:
(http://i.imgur.com/WUMQX3Dl.png) (http://imgur.com/WUMQX3D)

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:
(http://i.imgur.com/UwZHR5Xl.jpg) (http://imgur.com/UwZHR5X)

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.)

(http://i.imgur.com/sFO6zH0l.jpg) (http://imgur.com/sFO6zH0)

(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)
Title: Re: DFO: dual frequency oscillator
Post by: micro 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
Title: Re: DFO: dual frequency oscillator
Post by: micro 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:
(http://i.imgur.com/rjPugacl.jpg) (http://imgur.com/rjPugac)

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.)
Title: Re: DFO: dual frequency oscillator
Post by: micro 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)
Title: Re: DFO: dual frequency oscillator
Post by: Unseen 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 (https://github.com/ikorb/cdceprog), pull requests for cleanups/features/etc welcome - it's a bit bare-bones because I don't really know Python.
Title: Re: DFO: dual frequency oscillator
Post by: MockyLock on May 16, 2015, 03:18:41 AM
Hey Unseen, are you the one from the famous gcVideo ?
Title: Re: DFO: dual frequency oscillator
Post by: Unseen on May 17, 2015, 11:56:01 PM
Quote from: MockyLock on May 16, 2015, 03:18:41 AM
Hey Unseen, are you the one from the famous gcVideo ?
Yes
Title: Re: DFO: dual frequency oscillator
Post by: BuckoA51 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 :'( ).
Title: Re: DFO: dual frequency oscillator
Post by: micro on May 23, 2015, 08:58:53 PM
@Unseen: Good work!  8)

@BuckoA51: Sorry for the delay, I've replied to your messages.
Title: Re: DFO: dual frequency oscillator
Post by: micro 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/
Title: Re: DFO: dual frequency oscillator
Post by: Link83 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! (http://www.sega-16.com/forum/showthread.php?25269-Proper-50Hz-60Hz-mods-for-Master-System-Mega-Drive-Sega-Saturn-(Crystal-Switch))

However from chatting with micro I understand there are some issues with the Saturn:-
Quote from: microHowever, 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
(http://i.imgur.com/AaNN2Zhm.png) (http://i.imgur.com/AaNN2Zh.png)(http://i.imgur.com/be4pC5um.png) (http://i.imgur.com/be4pC5u.png)
From this picture of a Sophia dev unit, it is believed the 315-5746 is actually a Hitachi HD49422F:-
(http://i.imgur.com/zHG8Sc1m.png) (http://i.imgur.com/zHG8Sc1.png)
Unfortunately I can't find any datsheets for this part, so its probably custom.

315-6021
(http://i.imgur.com/yBbf1kMm.png) (http://i.imgur.com/yBbf1kM.png)
(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:-
(http://i.imgur.com/mnpx3vim.jpg) (http://i.imgur.com/mnpx3vi.jpg)
(Just posting this because I think its interesting how many changes Sega made between revisions!)
Title: Re: DFO: dual frequency oscillator
Post by: Konsolkongen 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 :)
Title: Re: DFO: dual frequency oscillator
Post by: BuckoA51 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!
Title: Re: DFO: dual frequency oscillator
Post by: micro 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.
Title: Re: DFO: dual frequency oscillator
Post by: zyrobs 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.
Title: Re: DFO: dual frequency oscillator
Post by: Link83 on May 07, 2017, 03:18:43 AM
@zyrobs Thanks very much for all the info, it really helps clarify a number of things I had been wondering about :D

So after looking again at the block diagram for the 315-5746 above it seems the DOTSEL pin switches the multiplier used for the DOTCLK (The datasheet says "320PIX (0V)/352PIX (5V) mode switching control") and I assume this is the reason we cant just bypass the 315-5746 chip and send the clock signal directly (Like the PlayStation mod above) because there would neeed to be 4 different clock frequencies toggled by the DFO :-\

...and theres one thing still bugging me about the Saturns clock generation...

In the schematics the 315-5746 has provision for a second external crystal "X2 NOT USED", and the OSCSW pin allows the chip to select between "Crystal oscillation" and "External clock signal". It also appears that at least some of the early retail Saturn motherboard revisions have a space for "X2" on the board which is unused.

Then if we look at the Sophia development unit the silkscreen labelling is a bit different from a retail Saturn (X1 is labelled XTAL3, and X2 is labelled XTAL4) but it appears that they did in fact use this "X2" crystal as a second external clock signal, although I cant quite make out the full part marking it looks like it could be an 8.XXX mHz crystal?

My question is - what is the purpose of this X2 crystal? Was this perhaps added to Sophia development systems so that the unit wouldn't lock-up when switching between PAL and NTSC modes? I'm guessing that without the X2 crystal the 315-5746 has to rely on the X1 crystal as the base for all its clock frequencies, but by seperating out some of the clock signals and providing a fixed clock signal for the 'essential' components it may help prevent lock-ups? Just a thought...
Title: Re: DFO: dual frequency oscillator
Post by: zyrobs on May 07, 2017, 08:14:14 AM
If you can hook up an extra selection pin on your external PLL, so it can switch between 320/352px mode, then in theory you could bypass half of the 315-5746. According to the service manual it is a 1708/1820 divider.

Keep in mind that then you need
- an external switch that switches a 910/1135 divider as well as the input oscillator from 14.318MHz to 17.734MHz
- a second switch for an internal 1708/1820 divider, that is driven by the DOTSEL pin (GND turns it on).
- an output of the above, going to the chips of the system as the master clock
- a second output that is always the input clock / 4, this goes to the video chip.

This would only handle the main system clock however. You still need to hook up the sound clocks, which I think is the EXTCLOCK input (8.4672 MHz ?), divided by 3, with two outputs: one is multiplied by 4 for the Sound CPU (11.29 MHz), and the other is multiplied again by 2 for the SCSP (22.58 MHz). If I read the service manual right...?

The X2 is a secondary input, and pin 7 on the 315-5746 selects between using that or using an external clock input. The external clock input in this case is a 8.4762 MHz signal supplied by the CD Drive. I'm guessing the Sophia is meant to function both with and without the drive, since at one point they had a cartridge only Saturn (aka Jupiter) in the making.

VA10+ units have that latter part a bit differently though. They generate a 33 MHz signal themselves somewhere on the board (maybe by the Cypress PLL), and then send it to the CD Drive to use, making that pin on the ribbon an output instead of an input. It's why cheap modchips with no onboard clocks needed a second cable soldered to them.

I only got this from the schematic in the service manual you posted above. I might be wrong on some details.

So you'd need your PLL to be able to handle 4 different outputs, plus two selectable dividers, at minimum, if you wanted to replace the Saturn PLL.
Title: Re: DFO: dual frequency oscillator
Post by: Dopefish on September 13, 2018, 07:15:04 AM
@Konsolkongen did you manage to program any of your kits?
@micro would you be able to sell a couple of complete and pre-programmed kits?
Title: Re: DFO: dual frequency oscillator
Post by: Antonio on March 06, 2019, 03:33:36 AM
Hi there! Intersting mod.
I would like to add a little info about the PSX DFO mod.
First of all, this mod is only suitable for models starting from SCPH-700x. Earlier models use a totally different clock circuitry based on real xtal oscillators, not clock synthesizers. (Edit: I was wrong about this, see later posts.)
Secondly, I noticed that pin 13 of the video encoder is not the only source you can use to switch between the two clock signals of the DFO. You can also use pin 157 of the GPU, which also outputs 3v3 for NTSC software and GND for PAL software, in fact these two pins are connected. Doing the mod this way makes it easier to also fit a PAL60 mod, which involves disconnecting pin 13 of the video encoder from the board and connecting it to GND permamently and fixes color for composite and S-Video for most TVs. However, it only works with PAL consoles.
Title: Re: DFO: dual frequency oscillator
Post by: Segasonicfan on May 06, 2019, 06:50:03 PM
I've been following this project for a while and it's very interesting stuff.  Thanks for open sourcing it all!  it would be great if someone could upload to a mirror site since hosts like mediafire die all the time...

I'm wondering though if the design isnt a tad overly engineered.  The custom firmware and additional programming board seem a bit daunting, even for an EE.  I can't see what advantage there is over a solution like 2x LTC1799 or a classic PLL generation arrangement using inverters.  I suppose the later requires more EE work for load capacitance calculations, but stilll... 

It would be great to see a side-by-side some day (I can dream).
Title: Re: DFO: dual frequency oscillator
Post by: bmp02 on May 11, 2019, 01:54:16 AM
Hi there, just registered just to be able to reply to this thread, hopefully someone can answer my questions  :)
I'm very much interested in the DFO's, and have ordered some boards and parts for the programmer and DFO's for my MVS as well as Sega Megadrive 2.

I would like to mod my PAL SMD2 so I can play PAL, American, and Japanese games (JP games via Game Genie), and on the perfect frequency.
If I understand correctly, the DFO just handles frequency, so I would still need a switch (or switchless mod) to get region locked games working. But how would those switches interact with the DFO?

Language switch I assume wouldn't be a problem. But if I want to play a region locked US game on my PAL console, I would also have to connect chip leg 46 to 5V (NTSC), which would normally result in the game running at 60hz.
Combined with the DFO, does leg 46 high or low still result in any change in game speed? Or will it mess things up?

I can't seem to find info about it anywhere, although DFO + region switch seems like a logical combination.
Title: Re: DFO: dual frequency oscillator
Post by: Segasonicfan on May 11, 2019, 07:32:57 AM
Hi and welcome to the forum! ;D

QuoteIf I understand correctly, the DFO just handles frequency, so I would still need a switch (or switchless mod) to get region locked games working.

Yes, and they would need to be tied to the DFO's switching common, if you want correct speed.  i.e. when DFO is switched to NTSC master clock, your language switch goes to JP or US.

QuoteLanguage switch I assume wouldn't be a problem. But if I want to play a region locked US game on my PAL console, I would also have to connect chip leg 46 to 5V (NTSC), which would normally result in the game running at 60hz.

which chip are you talking about?  Please post a picture of the schematic.
Title: Re: DFO: dual frequency oscillator
Post by: bmp02 on May 15, 2019, 12:15:34 AM
Apologies for the delayed response. Somehow I assumed I'd get a notification email or something.

Anyway, I assume I understand it now. Somehow I had this weird idea that the 50/60hz switch (leg 46 of the 315- chip) would do something to the oscillator output frequency.

I have quickly soldered a language and frequency switch yesterday, which works. Now patiently waiting for all the dfo parts to come in  :)
Thanks for your reply.
Title: Re: DFO: dual frequency oscillator
Post by: NFG on May 15, 2019, 09:16:34 AM
Quote from: bmp02 on May 15, 2019, 12:15:34 AMApologies for the delayed response. Somehow I assumed I'd get a notification email or something.

You need to turn this feature on yourself, in your user profile. 
Title: Re: DFO: dual frequency oscillator
Post by: Segasonicfan on May 15, 2019, 02:37:52 PM
Quote from: bmp02 on May 15, 2019, 12:15:34 AM
Apologies for the delayed response. Somehow I assumed I'd get a notification email or something.

Anyway, I assume I understand it now. Somehow I had this weird idea that the 50/60hz switch (leg 46 of the 315- chip) would do something to the oscillator output frequency.

I have quickly soldered a language and frequency switch yesterday, which works. Now patiently waiting for all the dfo parts to come in  :)
Thanks for your reply.
Awesome, I'm glad you're making progress!

QuoteYou need to turn this feature on yourself, in your user profile. 
you mean it doesn't default to ultra-spam mode?  thats a forum first! :)

Title: Re: DFO: dual frequency oscillator
Post by: NFG on May 15, 2019, 02:47:46 PM
Quote from: Segasonicfan on May 15, 2019, 02:37:52 PMyou mean it doesn't default to ultra-spam mode?  thats a forum first! :)

I tried, man.  I tried.  ;(
Title: Re: DFO: dual frequency oscillator
Post by: Segasonicfan on May 15, 2019, 09:08:03 PM
I mean its a good thing!  I dont like email notifications for everything (Im oldskool, I guess) :)
Title: Re: DFO: dual frequency oscillator
Post by: bmp02 on May 16, 2019, 08:58:08 PM
I actually did get notifications for these replies haha
Didn't change any setting in my profile. No worries though, I find it useful
Title: Re: DFO: dual frequency oscillator
Post by: bmp02 on May 20, 2019, 05:21:45 AM
So I've received all the needed parts to get soldering. But reading all this through, there's one thing I don't really understand.
I see I need to flash the programmer with firmware first, but how on earth do I do that? Do I need a programmer for my programmer? And if yes, which one? Any cheap Aliexpress/Ebay Chinese option available?

Googling about this I read that ISP means that you can program your chip without taking it off the board, I don't read though how that is done.
Also, can I just start soldering now and flash afterwards? Or would there be more and cheaper chip programmer options available if I'd program the chip before soldering it to the board?
I've recently ordered a PIC programmer from China, but I assume that's something totally different?

Many n00b questions I guess, but hey, I need to start somewhere  :D
Title: Re: DFO: dual frequency oscillator
Post by: bmp02 on May 21, 2019, 10:57:58 PM
Well I've found the assemblergames topic mentioned earlier, that helped me to get some directions.
I understand I do need another programmer, with Usbtinyavr preferred over Usbasp, because apparantly that last one has the risk of another programmer needed to program the programmer for my programmer (I have once watched Inception and felt the same).

I'm not sure if the pin headers that come with the Tinyavr can just be plugged into the programmer, or if I need something else to make that happen. I'll order some extra headers in case I need any (and hoping to get the correct size).

Guess I'll have to try to find out how to use it when I get it (and what to do with those "fuse bytes" mentioned?).
This is quite a trip.
Title: Re: DFO: dual frequency oscillator
Post by: Segasonicfan on May 28, 2019, 01:35:53 PM
Quote from: bmp02 on May 21, 2019, 10:57:58 PM
Well I've found the assemblergames topic mentioned earlier, that helped me to get some directions.
I understand I do need another programmer, with Usbtinyavr preferred over Usbasp, because apparantly that last one has the risk of another programmer needed to program the programmer for my programmer (I have once watched Inception and felt the same).

I'm not sure if the pin headers that come with the Tinyavr can just be plugged into the programmer, or if I need something else to make that happen. I'll order some extra headers in case I need any (and hoping to get the correct size).

Guess I'll have to try to find out how to use it when I get it (and what to do with those "fuse bytes" mentioned?).
This is quite a trip.

Hey, thanks for updating us on your project. Yeah, the required programming is the exact reason I stayed away from this project. I actually designed my own dual frequency oscillator using off-the-shelf parts so I wouldn't have to do any annoying programming.

I imagine the connection header would be fairly standard, usually a 2-row 2.54mm pitch header. These are used in all the arduinos as well. I'm actually surprised an Arduino wouldn't work for programming this thing if it's just ISP. But I'm not a programmer, and it's definitely not my area of expertise.

Looking forward to what you find out for this. And if you're interested in the non-programming solution, I can send you some links and info for that.
Title: Re: DFO: dual frequency oscillator
Post by: bmp02 on May 28, 2019, 05:04:34 PM
Well since I'm already diving deep into this, I might as well finish it.
I have assembled 2 dfo boards as well as the programmer board in the weekend. Have ordered the tiny avr programmer, so now waiting for that.
Will report back when I've managed to finish this project!
Title: Re: DFO: dual frequency oscillator
Post by: Segasonicfan on June 12, 2019, 07:17:25 PM
looking forward to your reportback! :)
Title: Re: DFO: dual frequency oscillator
Post by: bmp02 on June 17, 2019, 06:34:35 AM
Tiny avr programmer arrived, and I'm a few steps further down this road  :)
Flashing the hex and fuse bytes to the programmer chip worked fine. Creating the hex for the dfo using clockpro was no problem either. But programming this hex to my two dfo's (made two different ones, tried both) won't work. Everytime I get an error "0x04 FTDI_ERROR". Don't know what that means.

Is this the issue described above where the dfo draws too much current?
If yes, will need to order some 22 ohm resistors and try that fix.
Title: Re: DFO: dual frequency oscillator
Post by: Segasonicfan on June 19, 2019, 02:32:42 PM
hrmm looks like this could be a couple things.  Have paid attention to this?:

QuoteIt'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!

I highly doubt current draw will be your problem with just programming.  Make sure its not installed in the console yet, and go back some steps. 

If you can provide some pics and more detail I can try and help more.  But this is a hard project to follow given how complex it is.
Title: Re: DFO: dual frequency oscillator
Post by: bmp02 on June 19, 2019, 07:10:08 PM
I assume the described current draw issue does occur while programming. Why else would you be able to solve it by adding a resistor on the programmer's side?
Also I haven't installed the dfo yet, so it needs power from the programmer, V_Target switched on. That should be correct.

Have tested again last night on another computer (pc instead of laptop).
I found that the programmer is recognized well, but at the moment the dfo is being attached to the programmer, the computer makes the sound of something losing connection, and the COM Port disappears in Device Manager. When doing the same with V_Target switched off, the connection is stable, but obviously it can't program cause the dfo gets no power.
When plugging in programmer to my computer with dfo already attached (and V_Target on), the programmer isn't recognized at all.

This sounds very much like the losing-connection issue described before?
Have already ordered resistors just in case. Could also try to give the dfo its own 5V power source to test, don't know if I have any though.
Title: Re: DFO: dual frequency oscillator
Post by: bmp02 on July 02, 2019, 04:57:23 AM
Unfortunately the 22 Ohm resistor doesn't solve this problem. Only difference is that FTDI Error has now changed to I2C Error.

Anyone any idea? @micro still here sometimes?

EDIT:
I have managed to make it work after all!
The 22 ohm resistor was one of the solutions. The programmer before wasn't recognized by the programming software whenever it was plugged in to a dfo, with the added resistor, this worked fine.

Main problem was that I followed the Clock Pro instructions from this thread. It does say it's outdated, but since no update was posted, I followed those. But it outputs a hex made for CDCE925, instead of 931. So the hex was the problem.

I found it impossible though to try and get the program to output a hex for a 931 with both frequencies correctly being output when S0 tied to either high or low. Luckily, the Circuit-Board.de dfo thread has a large post about just this subject, which lead to a working hex, and successful program attempt.

Phew, done.
I'll add a post for the more unexperienced, like me, to this thread. So at least we'll have the correct and updated info here for everyone attempting to build his own dfo and programmer.
Title: Re: DFO: dual frequency oscillator
Post by: bmp02 on July 02, 2019, 10:14:29 PM
Ok. So if you Googled for dfo's and always end up here, you want to build one yourself, but you're relatively new to all of this,
Or, you're trying and got stuck somehow while getting it to work, here are some words from me that I hope will help you out.

First, if there's anything else you'd like to know about this topic that you can't find here, you'd better Google Translate this thread on a German forum that is much more updated than this NFG one: https://circuit-board.de/forum/index.php/Thread/18016-DFO-Dual-Frequency-Oscillator/

When buying parts and you can't find the specific one listed, also check the German thread, it mentions some other part numbers in the opening post. But I guess usually you're fine ordering anything with similar specifications.
Also order a 22 Ohm through hole resistor as well in case you don't have any. My programmer wouldn't properly work without it. At the back of the programmer board, cut the VTG trace (where that white line is), bridge with the 22 Ohm resistor.

Please note the chip on the programmer needs to be flashed with firmware and fuse bytes. To do that, I bought the Micro USB Tiny AVR ISP / USBTinyISP Programmer (this one: https://www.ebay.com/itm/Micro-USB-Tiny-AVR-ISP-5V-ATtiny44-USBTinyISP-Programmer-For-Arduino-Bootloader/222053881584). It's 1.86$ including shipping, not too bad huh.
Then download this driver (https://learn.adafruit.com/usbtinyisp/drivers) and the AVRDUDESS Gui (http://blog.zakkemble.net/avrdudess-a-gui-for-avrdude/) to flash firmware and fuse bytes.

If you want to use ClockPro to make your own HEX files, please notice the guide in the opening post of this thread is outdated and not working anymore. Instead, do this (example for MegaDrive frequencies):
* First Wizard screen, keep the 27 MHz, No of Outputs at 1, Y1 Freq 53.693175, click Generate Setup, then View Setup
* Set Crystal Load to 18pF
* At Controle Line Selection, you see S0=1, so you're now setting the frequency for when S0 is high
* Click on the colored Y2 and Y3 triangles till both have turned into ground symbols
* You need to choose a divider number (PDiv1) for the PLL1 numbers to be divided into, in order for both outputted frequencies ending up as close to the desired frequency as possible. In this case, choose 2 for PDiv1
* The desired S0=high frequency is 53.693175, so choose 2x that = 107.38635 for PLL1_0
* From the Control Line Selection drop down menu, select the other (S0=0) option
* Click those things on the right again till Y1 has the triangle, and Y2/3 the ground symbol. Choose PLL1_1(!) 2x53.203425=106.40685
* File - Save HEX Intel File - you're done

If you need more detailed instructions on using ClockPro, again, check that German thread.

Have fun :-)
Title: Re: DFO: dual frequency oscillator
Post by: iVirtualZero on November 02, 2019, 08:22:42 PM
How do i install the DFO in an earlier model PS1 the one with the composite ports? PU-8 SCPH-1002 model.
Title: Re: DFO: dual frequency oscillator
Post by: JamesOfMercia on January 04, 2020, 08:08:13 AM
Good evening all, I'm quite interested in installing a dfo into my pal Sega Saturn -,va...1? (it doesn't state va1 on the mainboard but it is written on the separate controller board.)

And I have already seen that this will require some extra cable work on the jumpers.

I'd be ok attempting this if I could see anyone else's installation but so far the internet has revealed to me nothing.

Is there an imgur gallery or anything I can use as reference?

Thanks in advance for your time.
Title: Re: DFO: dual frequency oscillator
Post by: Antonio on March 20, 2020, 02:08:39 AM
Hi there! Here's how I've installed my DFO in my PU-20 PS1 motherboard (SCPH-7002)...

First of all, I desoldered and discarded the shield. Then I lifted pin 1 of the PS1's built-in PLL, which outputs the PAL frequency to the GPU.

This is how it looks like now...

ps1 dfo.jpg

CLK OUT is soldered to the pad where pin 1 of the PLL used to be connected, so no need to go to the trouble of desoldering SMD components. S0 is soldered to a pad that links to pin 157 of the GPU, which outputs 3v3 if running an NTSC game and GND if running a PAL game.

I think doing it this way makes it easier, but of course to each his own.
Title: Re: DFO: dual frequency oscillator
Post by: Antonio on March 20, 2020, 02:27:27 AM
Quote from: iVirtualZero on November 02, 2019, 08:22:42 PMHow do i install the DFO in an earlier model PS1 the one with the composite ports? PU-8 SCPH-1002 model.

Here's a picture of your board.

(https://upload.wikimedia.org/wikipedia/commons/1/1e/Sony_Playstation_1_SCPH-1002_motherboard_top.jpg)

Close to the GPU, there is an xtal marked "53.20", which outputs 53.2 MHz. Remove it from the board using a hot air gun while being careful to not remove any of the other SMD components that are close to it. That will reveal 4 solder points. Now it's time to install the DFO: solder the 3v3 line to the upper left pad, solder the GND line to the lower right pad, solder the CLK output to the upper right pad and finally solder the S0 line to pin 7 of the Sony CXA1645 video encoder chip.

You can also follow this procedure on PU-18 boards (SCPH-550x), although it uses a different video encoder, so you should solder S0 to a via that leads to pin 157 of the GPU instead.
Title: Re: DFO: dual frequency oscillator
Post by: Damn-Deal-Done on May 06, 2020, 11:30:23 PM
Hi.

Have you confirmed this works on the PU-8?

Would removing the resistor that connects the clock to pin 192 work instead of removing the entire clock?

Cheers
Title: Re: DFO: dual frequency oscillator
Post by: Antonio on May 12, 2020, 10:43:08 PM
Yes, you can do it too.
Title: Re: DFO: dual frequency oscillator
Post by: Damn-Deal-Done on May 13, 2020, 12:15:14 AM
Cool, cheers. So I am not sure why people have been saying you can't use DFO with PU-8. It seems the exact install for all revisions. Will have to do some experimenting with this. Trying to make complete install guides for all revisions which I can then publish online. Just waiting on more DFO parts to get cracking.
Title: Re: DFO: dual frequency oscillator
Post by: Antonio on May 13, 2020, 02:02:39 AM
People don't seem to be confident in replacing a true xtal with a clock synthesizer, because it has higher jitter, so doing this on a PU-8 or PU-18 will probably make video quality a bit worse without RGB (in fact these models derive the color subcarrier from the GPU clock). Later models replaced the xtal with a clock synthesizer just like the DFO, and the color subcarrier is handled differently, so there will be no drop in video quality.
Title: Re: DFO: dual frequency oscillator
Post by: provato on May 20, 2020, 04:57:23 AM
Hi all, totally noob here, ended up in the forums solely for the dfo mod, after seeing it on otaku's store.
Even though I understand what it does, I'm not really into the theory of how exactly it outputs ntsc and pal accurate clocks - just want to implement this mod in my psx.

I have a scph-7502 psx, pu-22 pcb. I've recently successfully installed mayumi v4 on it. Very capable with soldering and desoldering.

So here are my two very simple questions:

If I buy the otaku store's pre-populated & pre-programmed dfo (3.3volts, smd, psx version) is that all I need for it to work?
Is there an installation video or soldering points photo for my pcb? (pu-22)

Thank you
Title: Re: DFO: dual frequency oscillator
Post by: Damn-Deal-Done on June 23, 2020, 02:51:20 AM
Hello all.

I am having a problem trying to get DFO to work in a PU-18.

I removed the 220 resistor from X201 to pin 192 of the GPU.

Installed two different DFOs now via a 220 ohm resistor from clock out to the via connecting to pin 192 of the GPU. Tried both with the 18ohm resistor on the clock out remaining and removed.

Both DFOs cause the PlayStation to have a very slow boot sequence where the boot screen remains black and the boot sound is prolonged indefinitely.

Removing the DFO and replacing the 220 resistor restored normal operation.

I have successfully done this mod on a PU-18 before which makes this more confusing.

Does anyone have any ideas what might be wrong or have experienced something similar before?

Many thanks
Title: Re: DFO: dual frequency oscillator
Post by: Link83 on June 23, 2020, 09:36:32 AM
It sounds like the clock setting is mismatched for the consoles region. Where has the DFO S0 pad been connected to? For PU-18 I believe it should connect to pin 157 of the GPU (CXD8561BQ) or a trace/via leading from that pin if one exists. Pin 157 from the GPU is usually connected to the video encoder's NTSC/PAL selection pin, and its toggled high/low depending on the software region setting.

Also, I dont know which specific sub-revision of PU-18 you have (-11/-21, -31/-41, -52/-62, -72/-82) But perhaps double check that GPU pins 192 and 196 are connected together. The GPU has provision for separate input pins for NTSC and PAL clocks (Used in developer units) but typically there is a small trace connecting the two clock pins together. However perhaps on specific sub-revisions they are not interconnected?
Title: Re: DFO: dual frequency oscillator
Post by: Damn-Deal-Done on July 15, 2020, 07:45:53 PM
Hi.

I don't get update notifications from the site.

I will check if the pins are connected.

Cheers
Title: Re: DFO: dual frequency oscillator
Post by: NFG on July 15, 2020, 08:28:58 PM
Quote from: Damn-Deal-Done on July 15, 2020, 07:45:53 PMI don't get update notifications from the site.

You can fix that:

https://nfggames.com/forum2/index.php?topic=6699.0
Title: Re: DFO: dual frequency oscillator
Post by: provato on August 20, 2020, 07:14:58 PM
Quote from: bmp02 on July 02, 2019, 10:14:29 PMPlease note the chip on the programmer needs to be flashed with firmware and fuse bytes. To do that, I bought the Micro USB Tiny AVR ISP / USBTinyISP Programmer (this one: https://www.ebay.com/itm/Micro-USB-Tiny-AVR-ISP-5V-ATtiny44-USBTinyISP-Programmer-For-Arduino-Bootloader/222053881584). It's 1.86$ including shipping, not too bad huh.
Then download this driver (https://learn.adafruit.com/usbtinyisp/drivers) and the AVRDUDESS Gui (http://blog.zakkemble.net/avrdudess-a-gui-for-avrdude/) to flash firmware and fuse bytes.

Hi! I bought the usbtinyisp, the cables and connectors for it, and downloaded the mentioned drivers and GUI. Flashing the firmware is self-explanatory - I just select the fw file in the GUI.
But what does "fuse bytes" mean? What values should I select at "fuse lock bytes" field?
Thanks

EDIT: Nevermind, I found the .txt inside the firmware zip file that has the fuse bits info and then saw what the fuse(s) that must be set mean in this site: https://www.engbedded.com/fusecalc/
(High = 0xDF --> SPIEN Enable Serial programming and Data Downloading / Low = 0xFF --> Nothing...)
Title: Re: DFO: dual frequency oscillator
Post by: SilentEyes on September 30, 2020, 03:39:28 PM
Just wondering, how would you install a DFO in a pu-7 board?
Title: Re: DFO: dual frequency oscillator
Post by: provato on October 29, 2020, 06:20:44 AM
Quote from: SilentEyes on September 30, 2020, 03:39:28 PMJust wondering, how would you install a DFO in a pu-7 board?

Have you tried measuring with your DMM where I point with the red arrow in the picture? If you get 3.3V with NTSC discs and 0V with PAL discs, then there is your "S0" connection to the DFO!
(This is pin 7 of the CXA1645M encoder chip, which is the "NPIN" for switching between PAL & NTSC modes)

Of course DFO's "CLK" must be connected to GPU pin 142 through the original resistor, and the X201 crystal must be removed.

Unfortunately I don't have a SCPH-1002 with PU-7 to test this myself...

If this "NPIN" doesn't change between 3.3 and 0 volts with NTSC and PAL video signals respectively, then this means that the GPU clock (53.69 for NTSC or 53.20 for PAL) is region hardwired inside PU-7 PS1s... The only solution in this case is to add a switch to the S0 input of the DFO and manually switch it yourself every time you want NTSC 60Hz or PAL 50Hz clocks to come out of the DFO (just like the 50/60 switch on sega megadrives)

(https://i21.servimg.com/u/f21/18/35/67/06/untitl10.jpg) (https://servimg.com/view/18356706/220)
Title: Re: DFO: dual frequency oscillator
Post by: SilentEyes on March 03, 2021, 08:02:54 AM
Hi provato,

I know it has been forever since I posted in this forum lmao.

First and foremost, How would I be able to wire the switch to my oscillator? I was thinking more like I take NTSC/3.3v from one pin of the GPU and then PAL/GND from another pin of the GPU and somehow wire them to the outsides of the switch and then the middle to the oscillator? My PU-7 does seem to only have 1 input. If you're saying that I need to wire the input of S0 the switch, I wouldn't really understand how to do that. I dunno, you're better than me at this. It seems that the newer models are easier cause they have two inputs that you can link to a second oscillator. In this case, I was thinking of wiring a 53.20mhz oscillator from a PAL ps1 that's broken, but I don't know where S0 would be on a hardwired pu-7. I know this is a lot lmao, I have lots of questions. Please let me know.

Thanks!
Title: Re: DFO: dual frequency oscillator
Post by: SilentEyes on March 03, 2021, 02:36:02 PM
Well, too late now. I broke my pu-7 :(
Title: Re: DFO: dual frequency oscillator
Post by: provato on March 03, 2021, 06:02:54 PM
Quote from: SilentEyes on March 03, 2021, 08:02:54 AMHi provato,

I know it has been forever since I posted in this forum lmao.

First and foremost, How would I be able to wire the switch to my oscillator? I was thinking more like I take NTSC/3.3v from one pin of the GPU and then PAL/GND from another pin of the GPU and somehow wire them to the outsides of the switch and then the middle to the oscillator? My PU-7 does seem to only have 1 input. If you're saying that I need to wire the input of S0 the switch, I wouldn't really understand how to do that. I dunno, you're better than me at this. It seems that the newer models are easier cause they have two inputs that you can link to a second oscillator. In this case, I was thinking of wiring a 53.20mhz oscillator from a PAL ps1 that's broken, but I don't know where S0 would be on a hardwired pu-7. I know this is a lot lmao, I have lots of questions. Please let me know.

Thanks!

Yes, if you go with the "switch" theory, you need a 2-position 3-prong switch. Then you connect the wires as described below:

Middle prong —> S0 input of the dfo
Left prong -> 3,3v from wherever you want
Right prong -> GND from wherever you want

...this way switch on the left position means 60hz and on the right 50hz.

BUT have you tried measuring the voltages with both region discs where I point with the red arrow? You may not need a switch...

Quote from: SilentEyes on March 03, 2021, 02:36:02 PMWell, too late now. I broke my pu-7 :(

Maybe it's fixable ;) you got pm
Title: Re: DFO: dual frequency oscillator
Post by: Monkeyball on March 18, 2021, 06:03:52 PM
I've had a DFO installed on my PAL 5552 model PS1 and I am having a strange issue with the console.
My TV normally switches between NTSC / PAL modes automatically but on this occasion it is having issues syncing to the PS1 signal

The strange bit is the console is a PAL model with DFO but PAL games are not syncing correctly and if the TV does manage to lock onto the signal the colours come out wrong NTSC games are working normally though.

I had the DFO installed so that I could have the games work with the correct colours in PAL / NTSC using composite cable.

What do you think is going on?
It works on a more modern TV KV-32FQ70U but not my primary retro tv SONY KV-A2942U

The TV in the video is in service mode and it gives an example of the problem
https://www.dropbox.com/s/nq7zpme04u4qn9e/VIDEO0286.mp4?dl=0

In the second video you can see it a bit clearer without the black rolling lines picked up by the phone camera
https://www.dropbox.com/s/mj74auwwcfi40i8/VIDEO0287.mp4?dl=0

I'm thinking maybe its an issue with the installation or the DFO itself as I understand it was made with modern TV's in mind?
Maybe an older CRT needs different clock frequency timing?

Btw what was the result of installing a 50/60hz switch on the 1002 model? I'm guessing that installing a switch will allow the TV to sync properly
Title: Re: DFO: dual frequency oscillator
Post by: provato on March 19, 2021, 08:03:37 AM
Quote from: Monkeyball on March 18, 2021, 06:03:52 PMI've had a DFO installed on my PAL 5552 model PS1 and I am having a strange issue with the console.
My TV normally switches between NTSC / PAL modes automatically but on this occasion it is having issues syncing to the PS1 signal

The strange bit is the console is a PAL model with DFO but PAL games are not syncing correctly and if the TV does manage to lock onto the signal the colours come out wrong NTSC games are working normally though.

I had the DFO installed so that I could have the games work with the correct colours in PAL / NTSC using composite cable.

What do you think is going on?
It works on a more modern TV KV-32FQ70U but not my primary retro tv SONY KV-A2942U

The TV in the video is in service mode and it gives an example of the problem
https://www.dropbox.com/s/nq7zpme04u4qn9e/VIDEO0286.mp4?dl=0

In the second video you can see it a bit clearer without the black rolling lines picked up by the phone camera
https://www.dropbox.com/s/mj74auwwcfi40i8/VIDEO0287.mp4?dl=0

I'm thinking maybe its an issue with the installation or the DFO itself as I understand it was made with modern TV's in mind?
Maybe an older CRT needs different clock frequency timing?

Btw what was the result of installing a 50/60hz switch on the 1002 model? I'm guessing that installing a switch will allow the TV to sync properly

It's not a mod for modern TVs only. It should work perfectly fine with ntsc 4.43 and pal 4.43 capable CRTs. Your monitors are indeed capable of both ntsc and pal (looked up the manuals).
Use an RGB scart PS1 cable (to rule out subcarrier frequency problems) and see if the problem persists.
If it does, then most probably it's an installation or a clockpro code problem.
Which clockpro hex file have you written on the cdce**** chip, and which such chip are you using?
Title: Re: DFO: dual frequency oscillator
Post by: Monkeyball on March 23, 2021, 06:21:00 AM
Quote from: provato on March 19, 2021, 08:03:37 AMIt's not a mod for modern TVs only. It should work perfectly fine with ntsc 4.43 and pal 4.43 capable CRTs. Your monitors are indeed capable of both ntsc and pal (looked up the manuals).
Use an RGB scart PS1 cable (to rule out subcarrier frequency problems) and see if the problem persists.
If it does, then most probably it's an installation or a clockpro code problem.
Which clockpro hex file have you written on the cdce**** chip, and which such chip are you using?

Hi,

It works fine through RGB Scart no issues at all but I do prefer to use the composite cable
I purchased it from a website and unfortunately I am not getting much help from the seller so I thought to post here.

To see what I can do to correct the issue

The chip is 3.3V SMD version I'll contact the seller to find out which clockpro hex file it is
Title: Re: DFO: dual frequency oscillator
Post by: provato on March 24, 2021, 03:06:18 AM
Quote from: Monkeyball on March 23, 2021, 06:21:00 AM
Quote from: provato on March 19, 2021, 08:03:37 AMIt's not a mod for modern TVs only. It should work perfectly fine with ntsc 4.43 and pal 4.43 capable CRTs. Your monitors are indeed capable of both ntsc and pal (looked up the manuals).
Use an RGB scart PS1 cable (to rule out subcarrier frequency problems) and see if the problem persists.
If it does, then most probably it's an installation or a clockpro code problem.
Which clockpro hex file have you written on the cdce**** chip, and which such chip are you using?

Hi,

It works fine through RGB Scart no issues at all but I do prefer to use the composite cable
I purchased it from a website and unfortunately I am not getting much help from the seller so I thought to post here.

To see what I can do to correct the issue

The chip is 3.3V SMD version I'll contact the seller to find out which clockpro hex file it is

That's great news! If RGB works perfectly fine and gives you 50hz in PAL and 59,94 (60hz) in NTSC, then the colour problem you see it's the TV's fault!!! Your monitor (through composite) cannot tolerate big differences in the subcarrier colour frequency. This frequency must be 3.58 or 4.43 for NTSC and 4.43 for PAL and the DFO just can't do that accurately. Only the MFO (multiple frequency oscillator) offers both correct frequencies (video frequency & subcarrier colour frequency).
RGB DOES NOT use subcarrier frequency for the colour, that is why it works perfectly in both of your monitors.

Take a look here for more info:
https://www.obscuregamers.com/threads/mfo-mod-on-scph-750x-ps1s-my-e-journal-edition.2932/
I still have a few MFO boards if you are interested, and you can sell your DFO to someone that only uses RGB.

PS: Here is the diagram for scph-55xx MFO installation:

(https://lh3.googleusercontent.com/Bke85rA3fv0_UMKF6ga0MEoX6v38KQME9Sp3ZLARxiLTWqkJkGRfRVCzfEVADz2vlEknnZIFC_qv9uotRn82mUI68Eho5SpuvJ-kaIfvNDfkOYD_r7JoQgUmGgfebJsGhmQXDQ0mMw=w2400)
(https://lh3.googleusercontent.com/DJqtmdS_wbxM0VI1J-NuvwlshxaN0reWMHkng7GasCrnLAhljtxP-WrSfG8fro-FMjXzKzm1JKRmyd1yVekJ0cN0JpdZUTIae2BLooK0oTpkTs-ZnMOajca1ncuXAwVj3ZOpCquqng=w2400)
Title: Re: DFO: dual frequency oscillator
Post by: Monkeyball on March 24, 2021, 04:39:32 PM
This is great news I would like to purchase an MFO board how do I do this?

PM sent
Title: Re: DFO: dual frequency oscillator
Post by: bytestorm on May 16, 2021, 01:58:26 AM
Are there any other alternatives/newer clock generators suitable? Since this specific ones are now unobtainium :/...
Title: Re: DFO: dual frequency oscillator
Post by: iVirtualZero on November 20, 2021, 08:57:32 AM
Quote from: Antonio on March 20, 2020, 02:27:27 AM
Quote from: iVirtualZero on November 02, 2019, 08:22:42 PMHow do i install the DFO in an earlier model PS1 the one with the composite ports? PU-8 SCPH-1002 model.

Here's a picture of your board.

(https://upload.wikimedia.org/wikipedia/commons/1/1e/Sony_Playstation_1_SCPH-1002_motherboard_top.jpg)

Close to the GPU, there is an xtal marked "53.20", which outputs 53.2 MHz. Remove it from the board using a hot air gun while being careful to not remove any of the other SMD components that are close to it. That will reveal 4 solder points. Now it's time to install the DFO: solder the 3v3 line to the upper left pad, solder the GND line to the lower right pad, solder the CLK output to the upper right pad and finally solder the S0 line to pin 7 of the Sony CXA1645 video encoder chip.

You can also follow this procedure on PU-18 boards (SCPH-550x), although it uses a different video encoder, so you should solder S0 to a via that leads to pin 157 of the GPU instead.

Thanks for the reply i have since switched to the later 750X PS1 model, as i read that the later model PS1's have a sleight graphics boost along with a more power efficent PSU and better reliability. As for sound it's likely all the same. Just that the earlier model have the AV ports which could be directly plugged into a sound system of some kind.
Title: Re: DFO: dual frequency oscillator
Post by: iVirtualZero on November 20, 2021, 09:00:55 AM
Also i just picked up a DFO for the SNES, but cannot find a guide for it. I have 1Chip SNES. It would be great, if someone can post the install diagram here for both 1Chip and Non 1Chips.