Skip to content

Instantly share code, notes, and snippets.

@retrage
Created May 2, 2020 01:03
Show Gist options
  • Save retrage/f0ea94fff2cb372ed1ab130991500c87 to your computer and use it in GitHub Desktop.
Save retrage/f0ea94fff2cb372ed1ab130991500c87 to your computer and use it in GitHub Desktop.
PCB800099 Resolution Modification

PCB800099 Resolution Modification

1 describes how to modify PCB800099 firmware to change resolution (from 1400x1050 to 480x1280). The source code can be found 2. The data to be modified is structures PanelType 3. Here is the definition. Note that the structure alignment is 1-byte.

typedef struct
{
    UINT8 PanelStyle;                 // Panel Style
    UINT8 PanelConfig;                // Panel Configuration

    UINT16 DHStartPos;                // Display Horizontal Start Position
    UINT16 DHWidth;                   // Display Horizontal Width

    UINT16 DHTotal;                   // Display Horizontal Total Clock Number in One Display Line
    UINT16 PalDHTotal;                // Display Horizontal Total Clock Number in One Display Line for CVBS PAL
    UINT16 NtscDHTotal;               // Display Horizontal Total Clock Number in One Display Line for CVBS NTSC

    UINT16 DVStartPos;                // Display Vertical Start Position
    UINT16 DVHeight;                  // Display Vertical Height

    UINT16 DVTotal;                   // Display Vertical Total Line Number in One Frame

    UINT8 DHSyncWidth;                // Display H Sync Width
    UINT8 DVSyncHeight;               // Display V Sync Height

    UINT16 PixelClock;                // Typical Pixel Clock in MHz

    UINT16 HSyncMaxFreq;              // H Sync Max Freq Unit in 0.1 kHZ
    UINT16 HSyncMinFreq;              // H Sync Min Freq Unit in 0.1 kHZ
    UINT16 VSyncMaxFreq;              // V Sync Max Freq Unit in 0.1 HZ
    UINT16 VSyncMinFreq;              // V Sync Min Freq Unit in 0.1 HZ

    UINT8 TTL20;

} PanelType;

It can be used like 3:

//--------------------------------------------------
//1280x800
code PanelType Panel2 =
{
	// Panel Style
    _PANEL_LVDS |		//_PANEL_TTL,_PANEL_HZ,_PANEL_LVDS,_PANEL_RSDS
    //_AUTOCALC_PIXCLK |
    _LVDS_MAP2 |		//_LVDS_MAP1,_LVDS_MAP2
    _DISP_18_BIT | 		//_DISP_24_BIT,_DISP_18_BIT
    //_RSDS_GC_SWAP |
    //_RSDS_HL_SWAP |
    //_RSDS_PN_SWAP |
    0x00,                            

	// Panel Configuration
	//_DHS_MASK |
	//_DISP_EO_SWAP |
	//_DISP_RB_SWAP |
	//_DISP_ML_SWAP |
	_DISP_SINGLE_PORT |	//_DISP_SINGLE_PORT,_DISP_DOUBLE_PORT
	//_DVS_INVERT |
	//_DHS_INVERT |
	//_DEN_INVERT |
	0x00,


	32,         // Display Horizontal Start Position
	1280,       // Display Horizontal Width

	1652,       // Display Horizontal Total Clock Number in One Display Line

	1652,       // Display Horizontal Total Clock Number in One Display Line for CVBS PAL
	1652,       // Display Horizontal Total Clock Number in One Display Line for CVBS NTSC

	12,         // Display Vertical Start Position
	800,       // Display Vertical Height

	952,       // Display Vertical Total Line Number in One Frame

	16,         // Display H Sync Width
	3,          // Display V Sync Height

	75,          // Typical Pixel Clock in MHz

	1100,		// H Sync Max Freq Unit in 0.1 kHZ
	100,		// H Sync Min Freq Unit in 0.1 kHZ
	880,		// V Sync Max Freq Unit in 0.1 HZ
	490,		// V Sync Min Freq Unit in 0.1 HZ

    // TTL setting   
    //(2 << 4) |  // Delay
    //(1 << 1) |  // DCLK output enable
    0x00,         // DCLK Polarity

};

1280x800

Following is the hex dump of the struct data for 1280x800 in FLSHSAVEORIJIN.BIN (from 0x1020 to 0x103e).

00001020  12 00 00 20 05 00 06 1e  06 1e 06 1e 00 0f 03 20  |... ........... |
00001030  03 98 10 06 00 5f 04 4c  00 64 02 f8 01 ea 00 ff  |....._.L.d......|

It is extracted as:

typedef struct
{
    UINT8 PanelStyle;                 // 12
    UINT8 PanelConfig;                // 00

    UINT16 DHStartPos;                // 00 20
    UINT16 DHWidth;                   // 05 00

    UINT16 DHTotal;                   // 06 1e
    UINT16 PalDHTotal;                // 06 1e
    UINT16 NtscDHTotal;               // 06 1e

    UINT16 DVStartPos;                // 00 0f
    UINT16 DVHeight;                  // 03 20

    UINT16 DVTotal;                   // 03 98

    UINT8 DHSyncWidth;                // 10
    UINT8 DVSyncHeight;               // 06

    UINT16 PixelClock;                // 00 5f

    UINT16 HSyncMaxFreq;              // 04 4c
    UINT16 HSyncMinFreq;              // 00 64
    UINT16 VSyncMaxFreq;              // 02 f8
    UINT16 VSyncMinFreq;              // 01 ea

    UINT8 TTL20;                      // 00

} PanelType;

1336x768

Below is the data for 1336x768 in PCB800661-LVDS1366X768-D6BIT.BIN (from 0x1025 to 0x1043).

00001020  02 0f 83 d3 22 12 00 00  20 05 56 06 18 06 18 06  |...."... .V.....|
00001030  18 00 10 03 00 03 34 10  03 00 4b 04 4c 00 64 02  |......4...K.L.d.|
00001040  f8 01 ea 00 ff 10 25 00  ff ff ff ff ff ff 00 12  |......%.........|
typedef struct
{
    UINT8 PanelStyle;                 // 12
    UINT8 PanelConfig;                // 00

    UINT16 DHStartPos;                // 00 20
    UINT16 DHWidth;                   // 05 56

    UINT16 DHTotal;                   // 06 18
    UINT16 PalDHTotal;                // 06 18
    UINT16 NtscDHTotal;               // 06 18

    UINT16 DVStartPos;                // 00 10
    UINT16 DVHeight;                  // 03 00

    UINT16 DVTotal;                   // 03 34

    UINT8 DHSyncWidth;                // 10
    UINT8 DVSyncHeight;               // 03

    UINT16 PixelClock;                // 00 4b

    UINT16 HSyncMaxFreq;              // 04 4c
    UINT16 HSyncMinFreq;              // 00 64
    UINT16 VSyncMaxFreq;              // 02 f8
    UINT16 VSyncMinFreq;              // 01 ea

    UINT8 TTL20;                      // 00

} PanelType;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment