so that was a long break, but when COVID hits your son's daycare suddenly all free time evaporates. At least no one in my family got sick
Last report was on write problems to the DIMM. I could solve that issue by converting to CPU R/W line into a 20ns pulse, so that writes happen only during a short period of the complete 6502 write cycle. That solved all issues, and I could program the memory to generate all SYNC signals correctly. Unfortunately .... when I hooked up to the monitor it would not synchronize. The reason was simple. The monitor did not recognize the 640x400 resolution I had programmed, but tried instead to go to 720x400.
At that point my plan to be able to switch between various resolutions vaporized. Looks like modern LCD monitors are not truly multisync, but have a number of fixed frequencies programmed in. I have to stick to standard VGA, and with that in mind using a programmable memory did not make sense anymore. So I decided to do SYNC generation with 2 more GALs and 2 74LS00:
Attachment:
New VSYNC generation.jpg [ 189.42 KiB | Viewed 1012 times ]
The code for HSYNC GAL:
Code:
Name hsync_v05;
PartNo 00 ;
Date 1/7/2021 ;
Revision 01 ;
Designer Engineer ;
Company private ;
Assembly None ;
Location ;
Device g22v10 ;
Pin 1 = clk; /* Clock input */
Pin 2 = A0;
Pin 3 = A1;
Pin 4 = A2;
Pin 5 = A3;
Pin 6 = A4;
Pin 7 = A5;
Pin 8 = A6;
Pin 9 = A7;
Pin 10 = A8;
Pin 11 = A9;
/** Outputs ***********************************************************/
PIN 19 = COUNT_Y;
PIN 20 = LINE_DATA;
PIN 21 = !HSYNC;
PIN 14 = LINE_DATA_ON;
PIN 15 = LINE_DATA_OFF;
PIN 16 = HSYNC_ON;
PIN 17 = HSYNC_OFF;
/*
000 0000000000
.....
256 0100000000
...
512 1000000000 !A9 #
512 1000000001 A9 & !A8 &!A7
...
639 1001111111 ----
640 1010000000 no signal
....
655 1010001111 -----
.... L1: A9 & !A8 & A7 & !A6 & A4
.... L2: # A9 & !A8 & A7 & A6 & !A5 & A4
... L3: # A9 & !A8 & A7 & A6 & !A4
... L4: # A9 & !A8 & A7 & A5 & !A4
656 101 001 0000 L1
010 L4
011 L1
100 L3
101 L2
751 101 110 1111 L3 -----
752 101 111 0000 no signal
...
800 1100100000
*/
HSYNC = A9 & !A8 & A7 & !A6 & A4
# A9 & !A8 & A7 & A6 & !A5 & A4
# A9 & !A8 & A7 & A6 & !A4
# A9 & !A8 & A7 & A5 & !A4 ;
LINE_DATA = !A9
#A9 & !A8 & !A7 ;
LINE_DATA_ON = !A9 & !A8 & !A7 & !A6 & !A5 & !A4 & !A3 & !A2 & !A1 & !A0
# A9 & A8 & A5;
LINE_DATA_OFF = A9 & !A8 & A7 & !A6 & !A5 & !A4 & !A3 & !A2 & !A1 & !A0;
HSYNC_ON = A9 & !A8 & A7 & !A6 & !A5 & A4 & !A3 & !A2 & !A1 & !A0;
HSYNC_OFF = A9 & !A8 & A7 & A6 & A5 & A4 & !A3 & !A2 & !A1 & !A0;
COUNT_Y = A9 & A8 & A5;
The code for VSYNC GAL
Code:
Name vsync_v06;
PartNo 00 ;
Date 1/7/2021 ;
Revision 01 ;
Designer Engineer ;
Company private ;
Assembly None ;
Location ;
Device g22v10 ;
Pin 1 = clk; /* Clock input */
Pin 2 = A0;
Pin 3 = A1;
Pin 4 = A2;
Pin 5 = A3;
Pin 6 = A4;
Pin 7 = A5;
Pin 8 = A6;
Pin 9 = A7;
Pin 10 = A8;
Pin 11 = A9;
Pin 18 = VERT_DATA_IN;
Pin 23 = LINE_DATA_IN;
/** Outputs ***********************************************************/
PIN 19 = RESET_Y ;
PIN 20 = VERT_DATA ;
PIN 21 = !VSYNC ;
PIN 14 = VERT_DATA_ON ;
PIN 15 = VERT_DATA_OFF ;
PIN 16 = VSYNC_ON ;
PIN 17 = VSYNC_OFF ;
Pin 22 = BLANK ;
/*
0 0000000000
.....
255 0011111111
256 0100000000
257 0100000001
.....
478 0111011110
479 011 101 1111 xxx
!A8
# !A9 & A8 & !A7
# !A9 & A8 & A7 & !A6
# !A9 & A8 & A7 & A6 & !A5
480 011 110 0000
481 0111100001
482 0111100010
483 0111100011
484 0111100100
485 0111100101
486 0111100110
487 0111100111
488 0111101000
489 0111101001 xxxx
490 011 110 1010
!A9 & A8 & A7 & A6 & A5 & !A4 & A3 & !A2 & A1 & !A0
# !A9 & A8 & A7 & A6 & A5 & !A4 & A3 & !A2 & A1 & A0;
491 011 110 1011 xxxx
492 011 110 1100
.....
523 1000001011
524 1000001100 xxxx
525 1000001101
*/
VERT_DATA = !A9 & !A8
# !A9 & A8 & !A7
# !A9 & A8 & A7 & !A6
# !A9 & A8 & A7 & A6 & !A5;
VSYNC = !A9 & A8 & A7 & A6 & A5 & !A4 & A3 & !A2 & A1 & !A0
# !A9 & A8 & A7 & A6 & A5 & !A4 & A3 & !A2 & A1 & A0;
RESET_Y = A9 & A3 & A2 & A1;
VERT_DATA_ON = !A9 & !A8 & !A7 & !A6 & !A5 & !A4 & !A3 & !A2 & !A1 & !A0;
VERT_DATA_OFF = !A9 & A8 & A7 & A6 & A5 & !A4 & !A3 & !A2 & !A1 & !A0;
VSYNC_ON = !A9 & A8 & A7 & A6 & A5 & !A4 & A3 & !A2 & A1 & !A0;
VSYNC_OFF = !A9 & A8 & A7 & A6 & A5 & !A4 & A3 & A2 & !A1 & !A0;
BLANK = VERT_DATA_IN & LINE_DATA_IN;
Originally I tried to implement the logic as state machine. Although it worked well in simulation, in real life I could not get it to work, so I settled for this simpler approach which worked pretty well. One more issue bugged me - I saw two horizontal areas on the screen that were considerably darker slowly moving up or down (depending on exact timing used). I tried for almost 2 weeks to figure out why the picture was not stable.
Until I realized that the behavior was very much akin to an acoustic beat
https://en.wikipedia.org/wiki/Beat_(acoustics) between the nearly 60Hz picture frequency and 60Hz power. Replacing the power supply with a battery and the error was gone
Attachment:
IMG_0942.jpg [ 101.07 KiB | Viewed 1012 times ]