NES/SNES 240p dejitter mod

The place for all discussion on gaming hardware
User avatar
Digital Dragon
Posts: 51
Joined: Sat Sep 01, 2018 8:52 pm
Location: Wales

Re: NES/SNES 240p dejitter mod

Post by Digital Dragon »

And sorry about my mistake, i meant keep looking for a shielded cable instead of just two wires side by side. :oops: By the way, pin 20 of the PPU (the end one) is a ground pin, any use grounding both sides then? Or is that redundant?
User avatar
marqs
Posts: 1034
Joined: Sat Dec 15, 2012 12:11 pm
Location: Finland

Re: NES/SNES 240p dejitter mod

Post by marqs »

Digital Dragon wrote:And sorry about my mistake, i meant keep looking for a shielded cable instead of just two wires side by side. :oops: By the way, pin 20 of the PPU (the end one) is a ground pin, any use grounding both sides then? Or is that redundant?
For highest robustness both ends (of the shield) should be connected to the nearest ground.
Digital Dragon wrote:Thanks for the help Marqs. But i don't quite understand, you say 'successive readings' but what does that mean?

If i turn it on, no matter what settings i change on the ossc, for that console power cycle it displays say 60.26Hz. However, by powering off and on the console i'll get a different read say 60.08Hz or 60.30Hz. Is that OK? I didnt think to check, but what happens with an unmodded NES? I think it was 60.08Hz every time if I remember.
I was referring to the cycle count provided by FPGA which is in the range of ~449200. You can calculate the exact refresh rate by dividing 27000000 by it.
User avatar
Digital Dragon
Posts: 51
Joined: Sat Sep 01, 2018 8:52 pm
Location: Wales

Re: NES/SNES 240p dejitter mod

Post by Digital Dragon »

OK, so after finding a Coax cable with a foil shield and redoing the mod with both ends grounded, I've got better results. I now get 60.08Hz about 50% of the time, and 60.22Hz etc the other 50%. If i turn the OSSC off and on again i get a different reading so 60.22Hz becomes 60.08Hz. Wish i tried this with the other wires to see what effect power cycling the ossc would have had. I think its good enough to leave now, though im sure other people could have done a better job. Also, I'm fairly certain by now C10 was the right one to remove, so MrTheBigCheese feel free to add my photos to your wiki. Was hoping that id be helpfull with doing this mod, but it seems i needed more help than I've given lol. Thanks for all the help everyone. :D

PS. I had a thought about this board, could you use the mclk_i to pass a slightly underclocked frequency to an SNES for playing SuperGameboy games at the right speed. SNES clock is 21.477MHz which is divided by 5 to get 4.295MHz which is 2.4% faster than the gameboys 4.194MHz. If you were to pass a 20.97MHz clock in, it would get divided by 5 to exactly the Gameboys 4.194MHz. Would this even work? Or am i missing something? This is assuming you can even get 20.97MHz oscillator. Just a thought
paulb_nl
Posts: 340
Joined: Sat Feb 20, 2016 5:05 pm

Re: NES/SNES 240p dejitter mod

Post by paulb_nl »

Digital Dragon wrote:I now get 60.08Hz about 50% of the time, and 60.22Hz etc the other 50%. If i turn the OSSC off and on again i get a different reading so 60.22Hz becomes 60.08Hz.
This is caused by the Sync LPF. If you set it to Off the results will be much more stable. You can just change the input instead of power cycling the OSSC.
thebigcheese
Posts: 707
Joined: Sun Aug 21, 2016 5:18 pm

Re: NES/SNES 240p dejitter mod

Post by thebigcheese »

Digital Dragon wrote:PS. I had a thought about this board, could you use the mclk_i to pass a slightly underclocked frequency to an SNES for playing SuperGameboy games at the right speed. SNES clock is 21.477MHz which is divided by 5 to get 4.295MHz which is 2.4% faster than the gameboys 4.194MHz. If you were to pass a 20.97MHz clock in, it would get divided by 5 to exactly the Gameboys 4.194MHz. Would this even work? Or am i missing something? This is assuming you can even get 20.97MHz oscillator. Just a thought
The SNES's clock is not the issue. The Super Game Boy itself has an oscillator in it that is meant to run at the same speed as the SNES (I believe), but that is faster than the original Game Boy circuit. Super Game Boy 2 fixed that issue, but it's JP-only. Which isn't really a problem since you can just snap off the tabs in the SNES to play it fine, but just something to consider. I think there may also be mod kits for original Super Game Boy to swap out the oscillator.
User avatar
marqs
Posts: 1034
Joined: Sat Dec 15, 2012 12:11 pm
Location: Finland

