How to output resolution other than 1024x768 using VGA board
How to output resolution other than 1024x768 using VGA board
Hi folks,
I just bought a VGA board to display at 1024x768 just fine. My question is, does the board handle any other resolution? If so, how do you programmatically change that resolution? Thanks in advance.
I just bought a VGA board to display at 1024x768 just fine. My question is, does the board handle any other resolution? If so, how do you programmatically change that resolution? Thanks in advance.
Re: How to output resolution other than 1024x768 using VGA board
PS:
I found the following LCD initialization procedure for the VGA card at 1024x768. It initializes the LCD controller registers. What values should I use to drive the VGA card at a different resolution? Merely changing the LCD width and height values does not change the VGA mode.
#define LCD_WIDTH 1024
#define LCD_HEIGHT 768
#define LCD_PIXCLOCK 2
#define LCD_RIGHT_MARGIN 15
#define LCD_LEFT_MARGIN 199
#define LCD_HSYNC_LEN 15
#define LCD_UPPER_MARGIN 1
#define LCD_LOWER_MARGIN 1
#define LCD_VSYNC_LEN 1
#define LCD_CON5 ( (1 << 11)| (1<<0)
#define M5D(n) ((n)&0x1fffff)
#define LCD_ADDR ((U32)LCD_BUFFER)
rLCDCON1 = (LCD_PIXCLOCK << 8) | (3 << 5) | (12 << 1);
rLCDCON2 = (LCD_UPPER_MARGIN << 24) | ((LCD_HEIGHT - 1) << 14) | (LCD_LOWER_MARGIN << 6) | (LCD_VSYNC_LEN << 0);
rLCDCON3 = (LCD_RIGHT_MARGIN << 19) | ((LCD_WIDTH - 1) << 8) | (LCD_LEFT_MARGIN << 0);
rLCDCON4 = (13 << 8) | (LCD_HSYNC_LEN << 0);
#if !defined(LCD_CON5)
# define LCD_CON5 ((1<<11) | (1 << 9) | (1 << 8) | (1 << 3) | (1 << 0))
#endif
rLCDCON5 = LCD_CON5;
I found the following LCD initialization procedure for the VGA card at 1024x768. It initializes the LCD controller registers. What values should I use to drive the VGA card at a different resolution? Merely changing the LCD width and height values does not change the VGA mode.
#define LCD_WIDTH 1024
#define LCD_HEIGHT 768
#define LCD_PIXCLOCK 2
#define LCD_RIGHT_MARGIN 15
#define LCD_LEFT_MARGIN 199
#define LCD_HSYNC_LEN 15
#define LCD_UPPER_MARGIN 1
#define LCD_LOWER_MARGIN 1
#define LCD_VSYNC_LEN 1
#define LCD_CON5 ( (1 << 11)| (1<<0)
#define M5D(n) ((n)&0x1fffff)
#define LCD_ADDR ((U32)LCD_BUFFER)
rLCDCON1 = (LCD_PIXCLOCK << 8) | (3 << 5) | (12 << 1);
rLCDCON2 = (LCD_UPPER_MARGIN << 24) | ((LCD_HEIGHT - 1) << 14) | (LCD_LOWER_MARGIN << 6) | (LCD_VSYNC_LEN << 0);
rLCDCON3 = (LCD_RIGHT_MARGIN << 19) | ((LCD_WIDTH - 1) << 8) | (LCD_LEFT_MARGIN << 0);
rLCDCON4 = (13 << 8) | (LCD_HSYNC_LEN << 0);
#if !defined(LCD_CON5)
# define LCD_CON5 ((1<<11) | (1 << 9) | (1 << 8) | (1 << 3) | (1 << 0))
#endif
rLCDCON5 = LCD_CON5;
Re: How to output resolution other than 1024x768 using VGA board
Linux or win ce?
Re: How to output resolution other than 1024x768 using VGA board
Linux or win-ce? Actually, stand alone...
Re: How to output resolution other than 1024x768 using VGA board
Are you looking at the 'sample code without OS' folder ?
Because the code you posted I cant find anywhere.
Anyways, for the sample code without OS, if you check the lcd.c file it has compile time conditionals for the various lcd's.
Part of those defines are the LCD_XSIZE/LCD_YSIZE and SCR_XSIZE and SCR_YSIZE.
These are what define the resolution in that sample code.
Because the code you posted I cant find anywhere.
Anyways, for the sample code without OS, if you check the lcd.c file it has compile time conditionals for the various lcd's.
Part of those defines are the LCD_XSIZE/LCD_YSIZE and SCR_XSIZE and SCR_YSIZE.
These are what define the resolution in that sample code.
Re: How to output resolution other than 1024x768 using VGA board
Nicolas,
Thanks for the response. Yes, I am using the source files in the code without os folders. However, merely changing the resolution values of the LCD does nothing but simply clip the display to that resolution. For example, I tried 1024x600 (my LCD resolution) and the lower portion of the display was clipped to 600. In other words, the VGA card still was outputting at 1024x768.
I want to be able to display a picture (1024x600) and have it take up the full display.
Someone a while ago asked about some missing dip switches on the board, which perhaps could have been used to set the VGA resolution. He never got an answer, however.
It is ironic that the mini2440 is such an open system, except for this bloody board!
Thanks for the response. Yes, I am using the source files in the code without os folders. However, merely changing the resolution values of the LCD does nothing but simply clip the display to that resolution. For example, I tried 1024x600 (my LCD resolution) and the lower portion of the display was clipped to 600. In other words, the VGA card still was outputting at 1024x768.
I want to be able to display a picture (1024x600) and have it take up the full display.
Someone a while ago asked about some missing dip switches on the board, which perhaps could have been used to set the VGA resolution. He never got an answer, however.
It is ironic that the mini2440 is such an open system, except for this bloody board!
Re: How to output resolution other than 1024x768 using VGA board
When you change those two defines, did you also go thru the lcd.c and change the other drawing code to adjust accordingly ?
For example,
If you didnt make a new LCD_TYPE or adjust the code, then it would continue to draw the BMP outside your resolution; and thus outside the LCD buffer.
The clipping is because the buffer isnt simply written out for the bigger resolution space defined, as this would be invalid for the screen defined.
Since this is drawing directly to the LCD buffer, you wont get any scaling. The most you can do is limit where the output is made.
Side Note: I see the code does make use of the X/Y resolution defines in some places. Wonder why they didnt make use of the defines everywhere, like in the above posted code.
For example,
Code: Select all
void TFT_LCD_Init(void)
{
LCD_Init();
LcdBkLtSet( 70 ) ;
Lcd_PowerEnable(0, 1);
Lcd_EnvidOnOff(1); //turn on vedio
Lcd_ClearScr( (0x00<<11) | (0x00<<5) | (0x00) );
#if LCD_TYPE==LCD_TYPE_N35
Paint_Bmp(0, 0, 240, 320, sunflower_240x320);
#elif LCD_TYPE==LCD_TYPE_A70
Paint_Bmp(0, 0, 800, 480, sunflower_800x480);
#elif LCD_TYPE==LCD_TYPE_VGA1024x768
Paint_Bmp(0, 0, 1024, 768, sunflower_1024x768);
#endif
}
The clipping is because the buffer isnt simply written out for the bigger resolution space defined, as this would be invalid for the screen defined.
Since this is drawing directly to the LCD buffer, you wont get any scaling. The most you can do is limit where the output is made.
Side Note: I see the code does make use of the X/Y resolution defines in some places. Wonder why they didnt make use of the defines everywhere, like in the above posted code.
Re: How to output resolution other than 1024x768 using VGA board
Nicolas writes "When you change those two defines, did you also go thru the lcd.c and change the other drawing code to adjust accordingly ?"
Yes, I did. I changed the LCD_WIDTH and LCD_HEIGHT in option.h to 1024 and 600. I then tried to output a bitmap 1024x600. The bitmap only took up a portion of the screen. The VGA board is stuck at 1024x768. Changing the display resolution in software does not change that even though the new resolution values are being used in setting up the LCD controller registers. An explanation on how to setup those registers would help.
Yes, I did. I changed the LCD_WIDTH and LCD_HEIGHT in option.h to 1024 and 600. I then tried to output a bitmap 1024x600. The bitmap only took up a portion of the screen. The VGA board is stuck at 1024x768. Changing the display resolution in software does not change that even though the new resolution values are being used in setting up the LCD controller registers. An explanation on how to setup those registers would help.
Re: How to output resolution other than 1024x768 using VGA board
I fully understand now.
It comes down to the VGA expansion board.
From what Ive been able to find - its a closed source FPGA doing the conversion.
Unless the makers built into it the possibility for other resolutions, I cant find any reference to controlling it.
All the initialization done in software, via the rLCDCON registers is for controlling the LCD driver on the S3C2440 none of it seems to deal with the VGA adapter board. At most, the software simply changes the address at which the buffer is written to.
And since it is the VGA adapter board that truly sets up the resolution on the monitor, unless there is some extra commands that can be sent to the board - i dont see the custom resolution happening.
To find what/how the LCDCON registers are used and setup, see the S3C2440 datasheet.
Chapter 15 deals with the LCD Controller.
Im sorry I cant be of any further help. Ill keep looking around to see if I find anything.
It comes down to the VGA expansion board.
From what Ive been able to find - its a closed source FPGA doing the conversion.
Unless the makers built into it the possibility for other resolutions, I cant find any reference to controlling it.
All the initialization done in software, via the rLCDCON registers is for controlling the LCD driver on the S3C2440 none of it seems to deal with the VGA adapter board. At most, the software simply changes the address at which the buffer is written to.
And since it is the VGA adapter board that truly sets up the resolution on the monitor, unless there is some extra commands that can be sent to the board - i dont see the custom resolution happening.
To find what/how the LCDCON registers are used and setup, see the S3C2440 datasheet.
Chapter 15 deals with the LCD Controller.
Im sorry I cant be of any further help. Ill keep looking around to see if I find anything.
Re: How to output resolution other than 1024x768 using VGA board
The vga board was designed to be more powerful, it has DIP switches footprint to change the resolution. Unfortunately in this 'cheap' version it has been cut down and won't work. Even by soldering a new block of DIP (I tried).
So no the VGA board is /fixed/ to 1024x768!
So no the VGA board is /fixed/ to 1024x768!
Who is online
Users browsing this forum: No registered users and 1 guest