Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Library for 2.4 inch TFT

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

Bascom Member



Joined: 28 Mar 2014
Posts: 11

PostPosted: Mon Jul 25, 2016 8:21 pm    Post subject: Library for 2.4 inch TFT Reply with quote

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
View user's profile
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Mon Jul 25, 2016 9:22 pm    Post subject: list of displays and source code... Reply with quote

Have a look at this link

http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=13074

Have fun
Ben Zijlstra
Back to top
View user's profile Visit poster's website
mariuss_suciu

Bascom Member



Joined: 28 Mar 2014
Posts: 11

PostPosted: Tue Jul 26, 2016 5:34 pm    Post subject: Reply with quote

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
View user's profile
Plons

Bascom Member



Joined: 24 May 2005
Posts: 434
Location: Hilversum - The Netherlands

netherlands.gif
PostPosted: Tue Jul 26, 2016 11:37 pm    Post subject: Reply with quote

I use the ILI9341 lib but that may be for a TFT from an older batch, ..... although it looks the same.

link: http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&p=71730#71730

_________________
Bascom AVR ver 2.0.8.1
ProtectedParallelPortProgrammingDongle: http://www.aplomb.nl/TechStuff/PPPD/PPPD%20English.html
Dragon-lair: http://www.aplomb.nl/TechStuff/Dragon/Dragon.html
"leef met vlag en wimpel, maar hou het simpel"
Back to top
View user's profile
Mrshilov

Bascom LCD Guru



Joined: 24 Jan 2009
Posts: 314
Location: Russia

russia.gif
PostPosted: Wed Jul 27, 2016 4:10 am    Post subject: Reply with quote

SPFD5408 is very close to ILI9320. Try this lib http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=9268&start=0&postdays=0&postorder=asc&highlight=
or attached one.

Maybe need to rem this string:
Code:
Ili9320_write_reg 0 , &H0001                                'Start Oscillation

See attached datasheets.
Back to top
View user's profile
mariuss_suciu

Bascom Member



Joined: 28 Mar 2014
Posts: 11

PostPosted: Wed Jul 27, 2016 6:24 pm    Post subject: Reply with quote

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
View user's profile
Mrshilov

Bascom LCD Guru



Joined: 24 Jan 2009
Posts: 314
Location: Russia

russia.gif
PostPosted: Wed Jul 27, 2016 8:36 pm    Post subject: Reply with quote

I modify library for 8-bit. Not tested, because I haven't this LCD.
(RD must be connected to +)
Back to top
View user's profile
mariuss_suciu

Bascom Member



Joined: 28 Mar 2014
Posts: 11

PostPosted: Wed Jul 27, 2016 8:54 pm    Post subject: Reply with quote

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
View user's profile
Mrshilov

Bascom LCD Guru



Joined: 24 Jan 2009
Posts: 314
Location: Russia

russia.gif
PostPosted: Wed Jul 27, 2016 9:15 pm    Post subject: Reply with quote

Stack is too low. Try this:

Code:
$hwstack = 128
$swstack = 128
$framesize = 128
Back to top
View user's profile
mariuss_suciu

Bascom Member



Joined: 28 Mar 2014
Posts: 11

PostPosted: Wed Jul 27, 2016 9:29 pm    Post subject: Reply with quote

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
View user's profile
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Thu Jul 28, 2016 12:41 pm    Post subject: Analyze display... Reply with quote

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
View user's profile Visit poster's website
mariuss_suciu

Bascom Member



Joined: 28 Mar 2014
Posts: 11

PostPosted: Thu Jul 28, 2016 8:08 pm    Post subject: Reply with quote

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 Smile

Thanks a lot.

Marius
Back to top
View user's profile
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Fri Jul 29, 2016 9:25 pm    Post subject: ILI9325 8-bit Reply with quote

It is a ILI9325 8-bit

You could have a look at this code

http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=9823&highlight=ili9325

Have fun
Ben Zijlstra
Back to top
View user's profile Visit poster's website
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