Re: NES/SNES 240p dejitter mod

Post by marqs »

When you get a reading of 60.30Hz or so, does the main screen also list the mode as 261p: (262/261)*60.08=60.31Hz? It'd just mean the digitizer returns an incorrect line count while initially detecting the signal, nothing to worry about.
User avatar
Digital Dragon
Posts: 51
Joined: Sat Sep 01, 2018 8:52 pm
Location: Wales

Re: NES/SNES 240p dejitter mod

Post by Digital Dragon »

marqs wrote:When you get a reading of 60.30Hz or so, does the main screen also list the mode as 261p: (262/261)*60.08=60.31Hz? It'd just mean the digitizer returns an incorrect line count while initially detecting the signal, nothing to worry about.
Well i checked, since I've redone the mod i don't get 60.30Hz anymore just 60.08-60.22Hz, and they all say 262p. Don't worry too much about it, i just wanted to make sure id done it right so i could provide the right pictures for the wiki.

By the way Marqs, what do you think about my super gameboy idea? I looked it up and the SGB definitely doesn't have an oscillator, it gets it from the SNES's clock divided by 5. So im sure you made a mistake there TheBigCheese. Only the SGB2 has an oscillator. That said, the SGB has some frame stuttering to manage the two different refresh rates, so i don't know what would happen if the SGB were to run at a different speed.
samson7point1
Posts: 58
Joined: Sun Jun 26, 2016 6:44 pm

Re: NES/SNES 240p dejitter mod

Post by samson7point1 »

thebigcheese wrote:
Digital Dragon wrote:PS. I had a thought about this board, could you use the mclk_i to pass a slightly underclocked frequency to an SNES for playing SuperGameboy games at the right speed. SNES clock is 21.477MHz which is divided by 5 to get 4.295MHz which is 2.4% faster than the gameboys 4.194MHz. If you were to pass a 20.97MHz clock in, it would get divided by 5 to exactly the Gameboys 4.194MHz. Would this even work? Or am i missing something? This is assuming you can even get 20.97MHz oscillator. Just a thought
The SNES's clock is not the issue. The Super Game Boy itself has an oscillator in it that is meant to run at the same speed as the SNES (I believe), but that is faster than the original Game Boy circuit. Super Game Boy 2 fixed that issue, but it's JP-only. Which isn't really a problem since you can just snap off the tabs in the SNES to play it fine, but just something to consider. I think there may also be mod kits for original Super Game Boy to swap out the oscillator.
Actually I don't believe that's correct. There are no crystal clocks on the SGB pcb. The "KDR-2/U2" chip just divides the frequency coming off pin 1 on the SNES cart slot to feed the SGB CPU.
References:

SNES Cart Slot Pinouts
https://www.caitsith2.com/snes/flashcar ... nouts.html

SGB Circuit Diagram showing Pin 1 of the SNES Cart Slot feeding KDR-2/U2
http://gbdev.gg8.se/wiki/articles/SGB_Schematic

Tutorial on a hardware clock fix which corroborates the function and operation of KDR-2/U2
http://soundofsilver.co.uk/blog/2015/02 ... speed-fix/
copy
Posts: 232
Joined: Fri Apr 29, 2016 10:38 pm

Re: NES/SNES 240p dejitter mod

Post by copy »

I just finished installing the dejitter board in my NES-001, and so far my NES is absolutely rock solid on my Sony X900E. Every OSSC mode from Line2x to 5x works perfectly now.

I'm totally thrilled right now. I can't believe how well this mod works. Incredible!
thebigcheese
Posts: 707
Joined: Sun Aug 21, 2016 5:18 pm

Re: NES/SNES 240p dejitter mod

Post by thebigcheese »

