diff --git a/ubb-vga/README b/ubb-vga/README index f025e20..7b79506 100644 --- a/ubb-vga/README +++ b/ubb-vga/README @@ -48,6 +48,8 @@ Mode Monitor Image Hor. noise Cleanliness W2243C y y 2-4 large very distorted W2243L y y 2-3 large very distorted +640x480/61 XEN-1510T y y 1 -/10, 20% very good/distorted (5) + 640x480/70 XEN-1510T y (2) 1 10, 25% distorted, flickery LN32R71B n - "not supported mode" 206NW y (2) 3-8 - very jittery @@ -115,6 +117,8 @@ that the screen content cannot be recognized. manually. (4) Places the image too far to the left. Cannot be sufficiently corrected. +(5) about 70% of all session have a clean stable image. The remaining + 30% suffer significant FIFO noise. To do diff --git a/ubb-vga/ubb-vga.c b/ubb-vga/ubb-vga.c index 48c0f8e..882e5b8 100644 --- a/ubb-vga/ubb-vga.c +++ b/ubb-vga/ubb-vga.c @@ -51,8 +51,9 @@ static int bad; static const struct mode mode_db[] = { /* name xres yres clkdiv vfront hsync hback htotal */ /* vsync vback */ -{ "640x480", 640, 480, 12, 2, 32, 14, US(2.80), US(1.3), US(32.1) }, +{ "640x480", 640, 480, 12, 2, 32, 14, US(2.80), US(1.30), US(32.1) }, { "640x480/58", 640, 480, 12, 2, 10, 33, US(3.81), US(1.91), US(32.7) }, +{ "640x480/61", 640, 480, 11, 2, 9, 29, US(2.50), US(4.06), US(31.5) }, { "640x480/70", 640, 480, 9, 2, 8, 29, US(1.90), US(2.06), US(24.8) }, { "800x600/54", 800, 600, 8, 2, 32, 14, US(4.81), US(0.79), US(28.8) }, @@ -109,6 +110,8 @@ static const struct mode mode_db[] = { const struct mode *mode = mode_db; +static uint32_t clkrt = 0; + /* ----- I/O pin assignment ------------------------------------------------ */ @@ -265,7 +268,10 @@ static void setup(void) MSCCDR = mode->clkdiv; /* set the MSC clock to 336 MHz / 12 = 28 MHz */ CLKGR &= ~(1 << 7); /* enable MSC clock */ - MSC_CLKRT = 0; /* bus clock = MSC clock / 1 */ + while (MSCCDR & 1) { + MSCCDR >>= 1; + clkrt++; + } } @@ -307,6 +313,7 @@ static void line(unsigned long line) /* HSYNC */ PDDATC = HSYNC; + MSC_CLKRT = clkrt; /* bus clock = MSC clock / n */ MSC_STRPCL = 2; /* start MMC clock output */ MSC_RESTO = 0xffff; @@ -500,6 +507,10 @@ int main(int argc, char *const *argv) session(gen, frames); cleanup(); +#if 0 + printf("clkdiv: %d, /%d /%d\n", mode->clkdiv, + (MSCCDR & 15)+1, 1 << (MSC_CLKRT & 7)); +#endif if (bad) printf("%d timeout%s\n", bad, bad == 1 ? "" : "s"); return 0;