GBS 8200/8220 CFW Project

The place for all discussion on gaming hardware
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

People have straight through cables, cables with series resistors, cables with AC coupled sync, etc.
Each of the common csync providing consoles is different as well.
This is a huge range of signals that I have to anticipate. A few of them are way out of spec and could damage components.
(As an example: 75 Ohm termination on a Mega Drive with straight through sync will lead to a lot of stress on the MD, and no usable sync.)

The sync stripper has a wide input level range and produces a known / buffered output level.
Using this, I can recommend a design that works with all the major consoles (hopefully).
So I'm not just using it to strip video information, but also as sort of a gateway / protection into the scaler.

Later on, I hope to simplify the sync input stage. The 5725 has everything needed to extract sync from pretty much any signal.

Anyway, this will just be a recommendation. If your consoles / cables work without the LM1881, great! :)
SCARTicus wrote:I use a SyncStrike for this. It is made specifically to allow you to plug a SCART cable into the GBS board with sync separation.
Yeah, this is a good solution that people can buy and be all set. It's just a bit expensive though. It costs far more than the whole scaler board.
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

I've put the code on Github today! :)
I still have to write proper installation and usage guides to go with this, but for early adopters, you can now tinker with it.

Here is a short intro:
I like to use 5V Arduinos (for example Uno, Pro Mini) that run at 16Mhz, then just run them using 3.3V from the GBS8200.
Update: It's fine to use the 5V versions. See post below.

You can hook up the Arduino like so:
- I2C SCL is pin 4 on the Arduino > connect to GBS I2C header "SCL"
- I2C SDA is pin 5 on the Arduino > connect to GBS I2C header "SDA"
- Arduino ground > connect to ground on GBS. The ground point on the I2C header is fine.
- Arduino power: Either 3.3V from the GBS board to Arduino VCC pin (good for permanent install) or external power (over USB for example, great for developing with an Arduino Uno)
- Arduino A0 pin > connect to red output on the extra VGA output pin header red pin (see picture). This is used for the auto ADC gain feature.

Usage:
The software manages the scaler automatically. There's no user input required. Just connect your console and power it up!

Developers and tinkerers want to connect the Arduino Serial port to a PC. It's great to have an Uno for this.
This enables the Arduino IDE Serial console and you get status information and full control over the scaler!

https://github.com/ramapcsx2/gbs-control

I hope this will be useful to somebody. I'll be writing the guides and improve the code in the next couple days :)
Last edited by rama on Sun Nov 19, 2017 4:56 pm, edited 3 times in total.
tongshadow
Posts: 633
Joined: Sat Jan 07, 2017 5:11 pm

Re: GBS 8200/8220 CFW Project

Post by tongshadow »

Awesome, thanks rama!

Will this work on the old GBS 8200 (no HDMI) though?
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

Yep, these are what I use as well.
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

I checked the I2C data and clock lines with the scope and went over the bitbanger code.
The code never drives an output pin high. Whenever it configures a pin to output, it's only to pull it to ground.
In idle state, both pins are inputs again.

The I2C pull-up resistors on the GBS8200 pull the lines up to 3.3V. This is a logic 1 on the ATmega processors used in Arduinos.
VIH: 0.6 * VCC(5.0V) = 3.0V

It appears to be safe to connect a 5V powered Arduino to the GBS8200 I2C bus without any level translators.
falz
Posts: 22
Joined: Sat Nov 19, 2016 10:39 pm

Re: GBS 8200/8220 CFW Project

Post by falz »

rama wrote: The software manages the scaler automatically. There's no user input required. Just connect your console and power it up!

Developers and tinkerers want to connect the Arduino Serial port to a PC. It's great to have an Uno for this.
This enables the Arduino IDE Serial console and you get status information and full control over the scaler!

https://github.com/ramapcsx2/gbs-control