Sorry, I misspoke. The issue is SGB1 does not have an oscillator, but SGB2 does, so it runs at the correct speed. However, you can add one to SGB1 to fix it. It's possible dejitter board could be configured for that, but it would be Overkill and there are already mods for it. Or you could get a SGB2 :p
User avatar
Digital Dragon
Posts: 51
Joined: Sat Sep 01, 2018 8:52 pm
Location: Wales

Re: NES/SNES 240p dejitter mod

Post by Digital Dragon »

I guess it might just be easier, as if you're already doing this mod, it saves on doing another mod. It may make the snes output less than 60Hz though so maybe its not a good idea. Given that your underclocking it by 2.4% it may output 58.66Hz. But then again maybe I'm completely missing the point.

By the way, i thought I'd mention my results with compatibility. My samsung tv was already compatible with NES at 1-5x, but when using an Elgato camlink and OBS I couldn't get a stable picture at any LineX mode. The picture would just jump around the screen, and OBS didn't like it so much that on 2 occasions it caused my PC to bluescreen! Now I've done the dejitter i get a stable 3x, but no picture at 1/2x and a messed up screen of pixels at 4/5x. Alright all things considered, especially since I generally record in 720p. Just wanted to say in case anyone was having similar issues with camlink and OBS.
User avatar
Harrumph
Posts: 368
Joined: Tue Jan 19, 2016 10:06 pm
Location: Sweden

Re: NES/SNES 240p dejitter mod

Post by Harrumph »

Digital Dragon wrote: Now I've done the dejitter i get a stable 3x, but no picture at 1/2x and a messed up screen of pixels at 4/5x. Alright all things considered, especially since I generally record in 720p. Just wanted to say in case anyone was having similar issues with camlink and OBS.
Think you might have a problem with either the mod or the camlink. Others have reported the mod makes camlink compatible with all modes (atleast for SNES, and output should be very similar to NES).
See this thread for some info on updating the camlink.
http://www.videogameperfection.com/foru ... post-21733
User avatar
marqs
Posts: 1034
Joined: Sat Dec 15, 2012 12:11 pm
Location: Finland

Re: NES/SNES 240p dejitter mod

Post by marqs »

Digital Dragon wrote:By the way Marqs, what do you think about my super gameboy idea? I looked it up and the SGB definitely doesn't have an oscillator, it gets it from the SNES's clock divided by 5. So im sure you made a mistake there TheBigCheese. Only the SGB2 has an oscillator. That said, the SGB has some frame stuttering to manage the two different refresh rates, so i don't know what would happen if the SGB were to run at a different speed.
I think you'd need to select suitable crystals/oscillators for both SNES and SGB1 to get each one running at GB's refresh rate to minimize the amount of duplicated/dropped frames.
User avatar
Digital Dragon
Posts: 51
Joined: Sat Sep 01, 2018 8:52 pm
Location: Wales

Re: NES/SNES 240p dejitter mod

Post by Digital Dragon »

