Hammer LCD 8bit Color STN

From eLinux.org
Revision as of 09:47, 14 May 2011 by Jsujjava (talk | contribs) (Change to Category TCT-Hammer)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This is a "HowTo" for the Panasonic EDMGRB8KJF (Datasheet) available from EarthLCD to be used with the Hammer development module from TinCanTools

NOTE: This screen is an 8-bit STN screen, however in order to use it on the S3C2410A Hammer 12-bit STN must be used. The last 4 bits are simply masked off. If you have intentions of using this screen for frameworks such as Qt4 or others please first verify that they have 12-bit color support.

Hardware

Matching Pinouts
Pin Number Hammer Note LCD Pin Number
16 VM Display On/Off DISPON 16
17 VFRAME LCD Vertical sync FRM 20
18 VLINE LCD Horizontal sync LOAD 14
19 VCLK LCD pixel clock CP 12
21 LCD_VD0 LCD data bit 0 Data0 9
22 LCD_VD1 LCD data bit 1 Data1 8
23 LCD_VD2 LCD data bit 2 Data2 7
24 LCD_VD3 LCD data bit 3 Data3 6
25 LCD_VD4 LCD data bit 4 Data4 4
26 LCD_VD5 LCD data bit 5 Data5 3
27 LCD_VD6 LCD data bit 6 Data6 2
28 LCD_VD7 LCD data bit 7 Data7 1
+3.3V VDD 10
+3.3V VDD 11
+3.3V VDD 13
Ground VSS 5
Ground VSS 15
Ground VSS 17
Ground VSS 19
Contrast +1.95V (+-0.8V) VCON 18


NOTE: VCON should be variable control to adjust contrast and the VDD should have separate power control, i.e. via a gpio NOTE: 3.3V from the Hammer dev kit is not enough power and a seperate regulator will be required to power the device. Please make sure you also tie together the ground pins from the external regulator and the dev board.

NOTE: This display also requires a backlight inverter (see datasheet for requirements)

Pictures

Tincantools-login.jpg
We have a login prompt!
Mixer-display.jpg
Picture of LCD Display running a mixer console Ncurses GUI

Linux Kernel 2.6.29.6 Build Notes

In order to get this screen to work framebuffer support has to be built into your kernel.

 cd hammer/source/linux-2.6.29.6
 export ARCH=arm
 export CROSS_COMPILE=arm-linux-uclibc-
 make menuconfig 
 Device Drivers ->  Graphics Support -> Support for frame buffer devices
 Inside this sub menu add:
 [*] Enable Video Mode Handling Helpers
 <*> S3C2410 LCD framebuffer support
 Under Device Drivers -> Graphics Support -> Console display driver support ADD
 Framebuffer Console Support

NOTE: It is also a good idea to go ahead and add the boot logo.

Adding LCD to Machine File

The next step is to add the display settings to your mach-tct_hammer.c file in ./arch/arm/s3c2410 If you have questions about this file please see the linux documentation ( I will try to make a patch for this at a later date)


Open up your mach-tct_hammer.c file as mentioned above and verify the following include headers exist

 #include <asm/mach-types.h>
 #include <mach/regs-lcd.h>
 #include <mach/fb.h>
 #include <mach/regs-gpio.h>

If they do not exist please add them.

Next add this in the upper section of the file

 /* LCD/VGA controller */
 #ifdef CONFIG_FB_S3C2410
 static struct s3c2410fb_display __initdata tct_hammer_lcd_info = {
 	.width		= 640,
 	.height		= 480,
 
 	.type		= S3C2410_LCDCON1_STN8,
 
 	.pixclock	= 120000, 
 	.xres		= 640,
 	.yres		= 480,
 	.bpp		= 12,
 	.hsync_len	= 48,
 
 	.left_margin   = 4 << (4 + 3),
   	.right_margin  = 8 << 3,
 	.upper_margin	= 10,
 	.lower_margin	= 10,
 
 	.lcdcon5	= 2
 };
 /* LCD/VGA controller */
 
 static struct s3c2410fb_mach_info __initdata tct_hammer_fb_info = {
 
 	.displays = &tct_hammer_lcd_info,
 	.num_displays = 1,
 	.default_display = 0,
 
 	.gpccon =	0xaaaaa9aa,
 	.gpccon_mask =	0xffffffff,
 	.gpcup =	0x0000ffff,
 	.gpcup_mask =	0xffffffff,
 
	.gpdcon =	0x00000000,
 	.gpdcon_mask =	0xffffffff,
 	.gpdup =	0x00000000,
 	.gpdup_mask =	0xffffffff,
 	.lpcsel     = ((0xCE6) & ~7) | 1<<4,
 };
 
 
 #endif

These definitions are what notify the s3c2410fb driver how to configure itself in order to talk to the LCD display properly. We still have to tell the kernel to initialize these as well as configure the GPIO pins to run as the VD pins.

In the *tct_hammer_devices[] definition add

 #ifdef CONFIG_FB_S3C2410
 	&s3c_device_lcd,
 #endif

Finally in the tct_hammer_init function add the following lines to the top of the function:

 #ifdef CONFIG_FB_S3C2410
     // disable LCD_DISPON.
   s3c2410_gpio_setpin(S3C2410_GPC4, 0);
   s3c2410_gpio_cfgpin(S3C2410_GPC4, S3C2410_GPIO_OUTPUT);
 
     // connect any frame buffer.
   s3c24xx_fb_set_platdata(&tct_hammer_fb_info);
 #endif

NOTE: TODO - Add information for modifying the s3c2410fb.c file as a setting needs changed to swap colors

Now build your kernel and install it on the device. The last thing you may have to do is configure your getty file in your rootfs to put a console on tty0 (this will include adding tty0 to your securetty list on some occasions)