I hope this will be useful to somebody. I'll be writing the guides and improve the code in the next couple days :)
This sounds awesome, thanks for the work. I intend to check this out, but could you clarify exactly what it does automatically? My assumption is it handles the scaling better, lowers the latency, and auto senses input resolution.

Does one still use the buttons on the PCB to adjust output resolution? I have an Arduino on order so I may find out soon enough.
Last edited by falz on Tue Nov 21, 2017 2:27 pm, edited 1 time in total.
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

There's a very basic guide now :)
https://github.com/ramapcsx2/gbs-contro ... e-Hardware

Does anyone know if the TrueView 5725 is a clone of another device?
I'm looking for better documentation on it. The register definition is okay but the programming guide is leaving out essential bits.
(But it does spend 30 pages or so on that advanced 3D motion deinterlace stuff >< )
User avatar
SCARTicus
Posts: 189
Joined: Wed Apr 05, 2017 4:51 pm
Location: TX

Re: GBS 8200/8220 CFW Project

Post by SCARTicus »

Excellent! I will put this together once I get home from Thanksgiving. I have an old Sparkfun Redboard that I think is an Uno clone. Is it okay to use the large ground pin from the big RGBS connector on the bottom left if the board? Also, my Gonbes is a V5, which I think means it is a clone. I’ve replaced that one electrolytic capacitor with a tantalum one according to Ian Steadman’s recommendation. This will be interesting. I have a PSOne, Saturn, Genesis, and N64 that I will test it with and I will post pictures and report my findings. Fantastic
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

Any ground on the GBS will work, but it's probably best to use the one on the same pin header as where SDA / SCL are.
The return current shouldn't go through the analog section too much / at all.

V3, V4 or Vwhatever are all pretty much the same and will work :)
User avatar
Gillbert
Posts: 4
Joined: Wed Oct 11, 2017 2:40 am

Re: GBS 8200/8220 CFW Project

Post by Gillbert »

I'll try this as soon as I get an Arduino board. I'm very anxious to start with!

Dear @rama, one question: Could I use an Arduino Nano?
It seems it has almost the same specs that is available on Uno, but is smaller, cheaper and has a built-in USB controller.

Thank you very too much for your amazing work! :D

edit: my bad, I've just realized that the USB connector on Nano is just for +5vcc power :P It doesn't have an USB controller.
I'll go for the Uno then, thanks anyway!
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

Arduino Nano's have working USB. They will do well for this project!
Red_Delta
Posts: 4
Joined: Thu Nov 23, 2017 12:20 am

Re: GBS 8200/8220 CFW Project

Post by Red_Delta »

@Rama I attempted to upload the code to a Pro Mini ATMega 328 - 5V - 16MHz and it is giving me the "Error compiling for board Arduino pro or Pro Mini. I assumed that having the same processor the code would work with the Pro mini, but I could just be wrong. Any idea?

Edit: Nevermind I am an idiot, forgot to load in the libraries, it is up and running on a pro mini
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

Great!
I haven't heard much from testers so far, so I welcome any feedback :)
tongshadow
Posts: 633
Joined: Sat Jan 07, 2017 5:11 pm

Re: GBS 8200/8220 CFW Project

Post by tongshadow »

rama, I've noticed some GBS 8200 models dont have one of the programming ports:

Image

Would your setup still work on this?

Also, could we have some more pictures of how well this setup scales? Hopefully Im not asking for much :P
falz
Posts: 22
Joined: Sat Nov 19, 2016 10:39 pm

Re: GBS 8200/8220 CFW Project

Post by falz »

Per above, it looks like they just removed the pin headers, the points are still there to either solder directly or add pin headers yourself.

my Arduino is scheduled to arrive in a few days, in the mean time I'm giving the original gbs-control code a test with a Rpi I had laying around. If anyone else is doing this, there are several issues with the Raspbian Jessie distro where patches fail. I was able to work through the ones that seem to matter, I can leave detail here if anyone else is also curious.