Harrumph wrote:
Digital Dragon wrote: Now I've done the dejitter i get a stable 3x, but no picture at 1/2x and a messed up screen of pixels at 4/5x. Alright all things considered, especially since I generally record in 720p. Just wanted to say in case anyone was having similar issues with camlink and OBS.
Think you might have a problem with either the mod or the camlink. Others have reported the mod makes camlink compatible with all modes (atleast for SNES, and output should be very similar to NES).
See this thread for some info on updating the camlink.
http://www.videogameperfection.com/foru ... post-21733
OK, an update on compatibility. After changing Camlink to Isochronous mode, and setting OSSC to 'HDMI ITC' to 'On' and 'H-PLL Pre-Coast' and 'H-PLL Post-Coast' both to 3 (Don't know if or why these helped but some modes would be jumbled without these settings). Here are my results;

1x - Yes! (Surprisingly) Ultra wide though, as it's 720x240
2x - Yes, No issues
3x - Yes, No issues (Always worked)
4x - Yes, No issues
5x - At 1080p, I get either a jumbled image or an image for 2 seconds before freezing.
At 1600x1200, surprisingly it works with no issues.
At 1920x1200, same freezing as 1080p.

In the end, I'm still gonna record in 720p, but it's nice to know that this mod has worked better than just increasing compatibility by one LineX mode. Thanks for all the help guys, I think I'm done with the mod now :D
User avatar
NoAffinity
Posts: 1019
Joined: Mon May 07, 2018 5:27 pm
Location: Escondido, CA, USA

Re: NES/SNES 240p dejitter mod

Post by NoAffinity »

Digital Dragon wrote:
Harrumph wrote:
Digital Dragon wrote: Now I've done the dejitter i get a stable 3x, but no picture at 1/2x and a messed up screen of pixels at 4/5x. Alright all things considered, especially since I generally record in 720p. Just wanted to say in case anyone was having similar issues with camlink and OBS.
Think you might have a problem with either the mod or the camlink. Others have reported the mod makes camlink compatible with all modes (atleast for SNES, and output should be very similar to NES).
See this thread for some info on updating the camlink.
http://www.videogameperfection.com/foru ... post-21733
OK, an update on compatibility. After changing Camlink to Isochronous mode, and setting OSSC to 'HDMI ITC' to 'On' and 'H-PLL Pre-Coast' and 'H-PLL Post-Coast' both to 3 (Don't know if or why these helped but some modes would be jumbled without these settings). Here are my results;

1x - Yes! (Surprisingly) Ultra wide though, as it's 720x240
2x - Yes, No issues
3x - Yes, No issues (Always worked)
4x - Yes, No issues
5x - At 1080p, I get either a jumbled image or an image for 2 seconds before freezing.
At 1600x1200, surprisingly it works with no issues.
At 1920x1200, same freezing as 1080p.

In the end, I'm still gonna record in 720p, but it's nice to know that this mod has worked better than just increasing compatibility by one LineX mode. Thanks for all the help guys, I think I'm done with the mod now :D
Congrats on getting to a solution!

One note, and maybe you don't want to mess with it further at this point, but H-PLL Pre- and Post-Coast should have no effect if the mod is hooked up correctly (using pin 3 for csync). I stumbled through that too when doing my first mod attempt, on a SNES Mini. The problem was a combination of routing the mod sync_o line to the wrong pin, having CVBS sync still active, and having a cable that was wired for CVBS sync. My foibles are documented here, if it's of any value: https://www.videogameperfection.com/for ... itter-mod/. It may not be useful, since you're doing a NES, but maybe it is. :)
User avatar
Digital Dragon
Posts: 51
Joined: Sat Sep 01, 2018 8:52 pm
Location: Wales

Re: NES/SNES 240p dejitter mod

Post by Digital Dragon »

NoAffinity wrote: Congrats on getting to a solution!

One note, and maybe you don't want to mess with it further at this point, but H-PLL Pre- and Post-Coast should have no effect if the mod is hooked up correctly (using pin 3 for csync). I stumbled through that too when doing my first mod attempt, on a SNES Mini. The problem was a combination of routing the mod sync_o line to the wrong pin, having CVBS sync still active, and having a cable that was wired for CVBS sync. My foibles are documented here, if it's of any value: https://www.videogameperfection.com/for ... itter-mod/. It may not be useful, since you're doing a NES, but maybe it is. :)
Yeah I think Marqs has covered this before, the short scanline is right after Vsync on snes so Pre and post coast can help. However, with NES it is far from Vsync so pre and post coast should have no effect. That said I think 2x and 4x would only work with those settings on, but I don't know why. By the way I am using Csync
User avatar
NoAffinity
Posts: 1019
Joined: Mon May 07, 2018 5:27 pm
Location: Escondido, CA, USA

Re: NES/SNES 240p dejitter mod

Post by NoAffinity »

Question to anyone that knows. On SNES Mini (SNN-CPU-01), should composite output still work, after the dejitter mod?
kimaq
Posts: 3
Joined: Sat Oct 20, 2018 9:38 am

Re: NES/SNES 240p dejitter mod

Post by kimaq »

Hi,

I've just assembled and programmed my boards but it took me much more time than expected and I have decided to share my problems.
I've lost several hours soldering, desoldering, measuring, reading, troubleshooting and was ready to give up.
All of that because of what I think fake CPLDs. All the other parts were ordered from trustworthy local sellers but I couldn't find ATF1502AS anywhere in Poland. I've ordered CPLDs from UTSOURCE.COM. They look fine, but failed while trying to jtag them. OPENOCD reported no TAPs available.
I've decided to order another CPLDs from ARROW.COM. 5 days later my parts arrived. Desoldering old "fake" ATFs and soldering new ones. Bam, first try and all of them worked like a charm.

Now I'm ready for the install process but need some help. My SNES is 1CHIP PAL modded with a simple DPDT 50/60HZ region switch. Like this:
Image

How can i redo my mod to switch between original PAL XTAL and dejittered NTSC signal? I know i would probably route csync directly to multiav pin.

Kind Regards,
Peter
Last edited by kimaq on Sun Oct 21, 2018 6:28 pm, edited 1 time in total.
User avatar
Digital Dragon
Posts: 51
Joined: Sat Sep 01, 2018 8:52 pm
Location: Wales

Re: NES/SNES 240p dejitter mod

Post by Digital Dragon »

NoAffinity wrote:Question to anyone that knows. On SNES Mini (SNN-CPU-01), should composite output still work, after the dejitter mod?
So this shouldn't effect the usual pipeline of a SNES so RGB and composite etc should still work. One problem some people have had is using composite video for sync with RGB, as the encoder is still recieving jittery sync (as apposed to the dejitter boards generated sync) the composite output will still have jitter problems. They then either just use dejittered csync for sync, or feed the SRGB encoder the dejittered csync to make dejittered Composite. As to any snes mini specific things, I don't think the mini would be different to a usual snes in this regard, but I'm no expert so if someone could confirm.
User avatar
Digital Dragon
Posts: 51
Joined: Sat Sep 01, 2018 8:52 pm
Location: Wales

Re: NES/SNES 240p dejitter mod

Post by Digital Dragon »

Kimaq - I know it involves disconnecting the pal clock from the cpu/ppu and wiring it to MCLK_EXT_i, but beyond that I'm not sure.
User avatar
NoAffinity
Posts: 1019
Joined: Mon May 07, 2018 5:27 pm
Location: Escondido, CA, USA

Re: NES/SNES 240p dejitter mod

Post by NoAffinity »

Digital Dragon wrote:
NoAffinity wrote:Question to anyone that knows. On SNES Mini (SNN-CPU-01), should composite output still work, after the dejitter mod?
So this shouldn't effect the usual pipeline of a SNES so RGB and composite etc should still work. One problem some people have had is using composite video for sync with RGB, as the encoder is still recieving jittery sync (as apposed to the dejitter boards generated sync) the composite output will still have jitter problems. They then either just use dejittered csync for sync, or feed the SRGB encoder the dejittered csync to make dejittered Composite. As to any snes mini specific things, I don't think the mini would be different to a usual snes in this regard, but I'm no expert so if someone could confirm.
Thank you for the confirmation. I found the problem. Had lifted a cap on the sync line, when I was first fumbling around with the dejitter mod. I re-installed the cap, can cvbs is back. :)
User avatar
marqs
Posts: 1034
Joined: Sat Dec 15, 2012 12:11 pm
Location: Finland

Re: NES/SNES 240p dejitter mod

Post by marqs »

Digital Dragon wrote:Kimaq - I know it involves disconnecting the pal clock from the cpu/ppu and wiring it to MCLK_EXT_i, but beyond that I'm not sure.
MCLK_EXT_i is designed to be a clock input (for PAL 3-CHIPs as described here), so wiring a crystal directly to it is unlikely to work due to pull-down and lack of direct feedback path to other XTAL pin. However, it should be still possible to make the mod work with such dual-XTAL 1-CHIP by replacing NTSC XTAL with the dejitter board so that the switch selects either PAL-XTAL or MCLK_o to drive XIN of S-CPUN. MCLK_EXT_i would then be left unconnected while MCLK_SEL_i should be wired to the center of the other switch (i.e. the same line that goes to S-CPUN pin 111).
User avatar
Digital Dragon
Posts: 51
Joined: Sat Sep 01, 2018 8:52 pm
Location: Wales

Re: NES/SNES 240p dejitter mod

Post by Digital Dragon »

Oops :oops: Yeah don't listen to me, listen to the Master.
copy
Posts: 232
Joined: Fri Apr 29, 2016 10:38 pm

Re: NES/SNES 240p dejitter mod

Post by copy »

Does anyone else have problems with the OSSC's 256x240 optimized mode on a dejittered NES?

I've tried to fine tune the sampling phase and H/V backporch, but I get: no picture, a vertically offset picture, or a fuzzy and offset picture.

Just wondering if this is a common problem with the NES and dejitter, or my TV, or what. Generic 4:3 works flawlessly.
User avatar
marqs
Posts: 1034
Joined: Sat Dec 15, 2012 12:11 pm
Location: Finland

Re: NES/SNES 240p dejitter mod

Post by marqs »

copy wrote:Does anyone else have problems with the OSSC's 256x240 optimized mode on a dejittered NES?

I've tried to fine tune the sampling phase and H/V backporch, but I get: no picture, a vertically offset picture, or a fuzzy and offset picture.

Just wondering if this is a common problem with the NES and dejitter, or my TV, or what. Generic 4:3 works flawlessly.
Which lineX mode you're referring to and are you using latest fw? If you disable "Allow TVP HPLL2x", then line5x generic should have exactly same sampling parameters and output timings (when V.backporch is set to 14) than line5x 256x240 mode.
kimaq
Posts: 3
Joined: Sat Oct 20, 2018 9:38 am

Re: NES/SNES 240p dejitter mod

Post by kimaq »

marqs wrote:
Digital Dragon wrote:Kimaq - I know it involves disconnecting the pal clock from the cpu/ppu and wiring it to MCLK_EXT_i, but beyond that I'm not sure.
MCLK_EXT_i is designed to be a clock input (for PAL 3-CHIPs as described here), so wiring a crystal directly to it is unlikely to work due to pull-down and lack of direct feedback path to other XTAL pin. However, it should be still possible to make the mod work with such dual-XTAL 1-CHIP by replacing NTSC XTAL with the dejitter board so that the switch selects either PAL-XTAL or MCLK_o to drive XIN of S-CPUN. MCLK_EXT_i would then be left unconnected while MCLK_SEL_i should be wired to the center of the other switch (i.e. the same line that goes to S-CPUN pin 111).
Hi,

I'm going to try that but what about C3 capacitor? Will my pal xtal work without it?
User avatar
marqs
Posts: 1034
Joined: Sat Dec 15, 2012 12:11 pm
Location: Finland

Re: NES/SNES 240p dejitter mod

Post by marqs »

kimaq wrote:I'm going to try that but what about C3 capacitor? Will my pal xtal work without it?
Is that a load cap for the crystal? In that case I wouldn't remove it - assuming XIN line side of the crystal is wired to the switch, it shouldn't matter for MCLK_o if there is a picofarad-range cap to GND on the same line.
kimaq
Posts: 3
Joined: Sat Oct 20, 2018 9:38 am

Re: NES/SNES 240p dejitter mod

Post by kimaq »

marqs wrote:
kimaq wrote:I'm going to try that but what about C3 capacitor? Will my pal xtal work without it?
Is that a load cap for the crystal? In that case I wouldn't remove it - assuming XIN line side of the crystal is wired to the switch, it shouldn't matter for MCLK_o if there is a picofarad-range cap to GND on the same line.
I've hooked it up and can confirm it's working as intended na PAL 1CHIP-02. I can toggle between original pal crystal and dejittered ntsc. I'm leaving town for the weekend but later will post some pics if anyone needs.
sofakng
Posts: 218
Joined: Fri Sep 02, 2016 1:30 am

Re: NES/SNES 240p dejitter mod

Post by sofakng »

I've order two dejitter boards a while ago and they are v1.2 instead of the latest v1.3. I've read the changelog for v1.3 but don't really understand any of the changes. Should I make any modifications to the v1.2 board before I install them in my NES and SNES?

Also, what is the latest firmware (CPLD image?) that I should both on my NES dejitter board and my SNES dejitter board?
User avatar
marqs
Posts: 1034
Joined: Sat Dec 15, 2012 12:11 pm
Location: Finland

Re: NES/SNES 240p dejitter mod

Post by marqs »

sofakng wrote:I've order two dejitter boards a while ago and they are v1.2 instead of the latest v1.3. I've read the changelog for v1.3 but don't really understand any of the changes. Should I make any modifications to the v1.2 board before I install them in my NES and SNES?

Also, what is the latest firmware (CPLD image?) that I should both on my NES dejitter board and my SNES dejitter board?
There's no major changes between v1.2 and v1.3. Just use the latest SVF file from github (master / nes-fix branch depending on target) and follow installation instructions.
Post Reply