BananaPro/Pi:LCD Module

From BananaPro/Pi
Jump to: navigation, search

Overview

LeMaker team has designed three different size LCD modules, inlcude 3.5 inch, 5.0 inch, 7.0 inch and 10.1 inch:

  1. 3.5 inch LCD module is RGB interface with 320*240 resolution (with ft5x_ts).
  2. 5.0 inch LCD module is RGB interface with 800*480 resolution (with ft5x_ts).
  3. 7.0 inch LCD module is LVDS interface with 1024*600 resolution (with ft5x_ts).
  4. 10.1 inch LCD module is LVDS interface with 1280*800 resolution (with gt9xx_ts).

600px-Lcd 3.5 5.0 7.0 10.1.jpg

Preparation

Connect the LCD module
You need connect the LCD module into the CON2 interface on the Banana Pro/Pi board. On Banana Pro there is also a DISPLAY print near the display interface.


1: You should prepare one bananaPi/Pro,one LCD module and one cable.
Lcd connect line.jpg


2: We use the cable to connect the LCD modulewith the bananaPi/Pro.Please notice the details,as shown below.

Lcd connect board.jpg Lcd connect module.jpg

The ends of the cable connect bananaPi/Pro and LCD module,silver bars which is at the ends of the cable should insert pins(Display interface) uniformly.Picture one show that silver bars face the bananaPi/Pro icon,Picture two show that silver bars face the back of the LCD module .


3: then,you should modify the SD card which is burned with the system such as linux and android,as shown in the content(For Linux and For Android), choose different operation according to different system.


4: You use Micro USB Power Adapter connect the Micro USB Power Input.

Implementation

For Linux

Step 1:Replace the configuration file
In order to use the LCD module, you need modify the script.bin file in your OS. You can donwload the modified file for each size LCD module from LeMaker github:
https://github.com/LeMaker/fex_configuration

 sudo git clone https://github.com/LeMaker/fex_configuration.git

Enter into the fex_configuration:

 cd fex_configuration

You will find two directories, bin and fex. In the bin directories there are compiled bin files that you can use it directly.
Enter the bin directory:

 cd bin

You will see 7 bin files, 4 for Banana Pro and 3 for Banana Pi. On Banana Pro, you need use the files named banana_pro_Xlcd.bin. On Banana Pi, you need use the files named banana_pi_Xlcd.bin.(X should be 35, 5, 7 or 10.1 choose the right file according to what size LCD you use) Rename the corresponded bin file that you use to script.bin, and replace the new script.bin file with the old on in your OS.
The script.bin file is located at the first partition of your SD card with OS.

You also can download the script.bin files from http://mirror.lemaker.org/pro_script.bin.zip

Then replace the script.bin file with the one for X inch lcd:

 sudo mount /dev/mmcblk0p1 /mnt
 sudo cp banana_pro_Xlcd.bin /mnt/script.bin
 sync
 sudo umount /mnt

note this commond:sudo cp banana_pro_Xld.bin /mnt/script.bin

Then reboot the system.

Step 2:Enable the touche screen
To use the touche screen, we need load the touch screen driver:

For 3.5, 5.0, 7.0 inch LCD screen:

 sudo modprobe ft5x_ts

So you should edit the /etc/modules file,and add the content below into the file:

 ft5x_ts

For 10 inch LCD screen:(Screen type: BL101-LVDS-001)
The Linux OS images that you can download from Banana Pro Resource don't support 10.1 inch TP. We should replace the uImageand driver modules files.


Step 1: Refer to Banana Pro Quick Start Guide to install Linux OS image.


Step 2: Refer to http://wiki.lemaker.org/BananaPro/Pi:Building_u-boot,_script.bin_and_linux-kernel to obtian and compile Banana Pro BSP.
You also can download platform firmware package from http://mirror.lemaker.org/BananaPro_hwpack_LCD10.1.tar.xz to obtian the uImage and dirver modules.


Step 3: Replace kernel image and driver modules.
After compiled the Banana Pro BSP or downloaded BananaPro_hwpack_LCD10.1.tar.xz, and then extract the platform firmware package:

tar -Jxvf BananaPro_hwpack.tar.xz 
ls
bootloader  kernel  rootfs

Copy kernel/uImage to replace the uImage files in the MicroSD card.

Copy rootfs/lib/modules to replace the dirver files in /lib/modules in the MicroSD card.


Step 4: Replace script.bin files
We use the banana_pro_10.1lcd.bin to replace the script.bin files in MicroSD card.


Step 5: Reboot system, and then load touchscreen module dirver:

