BananaPro/Pi:LCD Module

From BananaPro/Pi
Revision as of 14:53, 14 September 2015 by Super (Talk | contribs)

Jump to: navigation, search

Overview

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

  1. 3.5 inch LCD module is RGB interface with 320*240 resolution.
  2. 5.0 inch LCD module is RGB interface with 800*480 resolution.
  3. 7.0 inch LCD module is LVDS interface with 1024*600 resolution.

Lcd 3.5 5.0 7.0.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 6 bin files, 3 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 or 7, 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.

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:

 sudo modprobe ft5x_ts

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

 ft5x_ts

You can use the touch screen when we restart our BananaPi/Pro everytime.

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.

See Also

Youtube video for Camera module: ExplainingComputers

For Windows

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: