DFO: dual frequency oscillator

Started by micro, February 01, 2015, 02:50:37 AM

Previous topic - Next topic

micro

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




albino_vulpix

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.

micro

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

micro

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

micro

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

micro

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)

micro

#6
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

micro

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

micro

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)

Unseen

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.

MockyLock

Hey Unseen, are you the one from the famous gcVideo ?

Unseen


BuckoA51

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 :'( ).

micro

@Unseen: Good work!  8)

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

micro

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/

Link83

#15
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: 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

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

Konsolkongen

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

BuckoA51

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!

micro

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

zyrobs

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.

Link83

#20
@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...

zyrobs

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.

Dopefish

@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?

Antonio

#23
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.

Segasonicfan

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).
MY WEBSITE: https://segasonicfan.wixsite.com/retro
I design PCBs for retro game systems :)

bmp02

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.

Segasonicfan

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.
MY WEBSITE: https://segasonicfan.wixsite.com/retro
I design PCBs for retro game systems :)

bmp02

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.

NFG

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. 

Segasonicfan

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! :)

MY WEBSITE: https://segasonicfan.wixsite.com/retro
I design PCBs for retro game systems :)

NFG

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.  ;(

Segasonicfan

I mean its a good thing!  I dont like email notifications for everything (Im oldskool, I guess) :)
MY WEBSITE: https://segasonicfan.wixsite.com/retro
I design PCBs for retro game systems :)

bmp02

I actually did get notifications for these replies haha
Didn't change any setting in my profile. No worries though, I find it useful

bmp02

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

bmp02

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.

Segasonicfan

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.
MY WEBSITE: https://segasonicfan.wixsite.com/retro
I design PCBs for retro game systems :)

bmp02

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!

Segasonicfan

looking forward to your reportback! :)
MY WEBSITE: https://segasonicfan.wixsite.com/retro
I design PCBs for retro game systems :)

bmp02

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.

Segasonicfan

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.
MY WEBSITE: https://segasonicfan.wixsite.com/retro
I design PCBs for retro game systems :)