sudo modprobe gt9xx_ts

If you want to use the touch screen when restart BananaPi/Pro everytime, we should edit the /etc/modules file,and add the content below into the file:

gt9xx_ts

For Android

To make lcd work under android, we need use the tool DragonFace to edit the Android image. First please download the latest Android image for Banana Pro or Banana Pi, and then load the Android image into the DragonFace. The method to load the Android image into the DrangonFace and edit the image special files can refer to: How to modify Android image.
Step 1:Modify System Configuration file
Click the Advanced Settings -> System Configuration file, and you can edit the fex system configuration file.
In [disp_init] section, the four parameters below need to to be shown like that below, others can be the same:

disp_init_enable        = 1
disp_mode               = 0
 
screen0_output_type     = 1
screen0_output_mode     = 5
 
screen1_output_type     = 3
screen1_output_mode     = 4



In [audio_para] section:

[audio_para]
audio_used          = 1
audio_pa_ctrl        = port:PH26<1><default><default><0>



In [lcd0_para], please ensure it is shown like below:
1.For 7inch parameters:

 
[lcd0_para]
lcd_used                = 1
 
lcd_x                   = 1024
lcd_y                   = 600
lcd_width               = 155
lcd_height              = 86
lcd_dclk_freq           = 55
lcd_pwm_not_used        = 0
lcd_pwm_ch              = 0
lcd_pwm_freq            = 22000
lcd_pwm_pol             = 1
lcd_if                  = 3
lcd_hbp                 = 150
lcd_ht                  = 1344
lcd_vbp                 = 20
lcd_vt                  = 1270
lcd_vspw                = 10
lcd_hspw                = 50
lcd_hv_if               = 0
lcd_hv_smode            = 0
lcd_hv_s888_if          = 0
lcd_hv_syuv_if          = 0
lcd_lvds_ch             = 0
lcd_lvds_mode           = 0
lcd_lvds_bitwidth       = 0
lcd_lvds_io_cross       = 0
lcd_cpu_if              = 0
lcd_frm                 = 0
lcd_io_cfg0             = 0x00000000
lcd_gamma_correction_en = 0
lcd_gamma_tbl_0         = 0x00000000
lcd_gamma_tbl_1         = 0x00010101
lcd_gamma_tbl_255       = 0x00ffffff
 
lcd_bl_en_used          = 1
lcd_bl_en               = port:PH08<1><0><default><1>
 
lcd_power_used          = 1
lcd_power               = port:PH12<1><0><default><1>
lcd_pwm_used            = 1
lcd_pwm                 = port:PB02<2><0><default><default>
 
lcdd0                   = port:PD00<3><0><default><default>
lcdd1                   = port:PD01<3><0><default><default>
lcdd2                   = port:PD02<3><0><default><default>
lcdd3                   = port:PD03<3><0><default><default>
lcdd4                   = port:PD04<3><0><default><default>
lcdd5                   = port:PD05<3><0><default><default>
lcdd6                   = port:PD06<3><0><default><default>
lcdd7                   = port:PD07<3><0><default><default>
lcdd8                   = port:PD08<3><0><default><default>
lcdd9                   = port:PD09<3><0><default><default>
lcdd10                  = port:PD10<2><0><default><default>
lcdd11                  = port:PD11<2><0><default><default>
lcdd12                  = port:PD12<2><0><default><default>
lcdd13                  = port:PD13<2><0><default><default>
lcdd14                  = port:PD14<2><0><default><default>
lcdd15                  = port:PD15<2><0><default><default>
lcdd16                  = port:PD16<2><0><default><default>
lcdd17                  = port:PD17<2><0><default><default>
lcdd18                  = port:PD18<2><0><default><default>
lcdd19                  = port:PD19<2><0><default><default>
lcdd20                  = port:PD20<2><0><default><default>
lcdd21                  = port:PD21<2><0><default><default>
lcdd22                  = port:PD22<2><0><default><default>
lcdd23                  = port:PD23<2><0><default><default>
lcdclk                  = port:PD24<2><0><default><default>
lcdde                   = port:PD25<2><0><default><default>
lcdhsync                = port:PD26<2><0><default><default>
lcdvsync                = port:PD27<2><0><default><default>

2.For 5inch LCD:

