The FIFO value is set to the minimum width/height of input/output. So for your RGBS signal it should be 640x233. Please also try to change the display clock, display output timings and the capture window value.
Ok thanks where I'm trying progressively through reading the datasheet, your source file to really understand the key parameters. Some aspects are still not clear for me like how to mathematically link the analog or digital mode measurements versus input frame window and now the LCD display format.
Please remember my testing and learning methodology, I run the OpenRTD firmware connected to either my VGA or RGBs then try to either read some parameters or modify other parameters via my arduino VGA-i2c channel. One of my objective wether image is flickering or not would be to live change the scaling result so the RGBS would not be truncated anymore (bottom and right).
In the meantime, I've now added this reading code to understand the different parameters, maybe you can check if i've done something wrong plus help learn how the values are connected.
My extract updated code
// reads input frame window parameters
Serial.println("******** Input Frame Window ************");
Serial.print("Input Horizontal Active Start => ");Serial.println((ScalerReadByte(0x14) << 8) + ScalerReadByte(0x15),DEC);
Serial.print("Input Horizontal Active Width => ");Serial.println(((ScalerReadByte(0x16) & 0x7) << 8) + ScalerReadByte(0x17),DEC);
Serial.print("Input Vertical Active Start => ");Serial.println(((ScalerReadByte(0x18) & 0x7) << 8) + ScalerReadByte(0x19),DEC);
Serial.print("Input Video Vertical Active Lines => ");Serial.println(((ScalerReadByte(0x1A) & 0x7) << 8) + ScalerReadByte(0x1B),DEC);
Serial.print("Input VSYNC Delay for Capture => ");Serial.println(ScalerReadByte(0x1C),DEC);
Serial.print("Input HSYNC Delay for Capture => ");Serial.println(ScalerReadByte(0x1D),DEC);
Serial.print("Input HS/VS Delay => ");Serial.print(ScalerReadByte(0x1E),HEX);Serial.println("H");
Serial.print("Input Video Horizontal Porch => ");Serial.println(((ScalerReadByte(0x1F) & 0x7) << 8) + ScalerReadByte(0x20),DEC);
Serial.println("****************************************");
Serial.println();
// reads display format parameters (auto-increment is self-activated)
ScalerWriteByte(0x2A,ScalerReadByte(0x2A) & 0xC0);
Serial.println("******** Display format ************");
Serial.print("Display horizontal total pixels => ");Serial.println(((ScalerReadByte(0x2B) & 0xF) << 8) + ScalerReadByte(0x2B),DEC);
Serial.print("Display horizontal sync end => ");Serial.println(ScalerReadByte(0x2B),DEC);
Serial.print("Display horizontal background start => ");Serial.println(((ScalerReadByte(0x2B) & 0xF) << 8) + ScalerReadByte(0x2B),DEC);
Serial.print("Display horizontal active start => ");Serial.println(((ScalerReadByte(0x2B) & 0xF) << 8) + ScalerReadByte(0x2B),DEC);
Serial.print("Display horizontal active end => ");Serial.println(((ScalerReadByte(0x2B) & 0xF) << 8) + ScalerReadByte(0x2B),DEC);
Serial.print("Display horizontal background end => ");Serial.println(((ScalerReadByte(0x2B) & 0xF) << 8) + ScalerReadByte(0x2B),DEC);
Serial.print("Display vertical total lines => ");Serial.println(((ScalerReadByte(0x2B) & 0xF) << 8) + ScalerReadByte(0x2B),DEC);
Serial.print("Display vertical sync end => ");Serial.println((ScalerReadByte(0x2B) & 0x1F),DEC);
Serial.print("Display vertical background start => ");Serial.println(((ScalerReadByte(0x2B) & 0xF) << 8) + ScalerReadByte(0x2B),DEC);
Serial.print("Display vertical active start => ");Serial.println(((ScalerReadByte(0x2B) & 0xF) << 8) + ScalerReadByte(0x2B),DEC);
Serial.print("Display vertical active end => ");Serial.println(((ScalerReadByte(0x2B) & 0xF) << 8) + ScalerReadByte(0x2B),DEC);
Serial.print("Display vertical background end => ");Serial.println(((ScalerReadByte(0x2B) & 0xF) << 8) + ScalerReadByte(0x2B),DEC);
Serial.println("****************************************");
Serial.println();
// FIFO Window parameters
ScalerWriteByte(0x30,0x00);
FIFO_MSB = ScalerReadByte(0x31); // read FIFO 31-00
Serial.print("FIFO: Display window read width before scaling up => ");Serial.println(((FIFO_MSB & 0x30) << 4) + ScalerReadByte(0x31),DEC); // width from FIFO 31-01
Serial.print("FIFO: Display window read length before scaling up => ");Serial.println(((FIFO_MSB & 0x3) << 8) + ScalerReadByte(0x31),DEC); // length from FIFO 31-02
Serial.println();
Globally here are the different values read with VGA input
ISP mode entered - DW8051 reset
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 -> 799
InputMeasData.HSPolarity -> 1
InputMeasData.VSPolarity -> 0
Measure in digital mode
InputMeasData.HTotal -> 1343
InputMeasData.VTotal -> 805
InputMeasData.HSync -> 144
InputMeasData.VSync -> 799
InputMeasData.HSPolarity -> 1
InputMeasData.VSPolarity -> 0
******** Input Frame Window ************
Input Horizontal Active Start => 179
Input Horizontal Active Width => 1024
Input Vertical Active Start => 17
Input Video Vertical Active Lines => 768
Input VSYNC Delay for Capture => 18
Input HSYNC Delay for Capture => 109
Input HS/VS Delay => 0H
Input Video Horizontal Porch => 0
****************************************
******** Display format ************
Display horizontal total pixels => 956
Display horizontal sync end => 16
Display horizontal background start => 32
Display horizontal active start => 32
Display horizontal active end => 832
Display horizontal background end => 832
Display vertical total lines => 567
Display vertical sync end => 3
Display vertical background start => 12
Display vertical active start => 12
Display vertical active end => 492
Display vertical background end => 492
****************************************
For example, I still do not fully understand the mathematical relations between 956 display horizontal pixels, 832 horizontal active end versus active width 1024, HTotal of 1343, the FIFO sizing... ?
Another question: does the scalingup or scalingdown affects all the brute total line or column sizing ?
Thank you