Menu

GLCD ILI9486

Help
Mikam
2023-05-16
2023-05-21
<< < 1 2 3 4 (Page 4 of 4)
  • Mikam

    Mikam - 2023-05-19

    Trying different combinations

    for i=1 to 10
    line (10,20i,200,20i, TFT_YELLOW) .......Compiles with errors
    line (10,20i,200,20i, TFT_GREEN) .......No errors
    Wait 100 mS
    next i

    Appears to depend on colour.

    '18F4525 ILI9488 Loop Test 19May23a (1).gcb (35): Error: Cannot store 16776960 in the word '

     
    • Anobium

      Anobium - 2023-05-20

      This makes sense. The compiler has choices to make in terms of the Line() method. There are multiple Line() methods. They are different as one supports color as Long, one as Word etc.

      The ILI9488 uses a Long to define the color and the compiler is treating one color as a Word and one as a Long. They should both be Long.

      So, the challenge is to work out why TFT_YELLOW is being treated a Word when we know the TFT_YELLOW is a LONG. The ILI9488 library lines 216 and 236 show the color definition.

      **Proof. **

      Look in the ASM posted. Line 926 shows ;Overloaded signature: WORD:WORD:WORD:WORD:word:, Source: glcd.h (1776) for the Line method. The last parameter is a WORD and we know the last parameter should be a LONG... hence the error.

      I dont have your ASM code where one color works and the other does not. But if you look at the ASM one call to the Line ASM will go to the correct LINE (with the LONG).

      Root Cause

      The root cause is the TFT_YELLOW is being handled as a Word.

      Forcing TFT_YELLOW to a Long will prove.
      line (10,20,400,20,[LONG](TFT_YELLOW*1))

      Trying the following will yield good information. If this fail to compile with some error then TFT_YELLOW is defined as [LONG]0xFFFF00 and the casting creates an error by doing this [LONG][LONG]0xFFFF00
      But, if this does not error... then TFT_YELLOW is defined as 0xFFFF00 which is a clue of a typo or some odd character in the ILI9488.h file at lines 216 or 236.
      line (10,20,400,20,[LONG]TFT_YELLOW

      Cannot reproduce here

      When I compile the program using your GLCD.h and ILI9488.h in my standard installation. I do not get the error.

      Looking that the ASM I get ;Overloaded signature: WORD:WORD:WORD:WORD:long:, Source: glcd.h (1854) where the last parameter is a Long - which is correct.

      Next steps

      1. Check you have your adapted GLCD.h in the include folder. Were lines 1776 and 1854 are the LINE() subs. Test
      2. If step #1 fails. Then, reset the installation using GCSTUDIO to set the installation back to standard, then, take the two .h (posted above) and place in the include folder. Test.
       
  • Chris Roper

    Chris Roper - 2023-05-19

    '18F4525 ILI9488 Loop Test 19May23a (1).gcb (35): Error: Cannot store 16776960 in the word '

    That is logical as 16776960 = FFFF00 a Word is 16 Bit and you are trying to save a 24 Bit value.
    Maybe it is an incorrectly defined constant ?

     
  • Anobium

    Anobium - 2023-05-20

    I just did a clean install. Then, I replaced glcd.h and ili9488.h ( from this thread ) and all is good.

     
  • Mikam

    Mikam - 2023-05-20

    line (10,20,400,20,LONG) ... runs with no errors

     
  • Mikam

    Mikam - 2023-05-20

    GLCD.h LINE 1776:

    'Sub Line(In LineX1 as word, In LineY1 as word, In LineX2 as word, In LineY2 as word, Optional In LineColour as word = GLCDForeground)'

    and LINE 1854

    'Sub Line(In LineX1 as word, In LineY1 as word, In LineX2 as word, In LineY2 as word, Optional In LineColour as Long = GLCDForeground)'

     
  • Mikam

    Mikam - 2023-05-20

    Will try a fresh install.

     
  • Mikam

    Mikam - 2023-05-20

    Strange, on two different install machines i have the same problem.

     
  • Anobium

    Anobium - 2023-05-20

    Recap for me.

    Post your program, the two .h files and the ASM that fails.

    You are using SynWrite?

    What language and country is your PC set to?

     
  • Mikam

    Mikam - 2023-05-20

    Fresh install. using GCstudio latest build. First run of loop test i get the following message.
    See attached.

     
    • Anobium

      Anobium - 2023-05-20

      Use underscores rather than spaces in the name of the filename.

      We need someone to fix this silly space in filename issue.

       
  • Mikam

    Mikam - 2023-05-20

    Yep silly. Anyway. Still getting the error but only when i add the 'i'
    What do you need?

     
  • Anobium

    Anobium - 2023-05-20

    I need your complete setup in a ZIP. I need to experience this issue.

    Can you create a ZIP and upload somewhere ?

     
  • Mikam

    Mikam - 2023-05-20

    I could upload but where? I could zip/burn to disc then post.

     
    • Anobium

      Anobium - 2023-05-20

      Can you share from your end? Dropbox? Onedrive.live.com?

       
  • Mikam

    Mikam - 2023-05-20

    Can i be cheeky and say. Have you tried the download and installed on another machine (Fresh install).

     
    • Anobium

      Anobium - 2023-05-20

      I installed on a new computer. No problem.

       
  • Mikam

    Mikam - 2023-05-20

    If you think the problem is still linked to GLCD.h and/or ILI9488.h please attach your masters, i will
    swap with the ones in the include directory.
    dropbox/onedrive never used either.

     
  • Anobium

    Anobium - 2023-05-21

    See attached. Please replace in the include folder.


    The issue is resolved.

    One problem was my ability to reproduce the error. A few hours ago I figured out the that errant code has been commented out. I test what is posted. And, I did not get the error.

      'line (10,20*i,200,20*i,TFT_YELLOW)
      line (10,20,400,20,TFT_YELLOW)
    

    is very different from

      line (10,20*i,200,20*i,TFT_YELLOW)
      line (10,20,400,20,TFT_YELLOW)
    

    The first line was issuing the error.. :-(

    Learning. Always post the code with the error. :-)


    So, once I was able to reproduce I was able to understand.

    The root cause was the compiler identification of type of variable. The compiler had two options to choose - Line() with LineColor as a 1) Word 2) Long - this is called OverLoading. And, depending on the order of the code the initial definition of LineColor would be Word and this would cause the failure.

    So, I have resolved by removing OverLoading for the Line() method. The method with Long color support is called Line_LongColor(). When you use this specific GLCD the setup changes the default handler from Line() to Line_LongColor(). The removes the OverLoading and hence the issue should be resolved.

     

    Last edit: Anobium 2023-05-21
  • Mikam

    Mikam - 2023-05-21

    Excellent. I no longer get the error.

     
    • Anobium

      Anobium - 2023-05-21

      Good to hear.

      Hopefully, this issue is resolved.

      There may be other issues as this is a new library. Just post and I can fix asap.

      Enjoy.

       
<< < 1 2 3 4 (Page 4 of 4)

Log in to post a comment.