Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

ILI9341 with SW/HW SPI, 8/16 Bit parallel mode
Goto page Previous  1, 2, 3, 4, 5, 6  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
Plons

Bascom Member



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

netherlands.gif
PostPosted: Tue Feb 23, 2016 1:35 pm    Post subject: Reply with quote

I posted earlier about problems with larger fonts than font8x8.font. Here: http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&p=68398#68398
There was an error in ILI9341_M328_revA.inc: in
Code:
Sub Lcd_text(byval S As String , Byval Xoffset As Word , Byval Yoffset As Word , Byval Forecolor As Word , Byval Backcolor As Word)
 
was a mix up between X and Y.
Code:
Sub Lcd_text(byval S As String , Byval Xoffset As Word , Byval Yoffset As Word , Byval Forecolor As Word , Byval Backcolor As Word)
   Local A As Word , Pixels As Byte , Count As Byte , Carcount As Byte , Temp As Word
   Local Row As Byte , Block As Byte , Byteseach As Byte , Blocksize As Byte
   Local Colums As Byte , Columcount As Byte , Rowcount As Byte , Stringsize As Byte
   Local Pixelcount As Byte , Offset As Word
   Local Pointer As Word
   Local X As Word , Y As Word

   Stringsize = Len(s) - 1                                  'Size of the text string -1 because we must start with 0
   !Lds _DPTRL , {Lcd_chartable}                            'Restore Font Label
   !Lds _DPTRH , {Lcd_chartable+1}
   #if Varexist( "RAMPZ")
      ___readrampz = Lcd_chartable_rampz
   #endif

   Read Block
   Read Byteseach
   Read Blocksize
   Colums = Blocksize / Block                               'Calculate the numbers of columns
   Row = Block * 8                                          'Row is always 8 pixels high = 1 byte, so working with row in steps of 8.
   Row = Row - 1                                            'Want to start with row=0 instead of 1
   Colums = Colums - 1                                      'Same for the colums
   Pointer = Varptr(s)

   For Carcount = 0 To Stringsize                           'Loop for the numbers of characters that must be displayed
      Offset = Inp(pointer)                                 'Font files start with character 32
      Offset = Offset - 32
      Incr Pointer
      If Lcd_digit_font = 1 And Offset > 14 Then Offset = Offset - 15       'For reduced Digit Font
      Offset = Offset * Blocksize
      Offset = Offset + 4
      Lcd_tempword = Lcd_chartable + Offset                 'Point to Character
      !Lds _DPTRL , {Lcd_tempword}
      !Lds _DPTRH , {Lcd_tempword+1}
      #if Varexist( "RAMPZ")
         ___readrampz = Lcd_chartable_rampz
      #endif
      Temp = Carcount * Byteseach
      Temp = Temp + Xoffset
      For Rowcount = 0 To Row Step 8                        'Loop for numbers of rows
         Y = Yoffset + Rowcount
         X = Temp
         For Columcount = 0 To Colums                       'Loop for numbers of Columns
            Read Pixels
            For Pixelcount = 0 To 7                         'Loop for 8 pixels to be set or not
               If Pixels.pixelcount = 1 Then
                  Lcd_set_pixel X , Y , Forecolor
               Else
                  Lcd_set_pixel X , Y , Backcolor
               End If

'               As it was in ILI9341_M328_revA.inc
'               Incr X
'            Next Pixelcount
'            X = X - 8
'            Incr Y

'               As it is now in ILI9341_M328_revB.inc

               Incr Y
            Next Pixelcount
            Y = Y - 8
            Incr X

         Next Columcount
      Next Rowcount
   Next Carcount

End Sub
 


Attached the updated library.

_________________
Bascom AVR ver 2.0.8.6
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
dabatek

Bascom Member



Joined: 31 Jul 2013
Posts: 32
Location: Serbia

blank.gif
PostPosted: Wed Mar 23, 2016 9:45 pm    Post subject: Larger Font on ILI9341 Reply with quote

Hi,

I use display 3,2 inch with 16 Bit parallel mode (lib from Netzman ) and all work OK, but I can not get a larger font than 8x8.
SPI variant of lib have support for larger font.
Is it possible to use a text-routine from SPI lib (with some editing) for 16 bit parallel lib. I tried, but without success.

Please... help

Z. Dabic

Thank you...
Back to top
View user's profile
Plons

Bascom Member



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

netherlands.gif
PostPosted: Tue Apr 12, 2016 1:57 pm    Post subject: Reply with quote

It has proven to be very usefull to read a thread thoroughly Wink : my post right above yours tells you how to fix the problem.
_________________
Bascom AVR ver 2.0.8.6
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
dabatek

Bascom Member



Joined: 31 Jul 2013
Posts: 32
Location: Serbia

blank.gif
PostPosted: Thu Apr 14, 2016 10:24 pm    Post subject: Reply with quote

Oh...

Rolling Eyes Sometimes I can not see the forest for the trees

Thank you...
Back to top
View user's profile
alexprint36

Bascom Member



Joined: 27 Jun 2013
Posts: 1

PostPosted: Sun May 22, 2016 7:50 pm    Post subject: Reply with quote

Hello! When you try to compile, I get an error. It is unclear assignment Pin connection display
Code:
Const Lcd_ctrl_port = Portf
Const Lcd_data_port_1 = Porta

Const Lcd_pin_dc = 2
Const Lcd_pin_cs = 3
Const Lcd_reset_pin = 4
Const Lcd_pin_wr = 1
Const Lcd_pin_rd = 0
Back to top
View user's profile
Igor_67

Bascom Member



Joined: 16 Jan 2011
Posts: 12
Location: Barnaul, Russia

russia.gif
PostPosted: Thu Aug 18, 2016 6:54 pm    Post subject: Reply with quote

Hi all!
I have a little question:
Is suitable ili9341 library for ili9340?
Back to top
View user's profile
pier_pe

Bascom Member



Joined: 18 Feb 2016
Posts: 19

poland.gif
PostPosted: Sun Aug 28, 2016 8:22 pm    Post subject: Reply with quote

Hello.
Link of the first post did not work.

Is it possible for the library to work with such a display?
http://www.banggood.com/3_2-Inch-SSD1289-TFT-LCD-Display-Module-Touch-Panel-For-Arduino-p-918609.html
Back to top
View user's profile
pier_pe

Bascom Member



Joined: 18 Feb 2016
Posts: 19

poland.gif
PostPosted: Wed Sep 07, 2016 5:37 pm    Post subject: Reply with quote

Hi.
Link to the library work but on this page is not displayed diagrams to connect the display.
Back to top
View user's profile
pier_pe

Bascom Member



Joined: 18 Feb 2016
Posts: 19

poland.gif
PostPosted: Sun Oct 30, 2016 10:00 pm    Post subject: Reply with quote

Does anyone have a connection diagram of the display in parallel 16bit mode?
Back to top
View user's profile
Netzman

Bascom Expert



Joined: 25 Nov 2005
Posts: 132
Location: Graz

austria.gif
PostPosted: Wed Nov 23, 2016 8:23 pm    Post subject: Reply with quote

Hello,