Since that is functioning, I realized there is no keyboard map to switch to RGBS, only to RGBHV and YPbPr. I'm using this in a JAMMA cabinet to output to a 480p display, how would one properly poke its input to switch to RGBS?

rama, does your code properly handle RGBS input? I see it referred to several times in the code, so I'm guessing yes.
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

@tongshadow: Yeah, you've got to solder cables or pin headers to the points instead.

@falz:
It handles RGBS, where S is ideally csync from 0.2Vpp to 1.5Vpp.
It is optimized for 15kHz content at the moment. The hardware can do all kinds of formats though. It just needs to be coded.
31kHz support is rudimentary. Use the RCA input (YPbPr) for that.
falz
Posts: 22
Joined: Sat Nov 19, 2016 10:39 pm

Re: GBS 8200/8220 CFW Project

Post by falz »

I'm using 15khz RGBS in (240p via Neo Geo MV-1C) and 31khz VGA out (480p) to an Arcade CRT. This works fine without gbs-control attached, I'm just trying to make scaling look slightly better if possible.

If this that not valid as-is, I'm happy to poke around to make it so once I get the Arduino. I was bored and hence testing with the pi for now, but I'm thinking there are many things to overcome to get this working on Raspian Jessie that it may not be worth it.
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

I don't have a 480p preset yet, sorry.
These take a long time to get right. I'll have to look into it when I implement YPbPr output.
rgbfanboy
Posts: 1
Joined: Fri Nov 24, 2017 9:05 pm

Re: GBS 8200/8220 CFW Project

Post by rgbfanboy »

I did some Captures with my PEXHDCAP and AmaRec of PAL NES with NESRGB, PAL SNES and NTSC NES.
https://www.youtube.com/watch?v=A3hR9jBzQ98
https://www.youtube.com/watch?v=cZ7moDKeUG4
https://www.youtube.com/watch?v=tl-rW-uDliA
https://www.youtube.com/watch?v=wE-HAENmRjo

I like the progress of this project :P
falz
Posts: 22
Joined: Sat Nov 19, 2016 10:39 pm

Re: GBS 8200/8220 CFW Project

Post by falz »

My monitor chassis does accept a few higher resolutions and I think just downconverts them to 480p. While not ideal this perhaps will let me test.

My Arduino arrived and I put gbs-control on it and wired it up. I verified wiring with a multimeter in continuity test mode by touching the solder points on the back of Arduino and GBS8820 PCB. Note to anyone using Linux for this, don't use the Ubuntu package as it's too out of date and won't compile and instead gives "setup"/"loop" errors. Get the source directly from Arduino, I'm using v1.8.5.

So once I powered things up I get no picture and the serial monitor only says "5725 not responding" so it's not detecting the trueview.

I am powering the Arduino differently than your instructions but I don't think it would matter. I've used both a USB cable dedicated AC adapter, also tested powering it from my laptop when I got the above debug info.

Unsure what else I can test, note I have a GBS8220 (two VGA outputs) and you appear to have a GBS8200, could it be related to that?

Edit: Derp, it works. I had connected Arduino on Analog pins 4/5, not Digital pins 4/5! Will test more and report back.

I think my first ghetto test will be taking doolink presets and seeing if I can get those to work, perhaps just by overwriting your 'test720p' mode for now. Maybe i'll get lucky and RGBHV_320x240@120Hz_RGB_240p60.set will work, even though that sounds like a really strange mode.
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

Hehe, nice wiring experiment ;p

You can load the 1536 byte dooklink presets with writeProgramArray() after you convert the .set file to a C header.
To convert, I use the Notepad++ find and replace function. Replace all \n with , and add the preset name and closing bracket.
falz
Posts: 22
Joined: Sat Nov 19, 2016 10:39 pm

Re: GBS 8200/8220 CFW Project

Post by falz »

Thanks for pointing out that function, it looks like you must just use this as a test as its not used elsewhere currently.

