Forum - MCS Electronics


FAQFAQ SearchSearch RegisterRegister Log inLog in

SSD1963 bad colors

Post new topic   Reply to topic Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message

Bascom Member

Joined: 15 Nov 2010
Posts: 24

PostPosted: Sun May 19, 2019 9:50 pm    Post subject: SSD1963 bad colors Reply with quote

Hi, I use last code and library from this post:
This is "Fast library for SSD1963 LCD" by Mrshilov.

This code "Landscape Test SSD1963.bas" dont work propertly witch my LCD:

Black screen.

But when I program it from this code :

or i Landscape Test SSD1963.bas change initialisation for this:
Sub Ssd1963_init

Cs_disp = 0
Lcd_res = 1
Waitms 50
Lcd_res = 0
Waitms 50
Lcd_res = 1
Waitms 50

Call Ssd1963_select_reg(&He2)                               'PLL multiplier, set PLL clock to 120M
Call Ssd1963_write_data(&H0023)                             'N=0x36 for 6.5M, 0x23 for 10M crystal
Call Ssd1963_write_data(&H0002)
Call Ssd1963_write_data(&H0004)

Call Ssd1963_select_reg(&He0)                               'PLL enable
Call Ssd1963_write_data(&H0001)
Waitms 1
Call Ssd1963_select_reg(&He0)
Call Ssd1963_write_data(&H0003)
Waitms 5
Call Ssd1963_select_reg(&H01)                               'software reset
Waitms 5
Call Ssd1963_select_reg(&He6)                               'PLL setting for PCLK, depends on resolution
Call Ssd1963_write_data(&H0003)
Call Ssd1963_write_data(&H00ff)
Call Ssd1963_write_data(&H00ff)

Call Ssd1963_select_reg(&Hb0)                               'LCD SPECIFICATION
Call Ssd1963_write_data(&H0027)
Call Ssd1963_write_data(&H0000)
Whulp1 = High(hdp)                                          'Set HDP
Call Ssd1963_write_data(whulp1)
Whulp1 = Low(hdp)
Call Ssd1963_write_data(whulp1)
Whulp1 = High(vdp)                                          'Set VDP
Call Ssd1963_write_data(whulp1)
Whulp1 = Low(vdp)
Call Ssd1963_write_data(whulp1)
Call Ssd1963_write_data(&H0000)

Call Ssd1963_select_reg(&Hb4)                               'HSYNC
Whulp1 = High(ht)                                           'Set HT
Call Ssd1963_write_data(whulp1)
Whulp1 = Low(ht)
Call Ssd1963_write_data(whulp1)
Whulp1 = High(hps)                                          'Set HPS
Call Ssd1963_write_data(whulp1)
Whulp1 = Low(hps)
Call Ssd1963_write_data(hpw)                                'Set HPW
Whulp1 = High(lps)                                          'Set LPS
Call Ssd1963_write_data(whulp1)
Whulp1 = Low(lps)
Call Ssd1963_write_data(&H0000)

Call Ssd1963_select_reg(&Hb6)                               'VSYNC
Whulp1 = High(vt)                                           'Set VT
Call Ssd1963_write_data(whulp1)
Whulp1 = Low(vt)
Call Ssd1963_write_data(whulp1)
Whulp1 = High(vps)                                          'Set VPS
Call Ssd1963_write_data(whulp1)
Whulp1 = Low(vps)
Call Ssd1963_write_data(vpw)                                'Set VPW
Whulp1 = High(fps)                                          'Set FPS
Call Ssd1963_write_data(whulp1)
Whulp1 = Low(fps)

Call Ssd1963_select_reg(&Hba)
Call Ssd1963_write_data(&H000f)                             'GPIO[3:0] out 1

Call Ssd1963_select_reg(&Hb8)
Call Ssd1963_write_data(&H0007)                             'GPIO3=input, GPIO[2:0]=output
Call Ssd1963_write_data(&H0001)                             'GPIO0 normal

Call Ssd1963_select_reg(&H08)                               'rotation - Set the read order from frame buffer to the display panel  

'writing from bottom to top
'Call Ssd1963_write_data(&H0000)
'writing from top to bottom
Call Ssd1963_write_data(&H0001)
'writing from right to left
'Call Ssd1963_write_data(&H0077)
'Call Ssd1963_write_data(&H0006)

Call Ssd1963_select_reg(&Hf0)                               'pixel data interface
Call Ssd1963_write_data(&H0003)                             '16-bit (565 format)

Waitms 5

Call Ssd1963_select_reg(&H29)                               'display on

Call Ssd1963_select_reg(&Hd0)
Call Ssd1963_write_data(&H000d)
End Sub

...LCD display correctly direction and orientation (i test onlu portrait mode), but colors are different.

I trying to change bit 3 from register 36 of displays (RGB to BGR) but colors still has wrong, and colors are differend.
For example text witch schould be Red is Black Sad

What can I do more, to LCD colors properly?

PROBLEM RESOLVED...I CHANGE TFT panel data width by register B0:

Call Ssd1963_select_reg(&Hb0)                               'LCD SPECIFICATION
Call Ssd1963_write_data(&H0000)

In my LCD is 18-bit data panel .

(BASCOM-AVR version : )
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum