|
Post by molebrain on Feb 15, 2021 16:21:03 GMT
I'm at odds on where to post this question, but I've recently bought a MCE2VGA FPGA device from Serdashop ( MCE2VGA) and I'm having some problems with it. The screen is a bit wavy, as you can see here: youtu.be/7w1KQ1Q0zYsI thought maybe there was some radio interference or something, but after talking briefly to the programmer, he says it is more than likely a pixel clock issue. He says: "The pixel clock of the C128 is not exactly 14.3181Mhz like the CGA does. So you need to find out the exact pixel clock and multiply by 8 and change the PLL settings. See 50Mhz * 126 / 55 = 114.5454545 Mhz = 14.31818182 Mhz * 8. This device is pretty dependent on the pixel clock."
I am NOT a FPGA expert at all, but i was able to open up the code (downloaded from here: github.com/lfantoniosi/mce2vga/tree/vga-common-res). Using Quartus, I can see that I can change the pixel clocks from the PLL section of the schematic diagram: tokra I found a thread about VDC timing from you that I thought would be helpful: c-128.freeforums.net/thread/439/high-resolution-method?fbclid=IwAR1aev_UYFg6G4xK9K7YCb0vW0VMf_JEek1Sd2ynikWbu_mvf9Ld6so5s98But I am not sure if this will help me, nor do I understand what values I should plug into this clock settings on the FPGA. Any help from anybody would be greatly appreciated. -Tony
|
|
|
Post by tokra on Feb 15, 2021 19:46:58 GMT
Honestly I have no idea what the parameters above in the graphic actually mean. The C128's VGA should be on a 16 Mhz-pixel-clock. Are you using a PAL or NTSC C128? I'm asking because later ROM-revisions had optimized parameters for the PAL VDC that make it a more compatible with TV-output. Commodore was aiming for TV-compatibility obviously.
You can type (after turning of the machine): SYS DEC("CDDA"),,4:RREGA:PRINT A
If you get 39 you have an old PAL-ROM, if you get 38 you have a new PAL-ROM and if you get 32 you have an NTSC-ROM.
If you have the older PAL-ROM you could try to enter this to get the more compatible VDC-setup and see if that changes the output:
SYSDEC("CDCC"),127,0:SYSDEC("CDCC"),38,4
|
|
|
Post by molebrain on Feb 15, 2021 19:57:59 GMT
Thanks for responding! I am using NTSC model. I figured I'd ask if you or anybody could make heads or tails of it hehe. I'll keep poking around.
|
|
|
Post by oziphantom on Feb 16, 2021 3:56:53 GMT
Basically you need to solve this equation 50 * X / Y = 128 ( for a dead on 16Mhz clock if that is what we need)
Then you put X where the 16257 is, and you put Y where the 6250 is.
|
|
|
Post by molebrain on Feb 16, 2021 4:07:10 GMT
Basically you need to solve this equation 50 * X / Y = 128 ( for a dead on 16Mhz clock if that is what we need) Then you put X where the 16257 is, and you put Y where the 6250 is. oK! I'm not really good at math. HEHE. Any suggestions?
|
|
|
Post by tokra on Feb 16, 2021 9:35:41 GMT
That would mean X=256 and Y=100 which can be shortened to X=64 and Y=25. So try to enter clock multiplication factor 256 and clock division factor 100 and see what happens. If everything goes up in smoke don't blame me :-)
|
|
|
Post by molebrain on Feb 16, 2021 12:52:36 GMT
That would mean X=256 and Y=100 which can be shortened to X=64 and Y=25. So try to enter clock multiplication factor 256 and clock division factor 100 and see what happens. If everything goes up in smoke don't blame me :-) LOL, I will try this out. Hmm...getting frequency out of range on my monitor. I guess that didn't work. Although it may be user error. I'm not sure if/where all the places I need to change these values. This think has 2 PLLs each with multiple clock parameter sections. I'll have to do a little more research. I did get some information from Bil Herd when I asked him what the exact pixel clock is for the C-128, he said that 8.18mhz is my memory, derived from 14.318mhz. Does this change the equation? Thanks everybody for your help.
|
|
|
Post by tokra on Feb 16, 2021 14:25:32 GMT
Pixel clock for VDC is completely independent from the rest of the system (as far as I know) and Bil Herd had really nothing to do with the VDC.
|
|
|
Post by molebrain on Feb 16, 2021 14:48:58 GMT
Oh wow! I think it is working! I changed the settings of the first PLL2 clk0 and clk3 and there are no waves!!! Screen looks slightly too wide for my screen, but man, it's getting there!!! wooo! THANKS!
|
|
|
Post by goodwell on Apr 3, 2023 15:12:53 GMT
Oh wow! I think it is working! I changed the settings of the first PLL2 clk0 and clk3 and there are no waves!!! Screen looks slightly too wide for my screen, but man, it's getting there!!! wooo! THANKS! Nice! Does this require updating the MCE2VGA firmware? So far, my MCE2VGA is useless to me Thanks!
|
|