Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A20 => Topic started by: pawnies20 on April 12, 2015, 11:37:10 PM

Title: Need help to drive an lcd RGB 24 bits screen
Post by: pawnies20 on April 12, 2015, 11:37:10 PM
Hello!
I need some help.
I'm trying to drive this screen:
http://www.sat-sz.com/data/SAT040HS54DHY0-A0_20140909.zip

I'm using two differents voltages: one for backlight and another for lcd power.

I read documentation behind to configure fex:
http://linux-sunxi.org/Fex_Guide
in fex, i'm using this parameters:

    lcd_x=320
    lcd_y=240
    lcd_dclk_freq=6
    lcd_hbp=38
    lcd_ht=408
    lcd_vbp=18
    lcd_vt=524
    lcd_hv_vspw=1
    lcd_hv_hspw=1
   
    lcd_if=0
    lcd_lvds_bitwidth=0
    lcd_io_cfg0=0
    lcd_bl_en_used=1
    fb0_scaler_mode_enable=0
    fb0_width=0
    fb0_height=0
I want to use 24 bits RGB with data (23:0), Hsync, Vsync and DE.

I'm using this map too:
https://github.com/OLIMEX/OLINUXINO/blob/master/HARDWARE/A10-OLinuXino-LIME/A10_Lime_GPIOs.pdf?raw=true

I ve found this doc too:
https://github.com/allwinner-ics/lichee_linux-3.0/blob/master/drivers/video/sun4i/lcd/a10_lcd_config_nanual_v1.0.pdf

But Nothing, id did not work...

In lcd page 15 there is register table .
I don't know how to use it with flex...


I don't understand

Thank you
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: dave-at-axon on April 13, 2015, 05:51:35 AM
Can you show us a schematic of the LCD interface board you have that connects the 40 pin from the Olimex to the 54 pin on the LCD?

What's strange for me is that there is no reference to the backlight voltage requirements, only current is shown. How are you driving the LED's for this?

The document is very poor. There is also no reference to what state the SPIENABLE has to be for RGB mode. I am assuming this is high?

Also the reference to the SPI shows different signal name and uses the I2C naming convention. :(
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: jmyreen on April 13, 2015, 09:05:59 AM
Quote from: dave-at-axon on April 13, 2015, 05:51:35 AM
What's strange for me is that there is no reference to the backlight voltage requirements, only current is shown. How are you driving the LED's for this?

According to the schematics, there are four diodes in series. The forward drop is probably quite high. From Wikipedia: "Typically, the forward voltage of an LED is about 1.8–3.3 volts; it varies by the color of the LED. A red LED typically drops 1.8 volts, but voltage drop normally rises as the light frequency increases, so a blue LED may drop around 3.3 volts." This means over 13 volts may be needed to drive the LEDs.

Once you are over the forward drop, you can assume the resistance of the LEDs are zero, so some kind of current limiter is needed to keep the current within spec.
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: dave-at-axon on April 13, 2015, 10:03:38 AM
Yeah, I figured around 14V or so. My display uses 6 in each of 2 sets of series LED's and is 19V. It's good practice if the display manufacturer actually quotes the LED forward voltage so you can setup the correct current and voltage.

If there is no backlight, you cannot tell if the LCD timing is correct as you will see nothing unless of course you had one of those transflective displays but they are not very common and expensive too.
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: pawnies20 on April 13, 2015, 10:05:59 AM
thanx for reply.
Voltage for backlight is 13V, your are agree jmyreen and works well with an external power.
Dave i will make the  connexion table in few hours!
Many many thanx
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: pawnies20 on April 13, 2015, 10:13:03 AM
this is the table:


reset->1 (3.3V)
data 0-23->LCD_D0-LCD_D23 (i respect order PD0-PD23)
hsync->LCD_Hsync (PD26)
vsync->LCD_Vsync PD27
dotclk->LCD_CLK PD24
vdd->3.3V
den->LCD_DE PD25
gnd->GND

backlight :cathode gnd and anode: external power (with gnd connected) and 13v)

Thank you
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: dave-at-axon on April 13, 2015, 11:31:25 AM
What voltage have you connected SPIENABLE to?

Try connecting this to 3.3V if not already done so.
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: pawnies20 on April 13, 2015, 01:09:29 PM
Spiennable is not connected.
You think it could be the problem?
What about timings?

Thank you very very very much !!
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: dave-at-axon on April 13, 2015, 01:52:53 PM
If it disables the SPI then yes, it could be the reason for no image.

Timings seem OK looking at the datasheet.