[lcd0_para]
lcd_used = 1
lcd_x = 800
lcd_y = 480
lcd_dclk_freq = 30
lcd_pwm_not_used = 0
lcd_pwm_ch = 0
lcd_pwm_freq = 22000
lcd_pwm_pol = 0
lcd_max_bright = 240
lcd_min_bright = 64
lcd_if = 0
lcd_hbp = 88
lcd_ht = 928
lcd_vbp = 32
lcd_vt = 1050
lcd_vspw = 3
lcd_hspw = 48
lcd_hv_if = 0
lcd_hv_smode = 0
lcd_hv_s888_if = 0
lcd_hv_syuv_if = 0
lcd_lvds_ch = 0
lcd_lvds_mode = 0
lcd_lvds_bitwidth = 0
lcd_lvds_io_cross = 0
lcd_cpu_if = 0
lcd_frm = 0
lcd_io_cfg0 = 268435456
lcd_gamma_correction_en = 0
lcd_gamma_tbl_0 = 0x0
lcd_gamma_tbl_1 = 0x10101
lcd_gamma_tbl_255 = 0xffffff
lcd_bl_en_used = 1
lcd_bl_en = port:PH08<1><0><default><1>
lcd_power_used = 1
lcd_power = port:PH12<1><0><default><1>
lcd_pwm_used = 1
lcd_pwm = port:PB02<2><0><default><default>
lcdd0 = port:PD00<2><0><3><default>
lcdd1 = port:PD01<2><0><3><default>
lcdd2 = port:PD02<2><0><3><default>
lcdd3 = port:PD03<2><0><3><default>
lcdd4 = port:PD04<2><0><3><default>
lcdd5 = port:PD05<2><0><3><default>
lcdd6 = port:PD06<2><0><3><default>
lcdd7 = port:PD07<2><0><3><default>
lcdd8 = port:PD08<2><0><3><default>
lcdd9 = port:PD09<2><0><3><default>
lcdd10 = port:PD10<2><0><3><default>
lcdd11 = port:PD11<2><0><3><default>
lcdd12 = port:PD12<2><0><3><default>
lcdd13 = port:PD13<2><0><3><default>
lcdd14 = port:PD14<2><0><3><default>
lcdd15 = port:PD15<2><0><3><default>
lcdd16 = port:PD16<2><0><3><default>
lcdd17 = port:PD17<2><0><3><default>
lcdd18 = port:PD18<2><0><3><default>
lcdd19 = port:PD19<2><0><3><default>
lcdd20 = port:PD20<2><0><3><default>
lcdd21 = port:PD21<2><0><3><default>
lcdd22 = port:PD22<2><0><3><default>
lcdd23 = port:PD23<2><0><3><default>
lcdclk = port:PD24<2><0><3><default>
lcdde = port:PD25<2><0><3><default>
lcdhsync = port:PD26<2><0><3><default>
lcdvsync = port:PD27<2><0><3><default>

3.For 3.5inch LCD:

[lcd0_para]
lcd_used = 1
lcd_x = 320
lcd_y = 240
lcd_dclk_freq = 7
lcd_pwm_not_used = 0
lcd_pwm_ch = 0
lcd_pwm_freq = 22000
lcd_pwm_pol = 0
lcd_max_bright = 240
lcd_min_bright = 64
lcd_if = 0
lcd_hbp = 68
lcd_ht = 408
lcd_vbp = 18
lcd_vt = 524
lcd_vspw = 3
lcd_hspw = 30
lcd_hv_if = 0
lcd_hv_smode = 0
lcd_hv_s888_if = 0
lcd_hv_syuv_if = 0
lcd_lvds_ch = 0
lcd_lvds_mode = 0
lcd_lvds_bitwidth = 0
lcd_lvds_io_cross = 0
lcd_cpu_if = 0
lcd_frm = 0
lcd_io_cfg0 = 268435456
lcd_gamma_correction_en = 0
lcd_gamma_tbl_0 = 0x0
lcd_gamma_tbl_1 = 0x10101
lcd_gamma_tbl_255 = 0xffffff
lcd_bl_en_used = 1
lcd_bl_en = port:PH08<1><0><default><1>
lcd_power_used = 1
lcd_power = port:PH12<1><0><default><1>
lcd_pwm_used = 1
lcd_pwm = port:PB02<2><0><default><default>
lcdd0 = port:PD00<2><0><3><default>
lcdd1 = port:PD01<2><0><3><default>
lcdd2 = port:PD02<2><0><3><default>
lcdd3 = port:PD03<2><0><3><default>
lcdd4 = port:PD04<2><0><3><default>
lcdd5 = port:PD05<2><0><3><default>
lcdd6 = port:PD06<2><0><3><default>
lcdd7 = port:PD07<2><0><3><default>
lcdd8 = port:PD08<2><0><3><default>
lcdd9 = port:PD09<2><0><3><default>
lcdd10 = port:PD10<2><0><3><default>
lcdd11 = port:PD11<2><0><3><default>
lcdd12 = port:PD12<2><0><3><default>
lcdd13 = port:PD13<2><0><3><default>
lcdd14 = port:PD14<2><0><3><default>
lcdd15 = port:PD15<2><0><3><default>
lcdd16 = port:PD16<2><0><3><default>
lcdd17 = port:PD17<2><0><3><default>
lcdd18 = port:PD18<2><0><3><default>
lcdd19 = port:PD19<2><0><3><default>
lcdd20 = port:PD20<2><0><3><default>
lcdd21 = port:PD21<2><0><3><default>
lcdd22 = port:PD22<2><0><3><default>
lcdd23 = port:PD23<2><0><3><default>
lcdclk = port:PD24<2><0><3><default>
lcdde = port:PD25<1><0><3><0>
lcdhsync = port:PD26<2><0><3><default>
lcdvsync = port:PD27<2><0><3><default>



