Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Fast library for ILI9325 LCD
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here
View previous topic :: View next topic  
Author Message
sstewart

Bascom Member



Joined: 16 Aug 2004
Posts: 57

usa.gif
PostPosted: Fri Apr 11, 2014 8:54 pm    Post subject: Fast library for ILI9325 LCD Reply with quote

I've attached a more complete 56 pixel font, going from 0 to capital Z. You have to set " Digit_font = 0 " or it displays a character 15 places back.

In the original Font36x56 it seems to use the Digit_font variable to enable a smaller font table for 0 to 9 by setting 0 in the ! location ( ascii 33 ), 1 in the " location ( ascii 34 ), etc...
Back to top
View user's profile
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 932
Location: France

france.gif
PostPosted: Fri May 16, 2014 6:30 pm    Post subject: Reply with quote

Hi mister,
I would like to use your program with an Arduino mega 2560 and
http://www.gotronic.fr/art-shield-ecran-tft-tactile-itead-20390.htm
my questions,
it is compatible with your program ? I understand, perhaps, I have to change the pin configuration.
must I use the 8bit or the 16bits version ?
many thanks to you answers
Jean-Pierre Wink
Back to top
View user's profile Visit poster's website
Mrshilov

Bascom LCD Guru



Joined: 24 Jan 2009
Posts: 314
Location: Russia

russia.gif
PostPosted: Fri Feb 20, 2015 10:14 am    Post subject: Reply with quote

Library updated.
Touch example is specially based on Arduino 2560. Sorry for the delay. You may use both 8 or 16 bit versions on it - depend on display model.
Back to top
View user's profile
boeseturbo

Bascom Member



Joined: 23 Jul 2007
Posts: 31

blank.gif
PostPosted: Mon Apr 06, 2015 9:43 am    Post subject: Reply with quote

Hi friends,

has anybody an idea? I tested this:

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

This code is working. The code from this page isnt working (8bit and also 16 bit tested)...

Is the init different?

Cheers
Back to top
View user's profile
Arek2014

Bascom Member



Joined: 30 Dec 2014
Posts: 20
Location: Kielce

poland.gif
PostPosted: Wed Nov 18, 2015 11:31 pm    Post subject: Reply with quote

Hi.
i have lcd with 16bit interface.
http://allegro.pl/tft-lcd-2-8-ili9325-ekran-dotykowy-i-o-3-3v-5v-i5386083275.html

problem
Lcd_clear Black it not work properly, lcd put black color for while and set white !!!

Lcd_clear works with other colors !!!


when i use:
Lcd_clear Black
Lcd_set_pixel 10 , 10 , White

then lcd will go black with one pixel white Smile

or
Lcd_clear Black
Lcd_text "Pixels" , 90 , 10 , White , Blue ' it works

Lcd_clear Black
Lcd_text "Pixels" , 90 , 10 , White , Black 'black will not do !!

BTW: i must had change this in library for my lcd.
Res_disp = 0 : Waitms 5 : Res_disp = 1 : Waitms 5 'Hardware Reset

when was: Res_disp = 0 : Waitms 5 : Res_disp = 1 'Hardware Reset
don't work

btw nokia n73 have better black color, better contrast - but soldering connector is horror Smile
ili9325 on pcb is super


Pozdrawiam Arek
Back to top
View user's profile
Mrshilov

Bascom LCD Guru



Joined: 24 Jan 2009
Posts: 314
Location: Russia

russia.gif
PostPosted: Thu Nov 19, 2015 1:30 am    Post subject: Reply with quote

If you using long wires or display has slow controller the speed may be too fast. Try to slower it:
Code:
Macro Send_data
   Rs_disp = 1 : Nop : Nop : Wr_disp = 0 : Nop : Nop : Wr_disp = 1
End Macro

Macro Send_com
   Rs_disp = 0 : Nop : Nop: Wr_disp = 0 : Nop : Nop : Wr_disp = 1
End Macro

Macro Send
    Nop : Nop : Wr_disp = 0 : Nop : Nop : Wr_disp = 1
End Macro
Back to top
View user's profile
Arek2014

Bascom Member



Joined: 30 Dec 2014
Posts: 20
Location: Kielce

poland.gif
PostPosted: Thu Nov 19, 2015 6:41 pm    Post subject: Reply with quote

hmm it not working Sad

nop, waitms 1, waitus 1 ' that delays not working...

BTW: this is project where i use library nokia n73 and atmega32, it's car on board computer (fuel comsuption, speed, termomether etc...)

https://www.youtube.com/watch?v=aoQUIkSeqr8

https://www.youtube.com/watch?v=97EukbqBw10
Back to top
View user's profile
Mrshilov

Bascom LCD Guru



Joined: 24 Jan 2009
Posts: 314
Location: Russia

russia.gif
PostPosted: Fri Nov 20, 2015 6:36 am    Post subject: Reply with quote

Arek2014 wrote:
Lcd_clear Black
Lcd_text "Pixels" , 90 , 10 , White , Black 'black will not do !!

Can you photo this error?
Back to top
View user's profile
Arek2014

Bascom Member



Joined: 30 Dec 2014
Posts: 20
Location: Kielce

poland.gif
PostPosted: Fri Nov 20, 2015 6:47 pm    Post subject: Reply with quote

my board lcd is v1.2 2.8 TFT240x320

problem is with black color and others colors near &H0000, i think, some test...

https://youtu.be/KnptuE9TsOw

code for this video is:

Macro Send_data
Rs_disp = 1 : Nop : Nop : Wr_disp = 0 : Nop : Nop : Wr_disp = 1
End Macro
Macro Send_com
Rs_disp = 0 :WAITuS 10 : Wr_disp = 0 :waitus 10 : Wr_disp = 1
End Macro
Macro Send
waitus 10 : Wr_disp = 0 : waitus 10 : Wr_disp = 1
End Macro

Lcd_clear White
Restore Color8x8 '****** Color Font Text
Lcd_text_color "Color Font text 'Color8x8'" , 55 , 65 , Black , White
Restore Color16x16
Lcd_text_color "Font 'Color16x16' " , 25 , 100 , Darkgreen , White
Wait 2

Lcd_clear White
Restore Font12x16
Lcd_text "Clear Screen" , 11 , 80 , Black , White '****** Clear Screen
Lcd_text " B&W" , 11 , 120 , Black , White
Wait 2
Lcd_clear Black
Lcd_text " " , 90 , 10 , blue , red
Wait 1
Lcd_clear White
Wait 1
Lcd_clear Black
Wait 1
Lcd_clear White
Restore Font12x16
Lcd_text "Clear Screen" , 11 , 80 , Brown , white
Lcd_text "with color" , 35 , 120 , Blue , white
Wait 2
Lcd_clear Red : Waitms 500
Lcd_clear Green : Waitms 500
Lcd_clear Blue : Waitms 500
Back to top
View user's profile
Arek2014

Bascom Member



Joined: 30 Dec 2014
Posts: 20
Location: Kielce

poland.gif
PostPosted: Sun Nov 22, 2015 3:21 pm    Post subject: Reply with quote

i try run touchpad XPT2046, no succes....

when tap finger lcd feel it, but x,y are 0,0 Sad
Back to top
View user's profile
Mrshilov

Bascom LCD Guru



Joined: 24 Jan 2009
Posts: 314
Location: Russia

russia.gif
PostPosted: Sun Nov 22, 2015 4:08 pm    Post subject: Reply with quote

I test your source. All works fine. Check hardware. Especially this:
Code:
Dout_touch Alias Portd.3 : Config Dout_touch = Output       'XPT2046 Din Pin
Din_touch Alias Pind.4 : Config Din_touch = Input           'XPT2046 Dout Pin

Dout_touch must be connected to Din LCD pin.
Din_touch must be connected to Dout LCD pin.
Back to top
View user's profile
bzijlstra

Bascom Ambassador



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

netherlands.gif
PostPosted: Sun Nov 22, 2015 4:10 pm    Post subject: Touch on ili9325 Reply with quote

Have used the ILI9325 display in several projects, one of them is the Word Clock. It is published in this forum. Perhaps you can have a look at the touchscreen part of that program to get your touchscreen running.

Interrupt driven.

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

Bascom Member



Joined: 30 Dec 2014
Posts: 20
Location: Kielce

poland.gif
PostPosted: Sun Nov 22, 2015 10:14 pm    Post subject: Reply with quote

problem solved: pin dout was connected to lcd dout , same with din to lcd din

my mistake...

BTW: in future with library great will be circuit amtega vs lcd connections...

touchpad works fine with setup:
Const Portrait = 0 '0=Landscape, 1=Portrait
Const Rotate180 = 1 '0=Normal, 1=Rotate 180

$nocompile
'===============================================================================
Sub Read_touch()
Touchx = 0 : Touchy = 0 : Clk_touch = 0 : Cs_touch = 0
Shiftout Dout_touch , Clk_touch , X_dout , 1 , 8 , 1 'X request
Waitms 3
Shiftin Din_touch , Clk_touch , Touchy , 1 , 12 , 1 'X answer
Shiftout Dout_touch , Clk_touch , Y_dout , 1 , 8 , 1 'Y Request
Waitms 3
Shiftin Din_touch , Clk_touch , Touchx , 1 , 12 , 1 'Y answer
Cs_touch = 1
If Touchy > 3500 Then Touchy = Touchy - 3500 Else Touchy = 0
Touchy = Touchy / 110
If Touchy > 239 Then Touchy = 239
If Touchx > 3500 Then Touchx = Touchx - 3500 Else Touchx = 0
Touchx = Touchx / 83
If Touchx > 319 Then Touchx = 319
Touchx = 319 - touchx
Touch_flag = 0
End Sub


LCD still don't do lcd_clear black - i don't know what to do...
Back to top
View user's profile
Mrshilov

Bascom LCD Guru



Joined: 24 Jan 2009
Posts: 314
Location: Russia

russia.gif
PostPosted: Mon Nov 23, 2015 11:35 am    Post subject: Reply with quote

I use simplified initialization. For displays with standard defaults it is enough. Maybe your LCD has different OTP. Try to use full init. For example from Ben: http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=10923&highlight=ili9325
Back to top
View user's profile
sstewart

Bascom Member



Joined: 16 Aug 2004
Posts: 57

usa.gif
PostPosted: Mon Apr 04, 2016 5:15 pm    Post subject: Reply with quote

When using 56 pixel height fonts, Blocksize and Colums need to be changed from bytes to words. Also added an extra 5ms wait after Res_disp pin high

Local Row As Byte , Block As Byte , Byteseach As Byte , Blocksize As Word
Local Colums As Word , Columcount As Byte , Rowcount As Byte , Stringsize As Byte

Res_disp = 0 : Waitms 5 : Res_disp = 1 : Waitms 5 'Hardware Reset
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here All times are GMT + 1 Hour
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
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