View previous topic :: View next topic |
Author |
Message |
mariuss_suciu
Joined: 28 Mar 2014 Posts: 11
|
Posted: Mon Jul 25, 2016 8:21 pm Post subject: Library for 2.4 inch TFT |
|
|
Hello all,
I`ve buyed one 2.4inch TFT from aliexpress, but I don`t know which type of controller is inside, can somebody help me to identify it ? If is possible to send me a library and a small bascom test code will be more than appreciate.
Thanks,
Marius.
(BASCOM-AVR version : 2.0.7.8 ) |
|
Back to top |
|
|
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
|
Back to top |
|
|
mariuss_suciu
Joined: 28 Mar 2014 Posts: 11
|
Posted: Tue Jul 26, 2016 5:34 pm Post subject: |
|
|
Hi,
@bzijlstra , thanks for your help, but unfortunatelly I didn`t found a library for my LCD module.
L.E. I think I found the controller type: SPDF5408 ; Trying with an arduino example from internet, using this library, the display is working correctly.
Have somebody a compatible library for BASCOM ? |
|
Back to top |
|
|
Plons
Joined: 24 May 2005 Posts: 435 Location: Hilversum - The Netherlands
|
|
Back to top |
|
|
Mrshilov
Joined: 24 Jan 2009 Posts: 314 Location: Russia
|
|
Back to top |
|
|
mariuss_suciu
Joined: 28 Mar 2014 Posts: 11
|
Posted: Wed Jul 27, 2016 6:24 pm Post subject: |
|
|
Hello @Mrshilov,
Thanks for your help, but something is not clear for me. I saw in the bascom test code that we need to allocate 2 * 8bit port (Port A & C) as Data Line + 4 control signals. My LCD have only 8 data lines + 5 control signals.
Now I`m a little bit confused and I don`t know if is a way with this library to work with my LCD, because I don`t know how to connect them.
My LCD have the connections:
D0 - D7 (8 bit data lines)
RST
CS
RS
WR
RD |
|
Back to top |
|
|
Mrshilov
Joined: 24 Jan 2009 Posts: 314 Location: Russia
|
Posted: Wed Jul 27, 2016 8:36 pm Post subject: |
|
|
I modify library for 8-bit. Not tested, because I haven't this LCD.
(RD must be connected to +) |
|
Back to top |
|
|
mariuss_suciu
Joined: 28 Mar 2014 Posts: 11
|
Posted: Wed Jul 27, 2016 8:54 pm Post subject: |
|
|
I`ve tried but not working. The MCU which I use is Atmega128-16AU, but I think this is not a problem.
The connections are:
PORTA[0-7] = LCD_D[0-7]
PORTC.0 = LCD_RST
PORTC.1 = LCD_CS
PORTC.2 = LCD_RS
PORTC.3 = LCD_WR
PORTC.4 = LCD_RD (but not declared in test software) -> Later edit: I had tried also with RD connected to +, but still not workiing
The code is compiling without any error.
Code: | $Regfile="m128def.dat"
$Crystal=8000000
$hwstack=40
$swstack=16
$framesize=32
'--------------------------- Pin Configuration ---------------------------------
Data_disp Alias Porta : Config Data_disp = Output 'Data Port
Rs_disp Alias PortC.2 : Config Rs_disp = Output 'Command/Data pin
Wr_disp Alias PortC.3 : Config Wr_disp = Output 'Write pin
Res_disp Alias PortC.0 : Config Res_disp = Output : Res_disp = 1 'Reset pin
Cs_disp Alias PortC.1 : Config Cs_disp = Output : Cs_disp = 0 'Chip Select |
|
|
Back to top |
|
|
Mrshilov
Joined: 24 Jan 2009 Posts: 314 Location: Russia
|
Posted: Wed Jul 27, 2016 9:15 pm Post subject: |
|
|
Stack is too low. Try this:
Code: | $hwstack = 128
$swstack = 128
$framesize = 128 |
|
|
Back to top |
|
|
mariuss_suciu
Joined: 28 Mar 2014 Posts: 11
|
Posted: Wed Jul 27, 2016 9:29 pm Post subject: |
|
|
Still not working.
Code: | $Regfile="m128def.dat"
$Crystal=8000000
$hwstack=128
$swstack=128
$framesize=128
'--------------------------- Pin Configuration ---------------------------------
Data_disp Alias Porta : Config Data_disp = Output 'Data Port
Rs_disp Alias PortC.2 : Config Rs_disp = Output 'Command/Data pin
Wr_disp Alias PortC.3 : Config Wr_disp = Output 'Write pin
Res_disp Alias PortC.0 : Config Res_disp = Output : Res_disp = 1 'Reset pin
Cs_disp Alias PortC.1 : Config Cs_disp = Output : Cs_disp = 0 'Chip Select |
|
|
Back to top |
|
|
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
Posted: Thu Jul 28, 2016 12:41 pm Post subject: Analyze display... |
|
|
mariuss_suciu
Compare the init routine. Arduino C code and Bascom-code. Then you will know if you got the right Bascom software.
Put some delays in the routine to write to the display. Just to be sure.
In the arduino software, in the routine to write to the display, do a serialprint of the values and capture that in a log file.
Compare the logfile to the init routine of several display controllers.
That is the way I got several unknown displays working. Now I only buy from Chinese Electronics (CE) when I know what controller is used.
Have fun
Ben Zijlstra |
|
Back to top |
|
|
mariuss_suciu
Joined: 28 Mar 2014 Posts: 11
|
Posted: Thu Jul 28, 2016 8:08 pm Post subject: |
|
|
Hi @bzijlstra
The two libraries are completely different as structure , and honestly, I don`t know what is happening there. I taked a look into all files with notepad++, but I can`t identify where is the init routine.
Regarding the serial print, I`ve lost my USB <-> RS232 adapter, and I have to wait until another one will arrive from China, but I saw something in arduino library at the beginning, looks like the lcd id: "void begin(uint16_t id = 0x9325);" . I think, this is de LCD model which I have ?
Attached are both libraries, if you have time and can help me
Thanks a lot.
Marius |
|
Back to top |
|
|
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
|
Back to top |
|
|
|