What OS are you using?
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: pawnies20 on April 13, 2015, 02:02:20 PM
Thanx dave!!
I'm using debian
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: pawnies20 on April 13, 2015, 10:45:01 PM
I have tried to connect Spi ennable to 3.3v
Nothing change.

I don't understand
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: pawnies20 on April 13, 2015, 10:56:27 PM
I'm using olimex debian .
I think when i'm export fex to bin it will work after reboot.
I have no command to launch?
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: pawnies20 on April 13, 2015, 11:37:37 PM
my lcd use this ic:
http://www.texim-europe.com/promotion/402/ili9322%20driver%20datasheet_te.pdf
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: pawnies20 on April 14, 2015, 12:37:00 AM
Dave, can you explain me how you get newhavendisplay to work well?

http://www.newhavendisplay.com/nhd35320240mfatxlctp1-p-5204.html

You are using debian or android?

Can you explain me the differents steps?

You say on another post:
I use the 5" and 7" models and they have the same interface.

I recently got the 7" working with an A20 running Android.


The screen use differents ics to drive.

Can you explain me please?
Thank you
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: dave-at-axon on April 14, 2015, 02:38:31 AM
I use Android and I build my own OS so that I have full control over the FEX settings etc. Some of us tried to modify the FEX in the pre-built images but it didn't work. The only solution was to build a custom OS. I have now got 2 builds that can run with the Touch Revolution or Newhaven displays. In fact, I can build for any display and touch with this.

What OS are you using and are you building this yourself?

Looking at the datasheet for your display it should be defaulting to RGB according to the SPI registers but I also see that there are 2 pins to select the mode. These are internal to the module so you can't select these.

I think the issue is to ensure that your FEX is being read on power up. Can you capture the debug output from the board UART as this is so important as it will show what your OS is attempting to setup the system for. Post it here so we can see it.
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: pawnies20 on April 14, 2015, 09:48:03 AM
Thank you Dave.
dEFAUT MOSE IS HSYNC+VSYNC+DE Mode (default)

I'm usind debian and custom it with kernel options.

When you say you buil a custom that run any display, what did you do exept for the fex?

yes i will debug boot with UART CABLE ant tell you result.
i m already  using fex personnal parameters that are read on boot.

After fex changes when i reboot board, connected with vnc, resolution is change: x= 320 and y= 240

Many thanx dave
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: pawnies20 on April 15, 2015, 12:43:33 AM
This is the result
I don't know if script.bin aparemeters are really read.




