News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

VGA through rpi pico - How many colors possible on border?

Started by gregg, 15:46, 15 April 24

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

roudoudou

@gregg nice work! did you try CRTC³ (there is dirty screen changes with the wasp at the end) or From Scratch (not always 50Hz) ?

it may suggest you some leads to handle frequencies variations

eto

Quote from: gregg on 03:11, 22 July 24I put everything on github: https://github.com/grzegorz-gr/vga4cpc - Gerber files, Kicad project, schematics, BOM, instructions, source code and compiled uf2 file.
I just ordered it... Looking forward to try it out. 

I'll share my experience then.

gregg

@roudoudou
I did not manage to test them. I think CRTC3 is Amstrad Plus only? My scandoubler unfortunately works with cpc palette only. From Scratch does not work on my 6128. It says something about crtc version.

@eto Good luck. Let me know if it works for you or rather what does not work, so I will try to fix it :) . That's a pity you did not let me know before ordering. I have 4 spare PCBs (JLCPCB requires order of minimum 5), so I could send you one. 

eto

Quote from: gregg on 05:02, 29 July 24That's a pity you did not let me know before ordering. I have 4 spare PCBs (JLCPCB requires order of minimum 5), so I could send you one. 


No worries - I need at least 2 and I had to order 5 sets at Digikey anyway as it doesn't make sense to order for less than 50€ from Germany (due to high shipping costs for orders below 50€). And I'm sure I can find some people that are very happy to get on of the remaining sets ;-)

retro space

Can it operate at 50Hz now? My first desire would be to be able to do 80 character mode on a VGA CRT, maybe even with frequency doubling to 100Hz.
If you want to hook up a flatpanel for games, there is an abundance of SCART LCD TV's that already scale up to various resolutions. Or even a Plasma TV. Most cost less than the adapter.
Teaching computer science on a high school with the CPC, P2000T, Spectrum and C64.

gregg

It can operate on something very close to 50.08Mhz. There is a 50.08/60hz switch. 50.08 worked on 2 out of 3 monitors I tried. One was 100% ok, and one has image always shifted to the left, but gets ok after "auto-adjust" in monitor.

eto


for those displays you will usually need a powered Scart cable which will also cost 20€.

And none of the LCD solutions (Tv or scan doubler) that I know  works with games like Relentless. This is the first scan doubler that is capable of that.

retro space

Quote from: eto on 16:48, 29 July 24for those displays you will usually need a powered Scart cable which will also cost 20€.

No need for a powered cable. You can perfectly feed the RGB switch signal from sync.
Teaching computer science on a high school with the CPC, P2000T, Spectrum and C64.

eto

Quote from: retro space on 06:29, 10 August 24No need for a powered cable. You can perfectly feed the RGB switch signal from sync.
Sometimes - but not always.

I tested it with several LCD TV sets and several RGB2HDMI converters and most of them did not work properly with the Sync solution. 

eto

Quote from: gregg on 05:02, 29 July 24@eto Good luck. Let me know if it works for you or rather what does not work, so I will try to fix it :) . That's a pity you did not let me know before ordering. I have 4 spare PCBs (JLCPCB requires order of minimum 5), so I could send you one.



sooo... I finally could give it a try - but no success so far. I don't even get the test pattern, just a a black screen with some green border.

I made 2 attempts (two boards) and no change. Any idea what could go wrong that it doesn't even show the test pattern? Based on the green border I would say it creates a signal...

gregg

Quote from: eto on 17:46, 28 October 24
Quote from: gregg on 05:02, 29 July 24@eto Good luck. Let me know if it works for you or rather what does not work, so I will try to fix it :) . That's a pity you did not let me know before ordering. I have 4 spare PCBs (JLCPCB requires order of minimum 5), so I could send you one.



sooo... I finally could give it a try - but no success so far. I don't even get the test pattern, just a a black screen with some green border.

I made 2 attempts (two boards) and no change. Any idea what could go wrong that it doesn't even show the test pattern? Based on the green border I would say it creates a signal...

Yep. It clearly creates signal. Actually creating test screen should be extremely simple, so I believe it must be something simple. As you said there must be some signal. Can you check in your monitor what resolution and frequency it detects? At least we would know that both sync signals are OK.

One hint that comes to my mind is that that green pattern is possibly in a place where there should be a horizontal sync. So let's go through the color signals. We should have something like (if it would work well):
r,g and b have varialbe values over whole line, then go to 0 during HSYNC
HSYNC is 0 during the line, then goes to +5v during HSYNC (I think I ended up with positive voltage meaning sync)

Here it looks more like r and b stay 0 all the time and green behaves like hsync should.

hmmm.... isn't it something simple like VGA socket being upside down?

Other option... do you use original RPI Pico? Maybe some other board with different pinout?
 

gregg

@eto Could you post a photo of your board? I would compare it with my one. Maybe I messed up something in design, or rather made something misleading.

eto

Quote from: gregg on 18:03, 28 October 24Can you check in your monitor what resolution and frequency it detects? At least we would know that both sync signals are OK.
I get 800x600x60Hz and 720x576x50Hz

The 50Hz screen is completely black, on the 60Hz screen I get the green borders.

Quote from: gregg on 18:03, 28 October 24do you use original RPI Pico?
yes. original Pico


Quote from: gregg on 18:06, 28 October 24or rather made something misleading.

See photo attached. (btw: the orientation of the comparators is misleading as they are upside down - but no indication on the board that this is the case. I killed one board because of that - not a big deal as I had enough stuff but maybe you can add that information to your repository).


gregg

@eto I suspect one more thing. In earlier versions I had vga sync signals exactly where green signal is now. I could mess up something and e.g. upload older version of uf2 to github. I will try to find some time today afternoon or in the worst case tomorrow to check it. I will just use current uf2 from github and confirm it works on my board.

gregg

@eto Just updates uf2 file on github. As suspected there was a wrong one. Could you try it?

As for comparators, Kicad should put a longer while line next to pin 1. I it not so well visible, maybe I should change it. Is there that line? Or is it upside down?

eto

Quote from: gregg on 19:57, 28 October 24put a longer while line next to pin 1. I it not so well visible
yes it is there but at least to me it was not clear that this means pin 1. Never saw it like that.

also the label for the IC is in the other direction. I guess a note in the instructions would be good enough.

Quote from: gregg on 19:57, 28 October 24Just updates uf2 file on github. As suspected there was a wrong one. Could you try it?

NICE! now I get a picture. However parts of the screen are not perfectly stable. Usually on the left or on the right side of the screen the text is "wobbling". The pixels get stretched/compressed and yellow pixels even shortly appear green. When it's unstable on the left side, it's perfect on the right side - and vice versa.

short video showing the boot screen (in this case it was in the middle, not left or right):
https://www.dropbox.com/scl/fi/2zog66buxzeslm2argv1i/picovga.mp4?rlkey=55pd6ppuk1cptps1q623q2hu9&dl=0

edit: 2 different monitors, same effect, both 50 and 60Hz






eto

I just tried with a few games and I recognized that the colours are not correct.

dark red (3) and darg green (9) appear as black, bright red (6) looks like dark red normally and bright green like dark green.

dark blue (1) and light blue(2) are okay.

Also many colours are identical (probably due to the dark red/green part being black).

gregg

@eto As for incorrect colors - does palette on top of test screen look ok, or do you have the same effect? This way we understand if the issue is on output to vga or input from Amstrad. Each color is encoded on 2 bits (both input and output). Dark red would be 01/10, and full red 11. You instead clearly get 00 instead of 01/10 and 01/10 instead of 11. That means one of the output pins is wrong and always set to 0, or on input one of the comparators returns 0 when it should be 1.
The other problem is a big more scary. It looks like it is reading the input value on the border between pixels, so sometimes it has one value and sometimes the other. I will try to play with a couple parameters in the code and prepare a couple of software versions for you. What Amstrad do you have? I was testing it only on my spanish cpc128, maybe there are some differences in input timings?

gregg

And overall any of the issues you mentioned happens in games only or also on test screen? If test screen is OK, then at least we know that the problem is input.

eto

aaaa.. Sorry. My bad. I had 2 bad connections between the comparators and the Pico. After I recognized and fixed it, the colours are perfect.

I have a German 6128. The jitter sometimes doesn't exist at all - and sometimes it's clearly visible. It also seems that it gets better after some time. I also did a quick test on a 464 and there was no jitter at all. So it could just be related to my 6128. I'll test some more CPCs and let you know if it's just the one that has an issue. No need to do anything now.

I already tested Relentless and it plays perfectly with this adapter. Really impressive. Thanks a lot for sharing everything.

gregg

@eto and BTW - thanks a lot for testing it. That was extremely valuable. So at this point we can say it works except that jitter on one of your Amstrads? I think it is something that I should make code more resilient to.
Let me know about any other issue you catch. Especially that some of those things may be just something I did not test yet and there will be a simple solution for them.

eto

Sure, I hope I find some time to test it more thorougly and will give feedback.

A few things I already recognized:

  • It sometimes doesn't properly initialise and the picture shows one line followed by a black line. A quick reset solves the issue. I'll take a picture next time it happens.
  • When I turn off the CPC but not the scan doubler the last screen state is still shown. Would it be possible to recognize this and show a black screen?

  • The mounting holes on the PCB are not properly aligned.

Btw: any chance to add scanlines? Sure, not everybody likes them, but if it_s possible it would be great to have it as an optional feature.

eto

Here's a little case I made. I also added a power connector so I can connect the 5V to the vga4cpc, which powers the Pico and the CPC, so no need for an additional USB power supply. Also the switch turns off the CPC and the Pico together.

I need to do some minor adjustments and will provide the STL file then.

eto


gregg

Yep. I had test screen appearing on power off after a second in earlier version but it was causing some issues, so I switched it off and did not fix yet.
I also noticed that weird screen on CPC start that reset fixes. That is some more serious issue, looks like some race condition but I did not manage to found yet why it happens. I will keep looking.
Thanks for noticing the issue with mounting holes. That should be easy to fix.

Scanlines should be easy to add... instead of doubling each row I would just put every second row black?

The case looks awesome! It that case 3d printed? Is there a chance you would share the design?

Powered by SMFPacks Menu Editor Mod