I loaded both RGBHV_320x240_120Hz_RGB_240p60 and RGBHV_640x480_60Hz_RGB_240p60 to test, and to my surprise both worked! 240p output showed interlacing as it should, 480p looked SO MUCH better than however the GBS handlkes it natively as it seemed to be pixel perfect instead of blurred edges.

It looks like I will have to play with the presets as the horizontal width is whack:

https://imgur.com/a/vvo3J

I did 'h' (scaleHorizontalSmaller) a lot and that helped, i'll have to play with this more to set templates that work well for me. Once I get this figured out i'll post some photos here comparing stock GBS to tuned.

Once I get that, I think my solution will involve doing what mybook4 did (https://github.com/mybook4/DigisparkSke ... BS_Control), which is have a toggle switch that chooses between two modes - 240p and 480p in my case, so I can switch between scanlines and no scanlines, more or less. Perhaps another option that would be more flexible is a pushbutton that cycles through modes so one can have more than two.
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

Dooklink mentioned once that the 5275 is rather made for downscaling, so you're on to something there ;p

I just finally found out how to get to the sync processor output!
There isn't a pin on the chip, nor can any GPIO be configured to replicate the input sync signal.
But there's one bit one can flip on segment 0, reg 0x4f, bit 7.
If we flip that one, we get what the sync processor sees out of the regular hsync / vsync pins :)
This could also be used to pass on the input sync without any retiming.
I don't know if that'd be useful for anything though.

Anyway, this is really good news :)
tedgreen
Posts: 1
Joined: Sat Nov 25, 2017 5:09 pm

Re: GBS 8200/8220 CFW Project

Post by tedgreen »

Great work Rama. It's nice to see that someone is advancing on getting better settings for the GBS8220.

One thing I did notice is that the built-in I2C module of the arduino is not being used. Using the built-in i2c wire library would be more stable and allow changing the i2c frequency to 400 kHz for faster programming.
I have submitted a pull request showing the changes necessary to use the arduino i2c library. I will let you decide if you want to use it.

The only drawback is that it uses pins A4 (SDA) and A5 (SCL) which is different from the original mappings.

Cheers,
Ted
Last edited by tedgreen on Sun Nov 26, 2017 10:47 pm, edited 1 time in total.
falz
Posts: 22
Joined: Sat Nov 19, 2016 10:39 pm

Re: GBS 8200/8220 CFW Project

Post by falz »

FWIW I tested that patch on my already hacked up code and it seems to work fine. If this gets used, does this mean possibly going back to loading the full settings array of or sticking with the writeProgramArrayNew() style?
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

Yep, and thanks for contributing!

I did specify pin mappings just today but I made sure to mention it could still change.
The extra speed and portability benefits are reason enough for me.

We've just got to iron out a few quirks.
I don't think the initial 5V are even reaching the 5275 pins but I'll do some extra tests on that.
The other thing is that the library uses quite a bit of RAM. Hopefully this can be addressed in the sketch.

If not, I can make do as well.
There's about 450kB out of 2048kB left with the new library. Much of the RAM is my debug strings anyway :)

@falz:
Make sure you add the code discussed in the pr, if you use a 5V powered Arduino.
There are no changes necessary to the rest of the sketch, as far as I've seen so far.
It's a drop in replacement, just way faster.
rama
Posts: 1373
Joined: Wed Mar 08, 2017 3:15 pm

Re: GBS 8200/8220 CFW Project

Post by rama »

I checked the 5V behaviour on Wire.begin() with the scope to determine if it was safe to use.

With no load connected, there is a 5V blip for 0.1ms, going down to to 3.3V in 0.2ms.
With the wires connected, there's nothing anymore.
The weak pull-ups in the Arduino can't produce enough potential in those 0.2ms.
Safe! :)
sirlemonhead
Posts: 2
Joined: Wed Dec 06, 2017 8:26 pm

