View previous topic :: View next topic |
Author |
Message |
Alexander-Dan
Joined: 13 Mar 2014 Posts: 111 Location: S.Posad
|
Posted: Thu Jan 20, 2022 10:03 am Post subject: ST7793, correct commands to activate |
|
|
I have bought an ST7793 display. https://aliexpress.com/item/32956967893.html
The seller provided the code for the Arduino (OPENSMART_TFT and Adafruit_GFX). I connected the display to the Arduino board (the data bus is parallel) and compiled the project. The display shows symbols and graphical objects.
The Arduino working code initializes the display correctly. With the Arduino code this display works correctly.
So there is no problem with the 3.3v power supply and all signals are properly applied.
But I can't initialize correctly in Bascom. I used the code from the Arduino project as a basis for the algorithm.
But the screen remains unchanged. Sometimes the screen flickers briefly and changes brightness for a fraction of a second.
Maybe someone can give me the correct commands to initialise the ST7793?
(BASCOM-AVR version : 2.0.8.5 , Latest : 2.0.8.5 ) |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Thu Jan 20, 2022 9:34 pm Post subject: |
|
|
you best show the init code that works, and the bascom code you made. _________________ Mark |
|
Back to top |
|
|
Alexander-Dan
Joined: 13 Mar 2014 Posts: 111 Location: S.Posad
|
Posted: Sat Jan 22, 2022 10:03 am Post subject: |
|
|
Thank you for your support, Mark
I'll post the code during this week, I'm working on several projects and am a bit busy at the moment. |
|
Back to top |
|
|
Alexander-Dan
Joined: 13 Mar 2014 Posts: 111 Location: S.Posad
|
Posted: Sun Feb 06, 2022 10:53 pm Post subject: |
|
|
Hi
I apologise for my silence: I was busy with another project.
I use 8 bits of data to transmit data from the controller to the display.
I have used two data sources, there are some differences in them.
The screen flickers, its brightness varies from bright white to hardly noticeable. There are no inscriptions or dots on the display.
I use the following code to output data to the registers:
Code: |
'-------------------------------------------------------------------------------
Sub Lcd_send_command(byval Reg_lcd As Word , Byval Dat_lcd As Word)
Rgb16 = Reg_lcd
' Cs_disp = 0
Rs_disp = 0
Data_disp_low = Rgb16_high ' High(daten)
Wr_disp = 0
Wr_disp = 1
Data_disp_low = Rgb16_low ' High(daten)
Wr_disp = 0
Wr_disp = 1
Rs_disp = 1
' Cs_disp = 1
nop
' Cs_disp = 0
Rgb16 = Dat_lcd
Data_disp_low = Rgb16_high ' High(daten)
Wr_disp = 0
Wr_disp = 1
Data_disp_low = Rgb16_low ' High(daten)
Wr_disp = 0
Wr_disp = 1
' Cs_disp = 1
End Sub
|
https://github.com/Utyff/f3/blob/ed45fdb3c7118c83eba87abd8ae239dbb4bddcbd/usr/inc/lcd_gpio.h
https://github.com/Utyff/f3/blob/ed45fdb3c7118c83eba87abd8ae239dbb4bddcbd/usr/src/lcd.c
Code: |
Sub Lcd_init()
Res_disp = 0
Waitms 10
Res_disp = 1
Waitms 100
Call Lcd_send_command(&H0001 , &H0100):
Call Lcd_send_command(&h0003, &h1030): ' 9030
Call Lcd_send_command(&h0008, &h0808):
Call Lcd_send_command(&h0090, &h8000):
Call Lcd_send_command(&h0400, &h6200):
Call Lcd_send_command(&h0401, &h0001):
' -----------------------------------End Display Control setting-----------------------------------------'
' -------------------------------- Power Control Registers Initial --------------------------------------'
Call Lcd_send_command(&h00ff, &h0001):
Call Lcd_send_command(&h0102, &h01b0):
Call Lcd_send_command(&h0710, &h0016):
Call Lcd_send_command(&h0712, &h000f):
Call Lcd_send_command(&h0752, &h002f):
Call Lcd_send_command(&h0724, &h001a):
Call Lcd_send_command(&h0754, &h002a):
' ---------------------------------End Power Control Registers Initial -------------------------------'
Waitms 100
' ----------------------------------Display Windows 240 X 400----------------------------------------'
Call Lcd_send_command(&H0210 , &H0000):
Call Lcd_send_command(&h0211, &h00ef):
Call Lcd_send_command(&h0212, &h0000):
Call Lcd_send_command(&H0213 , &H018F):
' ----------------------------------End Display Windows 240 X 400----------------------------------'
Waitms 10
' -------------------------------------Gamma Cluster Setting-------------------------------------------'
Call Lcd_send_command(&h0380, &h0000):
Call Lcd_send_command(&h0381, &h5f10):
Call Lcd_send_command(&h0382, &h0b02):
Call Lcd_send_command(&h0383, &h0614):
Call Lcd_send_command(&h0384, &h0111):
Call Lcd_send_command(&H0385 , &H0000):
Call Lcd_send_command(&H0386 , &HA90B):
Call Lcd_send_command(&h0387, &h0606):
Call Lcd_send_command(&h0388, &h0612):
Call Lcd_send_command(&H0389 , &H0111):
' ---------------------------------------End Gamma Setting---------------------------------------------'
' ---------------------------------------Vcom Setting---------------------------------------------'
Call Lcd_send_command(&h0702, &h003b):
Call Lcd_send_command(&H00ff , &H0000):
' ---------------------------------------End Vcom Setting---------------------------------------------'
Call Lcd_send_command(&H0007 , &H0100):
Waitms 200 ' Delay 200ms
Call Lcd_send_command(&H0200 , &H0000):
Call Lcd_send_command(&H0201 , &H0000)
Waitms 20
End Sub
|
Code: |
Call Lcd_send_command(&H0001 , &H0100) ' &h0000 Down
Call Lcd_send_command(&H0003 , &H1038) ' Brg
Call Lcd_send_command(&H0008 , &H0808) '
Call Lcd_send_command(&H0090 , &H8000) '
Call Lcd_send_command(&H0400 , &H6200) ' GS=0
Call Lcd_send_command(&H0401 , &H0001) '
' -------------------------------- Power Control Registers Initial ---------------------------'
Call Lcd_send_command(&H00ff , &H0001) '
Call Lcd_send_command(&H0102 , &H01B0) '
Call Lcd_send_command(&H0710 , &H0014) '
Call Lcd_send_command(&H0712 , &H000F) '
Call Lcd_send_command(&H0752 , &H001F) '
Call Lcd_send_command(&H0759 , &H0070) '
Waitms 100
' -------------------------------------Gamma Cluster Setting----------------------------------'
Call Lcd_send_command(&H0380 , &H0303) '
Call Lcd_send_command(&H0381 , &H481F) '
Call Lcd_send_command(&H0382 , &H0803) '
Call Lcd_send_command(&H0383 , &H030F) '
Call Lcd_send_command(&H0384 , &H2230) '
Call Lcd_send_command(&H0385 , &H0300) '
Call Lcd_send_command(&H0386 , &H491E) '
Call Lcd_send_command(&H0387 , &H0703) '
Call Lcd_send_command(&H0388 , &H070F) '
Call Lcd_send_command(&H0389 , &H2230) '
' ---------------------------------------Vcom Setting-----------------------------------------'
Call Lcd_send_command(&H0702 , &H0060) '
Call Lcd_send_command(&H00ff , &H0000) '
Call Lcd_send_command(&H0007 , &H0100) '
|
|
|
Back to top |
|
|
|
|
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
|
|