reading script.bin
[info] Loading kernel module lcd.
Starting X display manager: slim.
[....] /etc/environment has been deprecated for locale information; use /etc/def[warnlocale for LC_ALL="en_US.utf8" instead ... (warning).
[....] Starting periodic command scheduler: cron<4>Warning: this sunxi disp driver will see significant redesign.
[   15.731588] Warning: this sunxi disp driver will see significant redesign.
<4>Applications using /dev/disp directly will break.
[   15.757734] Applications using /dev/disp directly will break.
[ ok <4>For more information visit: http://linux-sunxi.org/Sunxi_disp_driver
[   15.782350] For more information visit: http://linux-sunxi.org/Sunxi_disp_driver
<4>[DISP] layer allocated: 0,101
[   15.805377] [DISP] layer allocated: 0,101
.
Mali: [   15.907759] Mali: permit MALI_IOC_MEM_MAP_EXT ioctl for framebuffer (paddr=0x49000000, size=16777216)
permit MALI_IOC_MEM_MAP_EXT ioctl for framebuffer (paddr=0x49000000, size=16777216)
[....] Starting system message bus: dbus<6>mali: use config clk_div 4
[   15.950858] mali: use config clk_div 4
<6>mali: clk_div 4
[   15.957387] mali: clk_div 4
Mali: [   15.961287] Mali: mali clock set completed, clock is  240000000 Hz
mali clock set completed, clock is  240000000 Hz
<6>mali: use config clk_div 4
[   15.975909] mali: use config clk_div 4
<6>mali: clk_div 4
[   15.981927] mali: clk_div 4
Mali: [   15.985356] Mali: mali clock set completed, clock is  240000000 Hz
mali clock set completed, clock is  240000000 Hz
Mali: [   16.004380] Mali: Mali device driver loaded
Mali device driver loaded
<6>[drm] Initialized drm 1.1.0 20060810
[   16.283689] [drm] Initialized drm 1.1.0 20060810
<6>Mali DRM initialize, driver name: mali_drm, version 2.1
[   16.308597] Mali DRM initialize, driver name: mali_drm, version 2.1
<6>[drm] Initialized mali_drm 2.1.1 20101111 on minor 0
[   16.356082] [drm] Initialized mali_drm 2.1.1 20101111 on minor 0
<6>Mali DRM initialize, driver name: mali_drm, version 2.1
[   16.378939] Mali DRM initialize, driver name: mali_drm, version 2.1
[ ok <6>[drm] Initialized mali_drm 2.1.1 20101111 on minor 1
[   16.400352] [drm] Initialized mali_drm 2.1.1 20101111 on minor 1
UMP<2>: [   16.423018] UMP<2>: New session opened
New session opened
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: dave-at-axon on April 15, 2015, 03:50:49 AM
What about the initial uboot messages? What do they show?

It should configure the LCD and show a boot image of some sort. It does on the Android build.

Are you compiling the FEX file into BIN?
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: pawnies20 on April 15, 2015, 09:36:46 AM
This is the message under:
script.bin is read.
Yes , sure, i'm compiling fex to bin

Dave, do you use:lcd0_panel_cfg.c when compiling your kernel


U-Boot 2014.04-10675-g44b53fd (May 23 2014 - 13:02:55) Allwinner Technology

CPU:   Allwinner A10 (SUN4I)
Board: A10-OLinuXino-Lime
I2C:   ready
DRAM:  512 MiB
MMC:   SUNXI SD/MMC: 0
In:    serial
Out:   serial
Err:   serial
Net:   emac
Hit any key to stop autoboot:  0
reading uEnv.txt
104 bytes read in 17 ms (5.9 KiB/s)
Loaded environment from uEnv.txt
reading boot.scr
337 bytes read in 16 ms (20.5 KiB/s)
Jumping to boot.scr
## Executing script at 44000000
reading script.bin
52840 bytes read in 28 ms (1.8 MiB/s)
reading uImage
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: pawnies20 on April 15, 2015, 09:43:05 AM
Page 58 in doc behind we can see a boot sequence.

http://www.texim-europe.com/promotion/402/ili9322%20driver%20datasheet_te.pdf

This can be the problem.

Dave can you explain me how you make your lcd's work?

Thank you
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: dave-at-axon on April 15, 2015, 12:04:37 PM
I build Android so different to how Linux runs the script as far as I can tell. The FEX file takes care of configuring the LCD display.

My LCD is straight RGB and DE and no SPI so I don't have anything to worry about in configuration etc. It just works.

Do you have a high bandwidth scope available to check the DCLK output to see if this is running at your 6MHZ you set in the script?
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: pawnies20 on April 15, 2015, 06:23:48 PM
Ok you configure only fex and go, it works.
Why do you said you make a special android configuration that work with all lcd?
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: dave-at-axon on April 16, 2015, 02:55:51 AM
It can work with any LCD up to the limits of the video driver.

What I mean is that by custom building the OS I can configure it to drive anything by changing the FEX and the in some cases, underlying Android OS.

Is there a reason you need to use the 320x240 display? Can you use something with higher resolution such as a 4.3 with 800x480 and pure RGB interface? Or how about a 5". I know for certain that the Newhaven 5" works with the A20 and so does the touch for it. It uses an FT5x driver for touch and there is a Linux and Android for this. I have it working with my Android build. If you need the 7" version it is a drop in for the 5" settings.
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: pawnies20 on April 16, 2015, 09:29:58 AM
OK
I can see olimex's lcd use only de and clk to drive their screen from their boards
Do you cable hsync and vsync to or hour newhaven works without hsync and vsync?
a nother question: can you give me newhaven model you use and hat worked fine?

Thank you

https://www.olimex.com/Products/OLinuXino/LCD/LCD-OLinuXino-4.3TS/resources/LCD-OLINUXINO-4.3TS_sch.pdf
https://www.olimex.com/Products/OLinuXino/LCD/LCD-OLinuXino-7/resources/LCD-OLINUXINO-7TS_sch.pdf
https://www.olimex.com/Products/OLinuXino/LCD/LCD-OLinuXino-10/resources/LCD-OLINUXINO-10TS_sch.pdf
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: dave-at-axon on April 16, 2015, 04:28:58 PM
7" LCD is this one:

NHD-7.0-800480EF-ATXV#-CTP

5" is this one:

NHD-5.0-800480TF-ATXL#-CTP

I also use the 5" one with a GHI Electronics G120 and G400 based boards running .NET Microframework. Awesome development system and support but Windows hosted only for the time being.
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: dave-at-axon on April 20, 2015, 02:38:49 AM
You must have had to make a custom board to interface to your LCD.

Can you post a PDF of the schematic for me? If you don't want to post publicly, PM me and I will send you my email address.

I'd like to see how you have it connected. It should just work.
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: pawnies20 on April 20, 2015, 05:43:18 PM
Thank you.

reset->1 (3.3V)
data 0-23->LCD_D0-LCD_D23 (i'have respecting order PD0-PD23)
hsync->LCD_Hsync (PD26)
vsync->LCD_Vsync PD27
dotclk->LCD_CLK PD24
vdd->3.3V
den->LCD_DE PD25
gnd->GND

On olimex's lcd schemas, i can see they have connected Vsync and Hsync to 1 level voltage ....
-What do you think of that?
https://www.olimex.com/Products/OLinuXino/LCD/LCD-OLinuXino-4.3TS/resources/LCD-OLINUXINO-4.3TS_sch.pdf
https://www.olimex.com/Products/OLinuXino/LCD/LCD-OLinuXino-7/resources/LCD-OLINUXINO-7TS_sch.pdf
https://www.olimex.com/Products/OLinuXino/LCD/LCD-OLinuXino-10/resources/LCD-OLINUXINO-10TS_sch.pdf

-Second strange thing:
In datasheet of my lcd timing are stange:
http://www.rct.ru/pdf/lcd/SAT040HS54DHY0-A0_20140506.pdf
vertical period = horizontal diplay + back porch + front porch + pulse width = 240+18+4+1=263.
in document vertical period is 262 ????


Thank you
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: dave-at-axon on April 21, 2015, 03:56:21 AM
Can you show me a picture of your interface and how you connected it to the A20? Because of the timing any prototyping which does not consider proper ground around the DOTCLK will suffer from issues.

Do you see anything on the LCD at all? Like an all white display or coloured lines etc.

How are you driving the LED backlight? What circuit are you using for this?

Better if I can see some images of your setup.

On the Olimex schematics the resistors are marked as NA which means they are not fitted. They are there to support pullup but not actually used in the final build.

On your vertical timing, most registers are the value -1 so 262 would be the value to go in the register.
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: pawnies20 on April 22, 2015, 03:44:52 PM
hI.
Not simple.
I ve just understood that i mist connect spi to parameter register.
Imust too respect boot sequence...

I don't know if i can do that
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: dave-at-axon on April 22, 2015, 05:24:26 PM
Better you find an RGB interface LCD instead and save all your trouble.

Sometimes trying to do things the cheap way is not worth the hassles it often causes.
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: dave-at-axon on April 23, 2015, 04:56:29 PM
I saw your request for design. I can do that but I need to understand what you have now.

Can you show me some pictures of how you have this connected. You can email me at the email I will send via PM.

After I see what you have tried, I will offer you an option based on designing you a PCB with the correct interface.
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: pawnies20 on April 25, 2015, 01:54:14 AM
Many thanx
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: pawnies20 on May 31, 2015, 04:43:31 PM
Hi dave!
Finally i bought a new lcd.
I was right, the 2 first screens uses ic hx8238d
They nedd an initialization with spi.
I bought a hx8238a and then it's ok.
The screen starts, become black ans when startx start, it changes of grey.

Problem: nothing appear on screen.
I can see changes on grey..
But nothing else.

can you tell me how you have wired your screens ? Did you have a plan, a map..
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: dave-at-axon on June 02, 2015, 05:32:29 PM
Hi,

Sorry for the delay as I was overseas.

I just connected the RGB, SYNC, DE and CLK lines as per similar to the Olimex LCD although only 16 bit. Lower unused bits were grounded.

What is your new LCD datasheet and how have you connected it to the A20?

Have you configured the LCD settings on the FEX correctly and sure that they are being read?
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: pawnies20 on June 09, 2015, 05:01:47 PM
Thanx Dave.
Yes, i have connected all pins as you have make.

I can see linux desktop but only on the quarter left of my lcd.

when i disconnect vsync and hsync, nothing happen...

Very strange, my fex seems good !!
I'm using these:
https://github.com/LeMaker/fex_configuration/blob/master/fex/banana_pi_35lcd.fex

My screen is these:
http://www.newhavendisplay.com/nhd35320240mfatxlctp1-p-5204.html

Thanx
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: dave-at-axon on June 09, 2015, 05:35:42 PM
Are you running Linux or Android?

It still sounds like a configuration issue in the OS if the screen only shows part of the GUI.

Can you show a picture of what it looks like?

You would probably benefit from the 5" at 800x480 as this works well with Linux and Android.
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: pawnies20 on June 12, 2015, 12:33:00 AM
Dave, i'm using linux debian

I'm using A10 lime board.

What is models you use ?

https://www.olimex.com/forum/index.php?topic=4517.0
Title: Re: Need help to drive an lcd RGB 24 bits screen
Post by: dave-at-axon on June 12, 2015, 02:27:48 AM
A20-OLinuXino-MICRO-4GB