Shop OBEX P1 Docs P2 Docs Learn Events
VGA anti-aliasing issue — Parallax Forums

VGA anti-aliasing issue

I am working on getting some vga color bars running from the P2. However, I am getting some type of anti-aliasing going on - look at the black transition to gray on the top left or the black to white transition on the middle top. Those transitions should be solid – black to gray and black to white, but the first line in the transitions appear to be an off color. Why is this happening?

See below: are these dacmodes causing the issue?
'RJA: dacmodes for P2 VGA
dacmode_s long %0000_0000_000_1011000000000_01_00000_0 'hsync is 123-ohm, 3.3V
dacmode_c long %0000_0000_000_1011100000000_01_00000_0 'R/G/B are 75-ohm, 2.0V

            setcy   ##intensity << 24       'r      set colorspace for rgb
            setci   ##intensity << 16       'g
            setcq   ##intensity << 08       'b
            setcmod #%01_0_000_0            'enable colorspace conversion

            'Need to add cog# into dacmodes
            cogid   x
            shl     x, #8
            or      dacmode_s, x
            or      dacmode_c, x

            'Setup the RGB and HSync smartpins and turn them on      'enable dac modes in pins 0..3
            wrpin   dacmode_s,smart1
            drvl    smart1
            'Loop for RGB pins
            rep     @.end,#3
            add     smart1,#1
            wrpin   dacmode_c,smart1
            drvl    smart1
1280 x 960 - 238K

Comments

  • Some monitors, particularly TVs, may have image processing that can cause overshoot. That control is called "sharpness."

    It could also be RF reflections in the cable. I've seen that with VGA cables. The severity will depend on the length and quality of the cable and the impedance mismatch at each end. Given the resolution, frame rate, and cable length it is possible to calculate the number of pixels affected.

    Look carefully at boundaries between color bars. Our eyes are more sensitive to changes in brightness than changes in color. There might be interference on color transitions too that is harder to see.

  • Wuerfel_21Wuerfel_21 Posts: 5,051
    edited 2024-01-11 19:02

    First off, the usual sign tap: Use the symbolic constants for pin configuration (such as P_DAC_75R_2V and P_CHANNEL). No one can sight-read the binary pin modes and it's easy to make mistakes. See the Spin2 manual for the full list of constants.

    Second, the other usual sign tap: Post full, compileable source files.


    As for the actual problem, it's most likely your monitor being oddly configured (does it have a "sharpness" control? Also try phase and clock controls.) or just being bad (many such cases, random LCD monitors are not known for graceful scaling of arbitrary signals). To be certain, try a different source device that uses a similar resolution.

    Also, if using the official Parallax VGA board, make sure all the switches are in "VIDEO" position.


    Also, instead of

                'Setup the RGB and HSync smartpins and turn them on      'enable dac modes in pins 0..3
                wrpin   dacmode_s,smart1
                drvl    smart1
                'Loop for RGB pins
                rep     @.end,#3
                add     smart1,#1
                wrpin   dacmode_c,smart1
                drvl    smart1
    

    you can do

                setq    #3
                wrpin   dacmode_c,smart1
                wrpin   dacmode_s,smart1
                setq    #3
                drvl    smart1
    
  • roglohrogloh Posts: 5,786
    edited 2024-01-12 09:54

    Also be sure to not accidentally enable parallel output at the same time as DACs on any overlapping pin ranges. I think I've seen problems with that sort of thing before when that happens and it messed up colours, although it might have been sync related at that time. Your image doesn't exactly look like what I saw.

    Could be VGA cable bandwidth possibly. You might try some high frequency content like text font output instead of solid colour blocks which then could potentially show up somewhat fuzzy if the cable bandwidth was somehow being excessively limited....?

  • RaymanRayman Posts: 14,632

    That is an interesting image…. Does seem like sharpness issue. But who knows …. Posting your code would help figure it out ..

  • pik33pik33 Posts: 2,366

    Looks like monitor artifacts. As said above, check "sharpness". Although I have a cheap monitor that has this "image enhancer" not switchable off and not controllable at all. All high contrast transitions have these outlines there.

  • Thank you guys for your help. I finally figured it out. I was using jumper wires to connect the VGA pins the monitor and the signals were not properly connected to all the GNDs. It looks great now - not only is the artifacts gone, but the colors are the correct hues. Once again, thank you it was your suggestions that got me looking at the wiring/signals

  • RaymanRayman Posts: 14,632
    edited 2024-01-12 20:25

    Glad you got it. Had a suspicion it was wiring, but forgot to post... Think I've seen something like that when there are no ground wires, but it's been a while...

Sign In or Register to comment.