Re: GBS 8200/8220 CFW Project

Post by sirlemonhead »

Any chance you could get the scart wiring instructions done soon?

Is there anything that needs to go in there such as resistors etc or is it just straight through wiring?
LackofTrack
Posts: 7
Joined: Thu Dec 07, 2017 5:07 am

Re: GBS 8200/8220 CFW Project

Post by LackofTrack »

Hello! Just wanted to say that this is an incredible project! Thank you Dooklink and Rama for improving the GBS 8200.

Though after setting up the Arduino and following Rama's guide I notice the GBS outputs at 1280x1024.

Anyway you could put a preset for 640x480 output to allow people to have scanlines?
User avatar
SCARTicus
Posts: 189
Joined: Wed Apr 05, 2017 4:51 pm
Location: TX

Re: GBS 8200/8220 CFW Project

Post by SCARTicus »

I finally got the time to get put this thing together. I'm using an HD 9800 V5.0 board with a Sparkfun Redboard. I have V-Sync connected to pin 10 digital on the redboard and to the V-Sync pin on on the extra VGA header. I am grounded to the contact between the sda scl contacts (mine didn't have a pin header, just points). I have been testing this on my 21 inch Diamondtron PC-CRT. I am using a SyncStrike to connect my 64, PSOne, and Genesis2 to the scaler's de15 input.

So far this is very impressive. I first started it up with my RGB N64 connected and Mario Kart playing. I got a rolling, but colorful image. Then I hit the reset button on my redboard and the screen went black for a few seconds before coming back normal. At this point it looked really good, but a bit too dark. I had my monitor's brightness at 85% and contrast at 100%. It looks really good as a PC monitor at these settings, and I didn't want to turn the brightness to maximum because I heard that it will greatly reduce the life of a CRT display. So, I went ahead and turned my brightness all the way up and then it looked almost perfect, but still a bit too dark. Colors were vivid and just beautiful. I tested Mario64 and Mischief Makers as well. They both looked great, but dark. Genesis looked nice as well. The only issue that noticed was some screen tearing in Sonic and Knuckles, which I stopped noticing after I disconnected the V-Sync line from my redboard. I do not know if the two are related, or if the issue even really did cease. It seamed to.


My PSOne plays cdrs so I have a large selection of games to test. If anyone wants a certain game tested, let me know and I'll do it. Sonic Wings Special is a game that I was eager to test, because it always had trouble with the unmodified GBS scaler. It would drop out of sync once it hit the title menu, although the fmv opening played fine. If you could get the game to start while blind, then you would get an image again at the character select screen onwards. The game never gave me that problem with my Dell LCD which accepts 15k rgbs over de15 (somehow). Anyway, SSS still has that same issue even with Rama's mod. Whatever, the game is still playable.

I also wanted to be sure to test Oddworld: Abe's Exodus. I love this game, and it has some really great visuals. It is a very dark game, however. The stock GBS scalers have really bad black crush that makes this game unplayable. It just becomes a black mess. Not so anymore!. It looks great, although the darkness issue is still a thing here. Very playable.

Metal Slug X and Neo Zanac were both a treat. You can tell that the input lag has been reduced. I could play Rock Man 2 without issue. I'm not sure yet if it is fast enough for fighters. I will have to bust out my Saturn soon and try it.

Every so often, the screen would spaz out for half of a second before returning to normal. I'm not sure what that is all about.

In summation, this thing is truly awesome. It is already a massive upgrade over the stock. I was disappointed to find the output at 1280x1024 (I think. the monitor said 63KHz) because I wanted the sweet natural scanlines that this display produces at 640x480. The darkness issue effected every system and every game. For Rama, I have three questions:


---Is there a way to get 480p output?
---Is the darkness issue my fault somehow? Am I maybe doing something wrong?
---Was any of this helpful to you? I can take pics.

Thank you to all involved. I look forward to future developments.
Post Reply