P2 VGA question
Cluso99
Posts: 18,069
in Propeller 2
I've been looking at the VGA code again.
I cannot see how HSYNC is created???
Chips sample VGA code does not make reference to a pin used for hsync. Pin 0 is used for VSYNC.
For my VGA code, I looked as Ozprops code which has HSYNC on Pin 0 and VSYNC on pin 4. I can see VSYNC being created just fine for each frame.
Am I right to think that VGA does not require HSYNC and that it is indeed syncing on the RBG data? If so, I presume I can tie the HSYNC to the monitor to GND? Obviously I can test this out, but I just want to be sure this can be done, and I'm not missing something.
I cannot see how HSYNC is created???
Chips sample VGA code does not make reference to a pin used for hsync. Pin 0 is used for VSYNC.
For my VGA code, I looked as Ozprops code which has HSYNC on Pin 0 and VSYNC on pin 4. I can see VSYNC being created just fine for each frame.
Am I right to think that VGA does not require HSYNC and that it is indeed syncing on the RBG data? If so, I presume I can tie the HSYNC to the monitor to GND? Obviously I can test this out, but I just want to be sure this can be done, and I'm not missing something.
Comments
8 x COGs
8 x VGA's (4 or 5 pins?)
8 x PS2 keyboards (2 pins)
8 x I/O pins free (1 or 2?)
8 x 64KB Hub RAM
Now I can demo 8 separate programs running on a P2
And I can always combine RGB for mono and save some more general I/o pins.
I have yet to try sync on green
For the P2 Eval VGA board, I think the pinout goes like this:
P0 = HSYNC (use 123-ohm 3.3V mode)
P1 = BLUE (use 75-ohm 2.0V mode)
P2 = GREEN (use 75-ohm 2.0V mode)
P3 = RED (use 75-ohm 2.0V mode)
P4 = VSYNC (use digital mode)
I cannot see where/how HSYNC is being generated. Is it being generated or is the monitor syncing on the RGB?
If so, then I presume we cannot send negative hsync, only positive hsync?
Yes, that's the key instruction, although the #1 means to write $00_00_00_01 to pins 3..0, so 0 to pins 3..1 and 1 to pin 0. That value is also modified by the color space converter (setcmod instruction). I think you can use the CMOD value to achieve negative hsync, or at least to have pin 0 high most of the time and low during hsync. My VGA tile driver tries to achieve that, although I haven't tested it extensively -- I know negative vsync works, my monitor needed it for one mode, but I'm not sure about negative hsync.
Since we enable the DAC pins with WRPIN perhaps it's possible to use the inversion at the pin interface since HSYNC is actually a digital signal ???
If this can be done, then HSYNC & VSYNC could be combined on the one pin, using Low, Tristate, and High and an external pair of XORs to decode the separate HSYNC & VSYNC.
You set HSYNC polarity via a bit in the colorspace converter, like Eric was saying. I'm pretty sure it's all in the Google Doc.
There is a lot in Google doc, but some of it is very - tense - if one can not follow your line of thought behind it, it is not easy to understand.
Documentation really needs some improvement, my guess is that besides @cgracey and @ozpropdev nobody really understand all of this.
But we will get there.
Mike
Just look up the 6 bits, I believe, set by SETCMOD.
Read this. It's verbatim from the doc but I've given it a title and formatted to its own page.
Those docs were my first go-to, and I have been re-reading the sections with each post of this thread.
But as we don't know the physical setup of the silicon, its hard to determine which part overrides which part.
I missed the possible inversion in the colorspace converter. I did see that it might be possible to invert at the pins, but then again, since the output is coming from the dac, perhaps this switches out that section of the smartpin.
The bit I missed (about where hsync comes from) when I first raised the question this morning was the S=#1 on the xzero instruction.
COLOR SPACE CONVERTER
I think if you were to comment out those four lines without any other correction you'd lose hsync output. A sync pulse value would need added as a correction. Something like "v_sn long 255" for positive polarity. And "xzero m_sn,v_sn" as the assembly code change.
EDIT: Heh, or still have it as #255 immediate and use a SETS #0 to change polarity.
EDIT2: Oh no, maybe none of that works. Polarity has to be carried over the whole frame!
The current doc on github (last update 2019/04/11) only lists configuration bits CMOD[6:5] for off/VGA-HDTV/NTSC+SV/NTSC (NTSNTSC/PAL composite)
https://docs.google.com/document/d/1UnelI6fpVPHFISQ9vpLzOVa8oUghxpI6UpkXVsYgBEQ/edit
It's all there, just missing the title and has a page break in the middle. I've posted a single page version above - https://forums.parallax.com/discussion/comment/1473192/#Comment_1473192
EDIT: Err, bugger, CMOD[4] is in the prior page. Definitely could be easier to read all right.
EDIT2: Ah, and CMOD[4] is where the verilog compiler bug got in in the ES chips.
So, because the OUTNOT (DRVNOT) is a direct effect, the edges of vsync are slightly trailing the hsyncs ... and also a whole scanline ahead of the numerical line position.
EDIT: Which might explain why some experiments I did last year didn't quite seem to work out as expected.
Ah yeah you're right
I was thinking back to what we did. I don't think we worried about inverting Hsync, only inverting vsync and setting the v blanking to 8 lines to signal CVT RB2 timing. This worked fine on the monitors we tested.
Are you going for reduced blanking timing Cluso? Or did you want pre-cvt standard VGA with the bigger blanking?
I think it would be possible to invert Hsync by having the idle value preset to output 1 on pin 0 (our current case), and for Hsync, outputting a 0.
What I am looking at is two-fold. First, combine Hsync and Vsync on one pin, being pin 0, since I believe RGB is “fixed” to pins 3,2,1. Second, I would like to see if I can get GreenOnSync to work.
From what I’ve read, I think it’s possible to manually operate pin 0, by not configuring it as a DAC output. I also think it might be possible to just override p0 at the appropriate Vsync time.
If I drove p0 totally manually, then I could use H, L and T/S to reconstruct Hsync and Vsync externally with a pair of XOR gates and 3 10K resistors.
What I am unsure about is how many monitors support GOS (green on sync), and if any support composition sync on the Hsync pin.
Sorry i didn't get that vga breakout to you this week. Will do that this weekend.