Hello again, here is a status where I'm in this project and learning path.
First I'm following teh guidelines from KERJOE in
this post, in particular these different steps
Here's a rundown of the VGA setup sequence:
- Write EDID information into the memory and enable acces to it on I2C.
- Setup GPIO mode for display power, mirroring, backlight. Then set GPIO state to enable them.
- Reset and power on all scaler submodules.
- Write LCD panel timings, select TTL/LVDS mode and power up the output.
- Set the LCD panel output frequency such, that the horizontal frequency of input and output video signals match.
- Setup capture window to input resolution, setup FIFO window to either input or output resolution whichever is less.
- Setup and power up one of the analog component video channels.
- Set its sampling frequency to the pixel clock of the incomming signal.
- If you dont want the picture to overflow the screen or display only on a part of it, you need to scale up the picture. Write the filter coeficients to the scaling registers and either scale up and/or down for both width and height.
Since my actual RTD2660 board is loaded with OpenRTD2662 russian firmware, what I do systematically is boot the board without any video signal input (VGA or RGBs interlaced). For the moment, there is no need to learn or write source for steps 2, 3, 4 and 5 because it seems automatically filled wether video signal is present or not.
As for step 1, unless I'm wrong my small LCD's do not have any EDID information to be read from.
Second I've now stable arduino sketch able to comand RTD2260 to self-detect presence of any video signal, to self-detect what type of sync signal (separate Hsync and Vsync, composite sync) then if VGA or RGBs interlaced connected, to run an ANALOG measurement to estimate period of total Horizontal line, what Hsync and Vsync frequencies, polarities. See after my Serial Monitor recording of 4 cases (no input, RGBS, no input and VGA).
ISP mode entered - DW8051 reset
No Input
ISP mode entered - DW8051 reset
No Input
ISP mode entered - DW8051 reset
No Input
ISP mode entered - DW8051 reset
Signal present
Stable Hysnc period => 1705
HSync type detection auto run => 101
RGBS input
Measure in analog mode
InputMeasData.HFreq -> 15835
InputMeasData.VFreq -> 61
InputMeasData.HTotal -> 1705
InputMeasData.VTotal -> 258
InputMeasData.HSync -> 176
InputMeasData.VSync -> 0
InputMeasData.HSPolarity -> 1
InputMeasData.VSPolarity -> 1
ISP mode entered - DW8051 reset
No Input
ISP mode entered - DW8051 reset
No Input
ISP mode entered - DW8051 reset
No Input
ISP mode entered - DW8051 reset
No Input
ISP mode entered - DW8051 reset
No Input
ISP mode entered - DW8051 reset
Signal present
Stable Hysnc period => 559
HSync type detection auto run => 110
VGA input
Measure in analog mode
InputMeasData.HFreq -> 48387
InputMeasData.VFreq -> 60
InputMeasData.HTotal -> 558
InputMeasData.VTotal -> 805
InputMeasData.HSync -> 60
InputMeasData.VSync -> 800
InputMeasData.HSPolarity -> 1
InputMeasData.VSPolarity -> 0
Third I've finally understood why the measuresignal() routine of KERJOE does not work right away with DIGITAL mode, see details of the issue
here. In particular why
Something I need help and explanation, the only way I can get the measuresignal() routine to work is by forcing to ZERO bit 7 of register MEAS_HSYNC_PERIOD_HI otherwise it will never properly write ONE to bit 5. The reason seems that KERJOE code only worked for HDMI offering an input CLOCK whereas both with VGA or RGBs, there is no signal pixel clock.
This is why from now on in my case, I can only have good measurement in ANALOG mode with part of KERJOE source code.
Now my idea is that after all,
I do know the pixel clock value inside the Advantest video section, it is 20 MHz. So I just need to understand or learn how to properly set in the RTD2660 the signal capture PLL centered around 20 MHz to track its jitter then fill correctly the input frame values after crunching the analog values.
Next will be to understand how to properly set the panel PLL clock then sync it with input PLL to match input pixel rate versus output pixel rate once rescaling is done.
If any of you knows how to help code the different registers for the input capture PLL and the output panel PLL, it would be much appreciated.
Albert