Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

SSD1963 bad colors

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
daro

Bascom Member



Joined: 15 Nov 2010
Posts: 25

blank.gif
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:
https://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&p=64606#64606
This is "Fast library for SSD1963 LCD" by Mrshilov.

This code "Landscape Test SSD1963.bas" dont work propertly witch my LCD: https://www.aliexpress.com/item/7-0-7-inch-800-480-TFT-Touch-LCD-Module-Display-Screen-Panel-with-PCB-Adapter/32916913295.html?spm=a2g0s.9042311.0.0.298e4c4dnceTBr

Black screen.

But when I program it from this code : https://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=11500&highlight=ssd1963

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

Cs_disp = 0
'Reset
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?

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

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

In my LCD is 18-bit data panel .

(BASCOM-AVR version : 2.0.8.1 )
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com 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