View previous topic :: View next topic |
Author |
Message |
GrainyPCB
Joined: 30 Jan 2013 Posts: 12 Location: Cincinnati, OH
|
Posted: Fri Feb 21, 2014 3:25 pm Post subject: |
|
|
Ennio,
Look in the SSD1963 datasheet for control register 36h. You should be able to change this setting in the initialization routine to fix your rotation/orientation issues. I need &h09 for my setup. My current problem is one version of code I'm using accepts changes in this value and Mrshilov's doesn't. Still working on it...
Code: | Ssd1963_select_reg &H36 'Set the read order from frame buffer to the display panel
Ssd1963_write_data &H09 'BGR |
|
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5920 Location: Holland
|
Posted: Fri Feb 21, 2014 3:53 pm Post subject: |
|
|
i found nothing odd in your code. except that you have different init code at some places. but that is most likely because you have a different lcd.
so it is good you got it to work. the register settings indeed hold the key to these problems. good luck! _________________ Mark |
|
Back to top |
|
|
GrainyPCB
Joined: 30 Jan 2013 Posts: 12 Location: Cincinnati, OH
|
Posted: Fri Feb 21, 2014 4:40 pm Post subject: |
|
|
I figured it out. Many of Mrshilov's subroutines change the Page/Column Address Order of the 36h register, for example:
Code: | Sub Lcd_clear(byval Color As Word)
Ssd1963_select_reg &H36 'Change X/Y order
Ssd1963_write_data &H03
...(then back)
Ssd1963_select_reg &H36 'Normal X/Y order
Ssd1963_write_data &H23 |
So just modifying the initialization routine will not work. This is what I did to find the settings I needed:
Code: | Const Xynormal = &H28
Const Xyflipped = &H08 |
and the subroutines:
Code: | Ssd1963_select_reg &H36 'Change X/Y order
Ssd1963_write_data Xyflipped
...
Ssd1963_select_reg &H36 'Normal X/Y order
Ssd1963_write_data Xynormal |
|
|
Back to top |
|
|
enniom
Joined: 20 Oct 2009 Posts: 537
|
Posted: Sat Feb 22, 2014 11:14 pm Post subject: |
|
|
Thanks GrainyPCB.
I had worked with that same register &H36 ... but the routines prepared by Hipnik, Six1 and MrShilov defaulted to having the screen start (X,Y)=(0,0) at the lower right corner of the LCD (when viewed in landscape mode) on my LCD. This was confusing.
So, to have the BMP photograph files and text show correctly - at least on my 480x272 LCD - the LCD initialization needed this:
Code: |
Call Ssd1963_select_reg(&H36) 'Set the read order from frame buffer to the display panel
Call Ssd1963_write_data(&B0000_0001) 'SD card landscape 0,0 at lower right
|
|
|
Back to top |
|
|
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
Posted: Sun Feb 23, 2014 6:21 am Post subject: BGR instead of RGB |
|
|
About the color BGR instead of RGB...
Do a search in the German Bascom-forum. I put there this note, but there was also a note from Heiko aka HKipnik about reversing the colors.
Code: |
' Call Ssd1963_select_reg(set_hori_period) 'Set HBP B4
' Call Ssd1963_write_data(&H03)
' Call Ssd1963_write_data(&H52)
' Call Ssd1963_write_data(&H00)
' Call Ssd1963_write_data(&H33)
' Call Ssd1963_write_data(&H30)
' Call Ssd1963_write_data(&H00)
' Call Ssd1963_write_data(&H03)
' Call Ssd1963_write_data(&H00)
' changes Ben made
Call Ssd1963_select_reg(set_hori_period) 'Set HBP B4
Call Ssd1963_write_data(&H02)
Call Ssd1963_write_data(&Hf8 )
Call Ssd1963_write_data(&H00)
Call Ssd1963_write_data(&H44)
Call Ssd1963_write_data(&H0f)
Call Ssd1963_write_data(&H00)
Call Ssd1963_write_data(&H00)
Call Ssd1963_write_data(&H00)
' Call Ssd1963_select_reg(set_vert_period) 'SET VBP B6
' Call Ssd1963_write_data(&H02)
' Call Ssd1963_write_data(&H12)
' Call Ssd1963_write_data(&H00)
' Call Ssd1963_write_data(&H32)
' Call Ssd1963_write_data(&H03)
' Call Ssd1963_write_data(&H00)
' Call Ssd1963_write_data(&H1e)
' changes Ben made
Call Ssd1963_select_reg(set_vert_period) 'SET VBP B6
Call Ssd1963_write_data(&H01)
Call Ssd1963_write_data(&Hf8 )
Call Ssd1963_write_data(&H00)
Call Ssd1963_write_data(&H13)
Call Ssd1963_write_data(&H07)
Call Ssd1963_write_data(&H00)
|
Have fun
Ben Zijlstra |
|
Back to top |
|
|
Ajaxelectronic
Joined: 22 Nov 2009 Posts: 171 Location: Iran
|
Posted: Thu May 01, 2014 11:52 am Post subject: |
|
|
Hi
i have a 4.3" TFT LCD. it work with Hipnik, Six1 code very Good. but i can't drive my LCD in Vertical mode.
can any one help me? _________________ www.mrkelectronic.blogfa.com
Best Regards |
|
Back to top |
|
|
Lewandowski
Joined: 04 May 2012 Posts: 1 Location: Lüneburg
|
Posted: Sun May 11, 2014 5:09 pm Post subject: |
|
|
Hallo,
es gibt einen Fehler in der Sub LCD_text und Sub Lcd_text_color
im Register H2B wird das H- Byte nicht geschrieben
der Text wird ab Zeile 240 abgeschnitten.
Hier ist der ergänzte Codeabschnitt, danach läuft alles ohne Probleme
Data_disp_low = &H2B : Rs_disp = 0 : Wr_disp = 0 : Wr_disp = 1 '------ Y
Data_disp_low = Temp_y_ssd1963_h : Rs_disp = 1 : Wr_disp = 0 : Wr_disp = 1
Data_disp_low = Temp_y_ssd1963_l : Wr_disp = 0 : Wr_disp = 1
Data_disp_low = 1 : Wr_disp = 0 : Wr_disp = 1
Data_disp_low = &HDF : Wr_disp = 0 : Wr_disp = 1
Data_disp_low = &H2A : Rs_disp = 0 : Wr_disp = 0 : Wr_disp = 1 '------ X
Data_disp_low = Temp_x_ssd1963_h : Rs_disp = 1 : Wr_disp = 0 : Wr_disp = 1
Data_disp_low = Temp_x_ssd1963_l : Wr_disp = 0 : Wr_disp = 1
Data_disp_low = 3 : Wr_disp = 0 : Wr_disp = 1
Data_disp_low = &H1F : Wr_disp = 0 : Wr_disp = 1
Data_disp_low = &H2C : Rs_disp = 0 : Wr_disp = 0 : Wr_disp = 1
Rs_disp = 1
Super Arbeit von Mrshilov
Gruß
Carsten Lewandowski |
|
Back to top |
|
|
Mrshilov
Joined: 24 Jan 2009 Posts: 314 Location: Russia
|
Posted: Mon May 12, 2014 3:15 pm Post subject: |
|
|
Thank you. I found more errors in SSD1963 library, also in SSD1298 & ILI9325. I will publish updated libraries soon.
It will be with "Landscape/Portrait" mode, TouchScreen examples and Proteus models. |
|
Back to top |
|
|
Tubeampman
Joined: 27 Feb 2006 Posts: 100 Location: Bodo
|
Posted: Tue May 13, 2014 7:01 pm Post subject: XMEGA |
|
|
Hi
Can i please ask the xmega gurus for some help making this superb code work on xmega.
I have a Xmega128A1, everything looks good, but when it comes to SD-card i get errors when compiling.
It says unsupported comand or something in that direction.
In the TestSSD1963.bas:
' For load Pictures from SPI-ROM you must configure SPI:
Config Spi = Hard , Interrupt = Off , Data Order = Msb , Master = Yes , Polarity = High , Phase = 1 , Clockrate = 4 , Noss = 1
Spsr.0 = 1 : Spcr.0 = 0 : Spcr.1 = 0 'F_spi = F_osc / 2
Ss_spi_rom Alias Portb.6 : Config Ss_spi_rom = Output : Ss_spi_rom = 1 'Chip Select pin
Spiinit
And in SSD1963 16bit Library.INC:
'-------------------------------------------------------------------------------
' Draw 16-bit Picture from SPI-ROM
' X start - Y start - Width - Height - Address
'-------------------------------------------------------------------------------
Sub Lcd_pic_spi(byval Xs As Word , Byval Ys As Word , Byval Width As Word , Byval Height As Word , Byval Address As Dword)
Local Count_x As Word , Count_y As Word
Ssd1963_select_reg &H36 'Change X/Y order
Ssd1963_write_data &H03
Temp_x_ssd1963 = Xs + Width : Temp_y_ssd1963 = Ys + Height
Decr Temp_y_ssd1963 : Decr Temp_x_ssd1963
Data_disp_low = &H2A : Rs_disp = 0 : Wr_disp = 0 : Wr_disp = 1
Data_disp_low = High(xs) : Rs_disp = 1 : Wr_disp = 0 : Wr_disp = 1
Data_disp_low = Low(xs) : Wr_disp = 0 : Wr_disp = 1
Data_disp_low = High(temp_x_ssd1963) : Wr_disp = 0 : Wr_disp = 1
Data_disp_low = Low(temp_x_ssd1963) : Wr_disp = 0 : Wr_disp = 1
Data_disp_low = &H2B : Rs_disp = 0 : Wr_disp = 0 : Wr_disp = 1
Data_disp_low = High(ys) : Rs_disp = 1 : Wr_disp = 0 : Wr_disp = 1
Data_disp_low = Low(ys) : Wr_disp = 0 : Wr_disp = 1
Data_disp_low = High(temp_y_ssd1963) : Wr_disp = 0 : Wr_disp = 1
Data_disp_low = Low(temp_y_ssd1963) : Wr_disp = 0 : Wr_disp = 1
Ss_spi_rom = 0 'Select SPI-ROM
Data_disp_high = 0 : Data_disp_low = &H2C '------- Data
Rs_disp = 0 : Wr_disp = 0 : Wr_disp = 1 : Rs_disp = 1
Spi_address_ssd1963 = Address : Temp_x_ssd1963_l = 3
Spiout Temp_x_ssd1963_l , 1 : Spiout Spi_address_ssd1963_3 , 1 'Start reading
Spiout Spi_address_ssd1963_2 , 1 : Spiout Spi_address_ssd1963_1 , 1
For Count_y = 1 To Height
For Count_x = 1 To Width
Spiin Temp_x_ssd1963 , 2 'Read 2 bytes from ROM
Data_disp_high = Temp_x_ssd1963_l : Data_disp_low = Temp_x_ssd1963_h
Wr_disp = 0 : Wr_disp = 1
Next Count_x
Next Count_y
Ss_spi_rom = 1 'deselect SPI-ROM
Ssd1963_select_reg &H36 'Normal X/Y order
Ssd1963_write_data &H23
End Sub
Am not the best programmer so i hope someone can take a few minutes to help me.
Best regards
Oyvind |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5920 Location: Holland
|
Posted: Wed May 14, 2014 9:19 am Post subject: |
|
|
i did not test but i think you only need to replace the config spi with : Config Spic = Hard , Master = Yes , Mode = 0 , Clockdiv = Clk2 , Data_order = Msb
then use the SPI from portC to get default SPIC. _________________ Mark |
|
Back to top |
|
|
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
Posted: Wed May 14, 2014 11:07 am Post subject: check wiki.... |
|
|
An example with an atxmega128a1, an 7 inch display and sd-card can be found in the wiki. The Sd-card of the atxmega128a1 module is used...
Have fun
Ben Zijlstra |
|
Back to top |
|
|
Tubeampman
Joined: 27 Feb 2006 Posts: 100 Location: Bodo
|
Posted: Wed May 14, 2014 3:10 pm Post subject: |
|
|
Hi
Thank you both so much for the help, i will tell how it wnt after testing
Øyvind |
|
Back to top |
|
|
Mrshilov
Joined: 24 Jan 2009 Posts: 314 Location: Russia
|
Posted: Sat May 17, 2014 4:38 pm Post subject: |
|
|
Prerelease of new library.
With "Portrait" and "Rotate_180" constants may choose any of 4 possible positions of LCD.
Added "Brightness", "Contrast" and "Saturation" commands. |
|
Back to top |
|
|
sasha_1973
Joined: 30 Jul 2013 Posts: 58
|
Posted: Thu Nov 06, 2014 9:20 am Post subject: |
|
|
[quote="Evert "]Always nice to see that big parts of my code is re-used.
Many thanks for your examples!!! |
|
Back to top |
|
|
Tatysb29
Joined: 04 Jan 2015 Posts: 1
|
Posted: Sun Mar 01, 2015 11:03 pm Post subject: |
|
|
Hello im new in this post, i would like you please help me im using a screen INT070ATFT - TS it uses a microcontroller SSD1963 and for touch screen uses a MAXIM MAX11802. After some tries i finally got my lcd showing pictures from an external sd card. Now im trying to use the touch panel but after some tries i cant get anything. The controller for the touch screen uses spi interface plus has an interrupt. I press the screen and the interrupt is not working. I dont know what to do, i would like u please provide me a code for initialization of the maxim and code in order to use the screen
thank you waiting for ur answers |
|
Back to top |
|
|
|