[VGA] Use CGA (with VGA connector)15khz resolutions ?.

Started by dapsaille, November 02, 2013, 01:30:16 PM

Previous topic - Next topic

dapsaille

Hello,

i really want to buy a A13-OLinuXino-MICRO but one question remains.

Can i configure the vga output for CGA like resolutions, 320×224 for exemple ?

It is for interfacing an old arcade crt tube to the card (15khz).

Sorry if this is a 'i want it all and i want it now' question but i'm pretty new to Arm world.

I will use the fb only, so i cannot use Xorg config file for resolutions.

Thanks for your attention.

Florent

EDIT = of course composite output is not an option for me, i want RGB.

davidefa

I think that it can be done.
I think that you have to modify the parameters lcd_x, lcd_y, lcd_dclk_freq, lcd_hbp, lcd_ht, lcd_vbp, lcd_vt in script.bin ( take the script bin for the vga 800x600 as a starting point ).

dapsaille

thanks for the tip, i'm also looking at source code of uboot, there is a lot of interesting parameters in it ..

Now i'm looking for converting modelines into uboot parameters  ;D

Looks like it is time to buy this "little toy" ^^

dapsaille


I don't understand how to tell to the A13 to output 15khz hsync with lcd options .. is it possible ?

i've read that vga out is a beautifull hack of lcd output, so this option may not be present ?

davidefa

Check the fex guide http://linux-sunxi.org/Fex_Guide#lcd.5B0.2F1.5D_configuration

I think ( I have not tested myself ) you can set something like this ( or at least this is a starting point ):
lcd_dclk_freq=5 // 5MHz
lcd_x=320
lcd_y=224
lcd_ht=333      // this should give you a 5MHz/333=15KHz horizontal sync
lcd_hbp=6
lcd_vt=452      // vysnc total cycle * 2, this should give you a 66Hz vertical sync
lcd_vbp=1


dapsaille

#5
thanks for the tip, i will try it next week (postmail please go faster :) )

but .. i don't understand=

lcd_ht=333      // this should give you a 5MHz/333=15KHz horizontal sync


How do you calculate that ? :x

davidefa

Quote from: dapsaille on November 06, 2013, 10:41:30 PM
lcd_ht=333      // this should give you a 5MHz/333=15KHz horizontal sync


How do you calculate that ? :x

with a calculator... or even with a piece of paper and a pen, I'm old school ;-)

dapsaille

hahaha  ;D


sorry for that stupid question .... i was tired  ::)

davidefa

You can start considering that 320 ( h. pixel ) x 15KHz ( h. sync ) = 4.8MHz
as dclk is integer you can start selecting the next higher integer...

dapsaille

#9
Card at home :)

i compiled uboot, kernel and a debian base system ..

If i use your parameters in boot.bin here is the serial output :


... SNIP ....
[    5.082188] [DISP] *** lcd_vbp:    1

<4>[DISP] *** lcd_hspw:   128

[    5.088901] [DISP] *** lcd_hspw:   128

<4>[DISP] *** lcd_vspw:   4

[    5.095181] [DISP] *** lcd_vspw:   4

<4>[DISP] *** lcd_frame_frq:  66Hz

[    5.101897] [DISP] *** lcd_frame_frq:  66Hz

<4>[DISP] ***

[    5.107396] [DISP] ***

<4>[DISP] *** Err01: Violate "lcd_hbp > lcd_hspw"

[    5.114180] [DISP] *** Err01: Violate "lcd_hbp > lcd_hspw"

<4>[DISP] *** Err02: Violate "lcd_vbp > lcd_vspw"

[    5.124093] [DISP] *** Err02: Violate "lcd_vbp > lcd_vspw"

<4>[DISP] *** Err04: Violate "(lcd_vt/2) >= (lcd_vbp+lcd_y+2)"

[    5.135140] [DISP] *** Err04: Violate "(lcd_vt/2) >= (lcd_vbp+lcd_y+2)"

<4>[DISP] ***

[    5.143065] [DISP] ***

<4>[DISP] *** Try new parameters, you can make it pass!
... SNIP ....


Of course, no output with a DIY vga to rgb scart cable (not tested :x)

If i use standard VGA Fex with a standard VGA monitor, all works :)
i'm reading docs for now ^^


EDIT = i've just tested my vga to scart and it works with a xp pro configured to output 15khz so ...

Need to dig  ;D

dapsaille

#10
ok, looks like i get a working .fex.

In xorg logs i can see that the fb modeline is ok.


[lcd0_para]
lcd_used = 1
lcd_x                    = 384
lcd_y                    = 224
lcd_dclk_freq            = 8
lcd_if                   = 0
lcd_hbp                  = 96
lcd_ht                   = 512
lcd_vbp                  = 26
lcd_vt                   = 524
lcd_hv_vspw              = 20
lcd_hv_hspw              = 32



(II) FBTURBO(0): Modeline "current"x0.0    8.00  384 416 448 512  224 236 256 262 -hsync -vsync -csync (15.6 kHz b)


.. With this modeline i get a picture on an x86/radeon debian system but nothing on the Olinuxino ...

Of course, if i modify modeline for a 640x480 it works but in 31khz so it is not a  'i cannot get a picture with vga' but 'i cannot get a picture when i set a modeline at 15khz' ^^

Any idea ?

I hope that the lcdtovga hack will not restrict the use of old crt monitors :x