In [ctp_para] section:
1.For 7inch LCD touch screen:

[ctp_para]
ctp_used                = 1
ctp_twi_id              = 3
ctp_twi_name            = "ft5x_ts"
ctp_screen_max_x        = 1024
ctp_screen_max_y        = 600
ctp_revert_x_flag       = 0
ctp_revert_y_flag       = 0
ctp_exchange_x_y_flag   = 0
 
ctp_int_port            = port:PH09<6><default><default><default>
ctp_wakeup              = port:PH07<1><default><default><1>
ctp_io_port             = port:PH09<0><default><default><default>

2.For 5inch LCD touch screen:

[ctp_para]
ctp_used                = 1
ctp_twi_id              = 3
ctp_twi_name            = "ft5x_ts"
ctp_screen_max_x        = 800
ctp_screen_max_y        = 480
ctp_revert_x_flag       = 0
ctp_revert_y_flag       = 0
ctp_exchange_x_y_flag   = 0
 
ctp_int_port            = port:PH09<6><default><default><default>
ctp_wakeup              = port:PH07<1><default><default><1>
ctp_io_port             = port:PH09<0><default><default><default>

3.For 3.5inch LCD touch screen:

[ctp_para]
[ctp_para]
ctp_used = 1
ctp_name = "ft5x_ts"
ctp_twi_id = 3
ctp_twi_addr = 0x38
ctp_screen_max_x = 320
ctp_screen_max_y = 240
ctp_revert_x_flag = 0
ctp_revert_y_flag = 0
ctp_exchange_x_y_flag = 0
ctp_firm = 1
ctp_int_port = port:PH09<6><default><default><default>
ctp_wakeup = port:PH07<1><default><default><1>
ctp_io_port = port:PH09<0><default><default><default>



In [ctp_list_para] section:

[ctp_list_para]
ctp_det_used              = 1
ft5x_ts                   = 1
gt82x                     = 0
gslX680                   = 0
gt9xx_ts                  = 0
gt811                     = 0

Step 3:Modify the init.sun7i.rc
Please make sure that the lines below are shown:

#ctp module
    insmod /system/vendor/modules/sw_device.ko
    #insmod /system/vendor/modules/ft5x_ts.ko


Step 4:Save
After modified the necessary parameters, please save and exit. If you do not save the modification, it will not take effect. When you click the save button, it will tell you save it as a new image file.


Attention

When you use LCD under Android, you need disconnect the HDMI with Banana Pro/Pi.

Quick Way for Linux

Step 1:Replace the configuration file
In order to use the LCD module, you need modify the script.bin file in your OS. You can donwload the modified file for each size LCD module from LeMaker github:
https://github.com/LeMaker/fex_configuration
Enter into the fex_configuration:
You will find two directories, bin and fex. In the bin directories there are compiled bin files that you can use it directly.
Enter the bin directory:

You also can download the script.bin files from http://mirror.lemaker.org/pro_script.bin.zip

Step 2:The banna_pro_xlcd.bin name to script.bin.
Use the bananapro memory card into the computer after the bannapro need banana_pro_xlcd.bin file into the the bananapro memory card,then you can change the banana_pro_xlcd.bin to the script.bin. For example, if you want the banana_pro_5lcd.bin to drive the LCD screen, as long as you put the banana_pro_5lcd.bin.bin into your memory card, and change the banana_pro_5lcd.bin to the script.bin, then inserted the memory card bananapro demoboard start again
Note:change the banana_pro_5lcd.bin to the script.bin

See Also

Youtube video for Camera module: ExplainingComputers