The connection scheme is online now.
the server has been moved again, during that process the images got lost (most of them I could recover, i've had at least the ones of the display library).

Best regards

_________________
LCD Menu | Proportional Fonts
Back to top
View user's profile Visit poster's website
pier_pe

Bascom Member



Joined: 18 Feb 2016
Posts: 19

poland.gif
PostPosted: Sun Nov 27, 2016 5:47 pm    Post subject: Reply with quote

Hello.
Help me anyone in the configuration file ILI9341.inc?
I want to run 16bit display mode under arduino mega 2560.
I do not know how to configure file .inc.
The arduino mega pins DB0-DB7 controls the port C pins and DB8-DB15 port A.
D / C is a pin PD7
CS to pin PG1
WR to pin PG2
RESET pin is PG0
Set somebody .inc file under such control and ATmega2560?

The problem is also with a sample program.
There is an error in this location:

' =========== Rotation ============
For Pixels = 0 To 4
Lcd_set_rotation Pixels <<<<<<<<---------------------------------HERE IS ERROR
Lcd_clear Color_white
Y = Lcd_screen_height - 20
Lcd_fill_rect 0 , Y , Lcd_screen_width , Lcd_screen_height , Color_black
Y = Y + 4
Statustext = "Rotation " + Str(lcd_rotation)
Lcd_tt_text Statustext , 10 , Y , Color_white
X = Lcd_screen_width - 80
X = X / 2
Y = Lcd_screen_height - 155
Y = Y / 2
Restore Hand
Lcd_pic_flash X , Y , 80 , 155
Waitms 1500
Next


Bascom gives this error:
Error: Line 71: 175 Different type parameter passed then DECLARED [PIXELS], in File: E: \ Electronics \ Bascom \ ILI9341 \ ili9341.bas
Back to top
View user's profile
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 1198
Location: France

france.gif
PostPosted: Sun Nov 27, 2016 6:43 pm    Post subject: Reply with quote

Hi
did you read the posts about arduino in the Bascom-Arduino forum ?

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

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

bonne lecture... Wink
jp
Back to top
View user's profile Visit poster's website
pier_pe

Bascom Member



Joined: 18 Feb 2016
Posts: 19

poland.gif
PostPosted: Sun Nov 27, 2016 7:12 pm    Post subject: Reply with quote

Hey, I know what the pinout is Arduino Mega.
I wrote a display is controlled by arduino just do not know how to configure the .inc file to display work on the Arduino Mega.
Back to top
View user's profile
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 1136

poland.gif
PostPosted: Sun Nov 27, 2016 7:51 pm    Post subject: Reply with quote

Quote:
Lcd_set_rotation Pixels <<<<<<<<---------------------------------HERE IS ERROR

I think.."Lcd_set_rotation(Pixels) <<<<<<<<---------------------------------HERE IS WHY" Very Happy
Back to top
View user's profile Visit poster's website
pier_pe

Bascom Member



Joined: 18 Feb 2016
Posts: 19

poland.gif
PostPosted: Sun Nov 27, 2016 8:13 pm    Post subject: Reply with quote

Error corrected. Variable used was inadequate.

I have for a whole bunch of other errors:

Error : 86 Line : 455 Invalid parameter for CONFIG parameter or value [8] , in File : Colors565.inc
Error : 71 Line : 1146 Different parameter type passed then declared [COLOR_L] , in File : Colors565.inc
Error : 71 Line : 1146 Different parameter type passed then declared [COLOR_H] , in File : Colors565.inc
Error : 242 Line : 90 Source variable does not match the target variable [ 0] , in File : ProportionalFont.inc
Error : 46 Line : 93 Assignment error [R23: 0 TEMPINDEX: 301] , in File : ProportionalFont.inc
Error : 242 Line : 114 Source variable does not match the target variable [ 0] , in File : ProportionalFont.inc
Error : 242 Line : 117 Source variable does not match the target variable [ 0] , in File : ProportionalFont.inc
Error : 46 Line : 121 Assignment error [R23: 0 TABLECHAR: 301] , in File : ProportionalFont.inc
Error : 242 Line : 139 Source variable does not match the target variable [ 0] , in File : ProportionalFont.inc
Error : 242 Line : 147 Source variable does not match the target variable [ 0] , in File : ProportionalFont.inc
Error : 242 Line : 151 Source variable does not match the target variable [ 0] , in File : ProportionalFont.inc
Error : 242 Line : 162 Source variable does not match the target variable [ 0] , in File : ProportionalFont.inc
Error : 46 Line : 164 Assignment error [R11: 0 FONTDATA: 301] , in File : ProportionalFont.inc
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, 4, 5, 6  Next
Page 4 of 6

 
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