Menu

GCASM Symbols not defined

Chris S
2023-03-21
2023-03-27
1 2 > >> (Page 1 of 2)
  • Chris S

    Chris S - 2023-03-21

    Hello! It seems these issues only happen to me since I use odd PICs lol. But this is the beginning of a larger program so I only have the basics in so far and as you can tell, this is just to get things going. I have not moved the pins via PPS yet, but I dont think that matters. Code is included.

    The error I get is this:

    Errors have been found:
    
    Error: GCASM: Symbol [SFR]WCOL has not been defined. Inspect ASM file to determine error  at `ANDWF WCOL, W,BANKED` Hexfile address(see lst file): 000402
    Error: GCASM: Symbol [SFR]BF has not been defined. Inspect ASM file to determine error  at `ANDWF BF, W,BANKED` Hexfile address(see lst file): 000416
    Error: GCASM: Symbol [SFR]BF has not been defined. Inspect ASM file to determine error  at `ANDWF BF, W,BANKED` Hexfile address(see lst file): 000428
    Error: GCASM: Symbol [SFR]WCOL has not been defined. Inspect ASM file to determine error  at `ANDWF WCOL, W,BANKED` Hexfile address(see lst file): 00043C
    Error: GCASM: Symbol [SFR]BF has not been defined. Inspect ASM file to determine error  at `ANDWF BF, W,BANKED` Hexfile address(see lst file): 000450
    Error: GCASM: Symbol [SFR]BF has not been defined. Inspect ASM file to determine error  at `ANDWF BF, W,BANKED` Hexfile address(see lst file): 000462
    
    The message has been logged to the file Errors.txt.
    

    PIC: 18F15Q41
    Also gives the same error with PIC18F26K83

    Compiler Version: 1.00.00 2023-03-19 (Windows 64 bit) : Build 1225   
    Program Memory: 343/16384 words (2.09%)   
    RAM: 12/2048 bytes (0.59%)   OSC: HFINTOSC_1MHZ, 64Mhz (Internal oscillator)   Chip: 18F15Q41
    

    The error will go away if I comment out the GLCD print line or the GLCDCLS line and it will compile fine.

    If I just use the ASM button, it will compile to ASM. But if I try to use the HEX button, I get the above errors

     

    Last edit: Chris S 2023-03-21
  • Chris S

    Chris S - 2023-03-21

    ERRORS.txt

     
  • Anobium

    Anobium - 2023-03-21

    The error is coming from with the GLCD library. There is a clear screen routine that is intended to be very quick... but, on the later chips it does not work as the SPI is very different.

    Please try the attached - I have updated to handle the new chips with the latest SPI module.

    Also, please restart/update GCStudio to get build 1226.

     
    • Chris S

      Chris S - 2023-03-21

      Updating and using the dev version, along with copying that file allowed it to compile with no errors. I should hopefully be able to do a hardware test within a few days to see if it works. I tried it on the 18F15Q41 but I'll try to compile on the other chip just to make sure it works :) I'll keep this thread open just to make sure I dont run into any thing.

      Thanks :)

       

      Last edit: Chris S 2023-03-21
  • Anobium

    Anobium - 2023-03-21

    And, a great post. So, easy to understand. :-) Thank you.

     
  • Anobium

    Anobium - 2023-03-21

    It should be ok but you never know!

     
    • Chris S

      Chris S - 2023-03-22

      Turns out, it wasnt :). I had limited time between today and last night but I think I may know where to look:

      SPI Data/clock dont seem to be working, however, DC and RST seem to have things going on per my scope. Theres definitely a clock signal of sorts going on there.

      -Verified that all pins are connected physically. Used a meter to do this and ohm checked everything. I had to change the PIC to the one currently being used.
      -Verified the physical layout to the GLCD is correct.
      -Double checked PPS. Double checked the datasheet for any conflicting pins.Maybe Its worth triple checking. Will post schematic down below
      -I am using the PICKIT3 to power the thing-its only the GLCD and PIC. Nothing else. I am using 3.3V.
      -I have tried two ILI9486 modules so far with no luck. Unless they are both "bad"

      Suspicions: -Check PPS, and SPI modules against the datasheet. Something isnt sending data. When I get home I'll have to try just sending raw data over and over (so just do a SPI transfer) to verify where the problem is.
      -Checking the GLCD lib's arent my forte so I can only go so far.

      Also trimmed down the code a lot. Included it here.

       
      • Chris S

        Chris S - 2023-03-22

        PIC Side:

         

        Last edit: Chris S 2023-03-22
        • Chris S

          Chris S - 2023-03-22

          Board Side

           
  • Anobium

    Anobium - 2023-03-22

    ok. Rule out PPS. Remove the PPS statements, then, the remove/comment out the hardware SPI. This will then use software SPI. Test.

     
  • Anobium

    Anobium - 2023-03-22

    I have just checked/inpsected the demo (what are also the test programs) and this specific configuration has not been tested - PIC18F26K83

    The 18F15Q41 has been veified with SPI&GLCD.

    We will need work this thru.

    • I spotted a typo in the user program. The #define ILI9486L_HardwareSPI was not correct,
    • I spotted that the library access PORTD - this would not impact the operation but I wanted to correct.

    Please use the two files attached. Test.

     
    • Chris S

      Chris S - 2023-03-22

      Tried removing the PPS and I did get SPI (software) to work and I saw a clock signal, but no dice on the GLCD.

      Tried your above changes, and still no dice. However, Something bugs me: Clock, DC and RST are all around VCC(peak). SDO is around 1V(peak). Im not sure why this is. It only happens when I connect the GLCD. Without it, I see the signals at the proper levels. Im using the PICs 3.3V supply, which should be enough for this.

      Is it possible I have two defective modules? Or Maybe they arent an legit modules?
      did buy an IL9488 module. I could try that as a last resort...

      I also DID try another pic in software mode: 18F13K22. Still nothing on that one too..

      For clarity: via my scope it does look like SPI is working proper. I just mean there is a clock signal but it only goes up to 1V peak on the SDO line.

      Thanks for the help so far.

       

      Last edit: Chris S 2023-03-22
  • Chris S

    Chris S - 2023-03-22

    Stupid question, but could I be mis-interpreting SDI and SDO?I guess what Im saying is, RB2 might be Master Out Serial In.

    Edit-Thats what it was. The levels are proper now. Still no GLCD though.

     

    Last edit: Chris S 2023-03-22
  • Anobium

    Anobium - 2023-03-23

    OK. Disconnect the GLCD. Let us get back to basics.

    This is a test program. It will send data on GLCD_DO, GLCD_SCK, GLCD_CS and GLCD_DC. Test with ILI9486L_HardwareSPI and with ILI9486L_HardwareSPI commented out.
    Note: The PPS turns on and off the assignments. If you were testing and failed to power cycle between PPS and non-PPS then the PPS assignments would not change which would disable the use of the port).

    So, test both cases. Do you signals on the lines?

    #chip 18F26K83
    
    #include <glcd.h>
    #DEFINE GLCD_TYPE GLCD_TYPE_ILI9486
    
    #define GLCD_DC       PORTB.3           ' Data command line
    #define GLCD_CS       PORTB.5           ' Chip select line
    #define GLCD_RST      PORTB.4           ' Reset line
    
    #define GLCD_DI       PORTB.2          ' Data in | MISO
    #define GLCD_DO       PORTB.0          ' Data out | MOSI
    #define GLCD_SCK      PORTB.1          ' Clock Line
    
        #startup InitPPS, 85
        #define PPSToolPart 18f26k83
    
        Sub InitPPS
            #IFDEF ILI9486L_HardwareSPI
                UNLOCKPPS
                RB0PPS = 0x001F    'SDO1 > RB0
                RB1PPS = 0x001E    'SCK1 > RB1
                SPI1SCKPPS = 0x0009    'RB1 > SCK1 (bi-directional)
                SPI1SDIPPS = 0x000A    'RB2 > SDI1 
                LOCKPPS
            #ELSE
                RB1PPS = 0
                RB0PPS = 0
            #ENDIF    
        End Sub
        // Template comment at the end of the config file
    
        // #define ILI9486L_HardwareSPI
    
    do
      SendCommand_ILI9486L(0x55)  
      SendData_ILI9486L(0x55)
    loop
    

    Re the product. I have not seen one of these. If this continues to be an issue - send me one.

    Of the ILI9486 (l) I have here. All have one thing in common. 5v0 supply but all the lines are 3v3. And, I some products here I have build a voltage level board. See point 10 in the table listing on AliExpress!

    I am confident that the SPI works. So, we keep investigating. :-)

     

    Last edit: Anobium 2023-03-23
    • Chris S

      Chris S - 2023-03-23

      So, test both cases. Do you signals on the lines?

      Yes.

       
      • Anobium

        Anobium - 2023-03-23

        If you have signals using HWSPI and SWSPI then we know that SPI is good.

        You need to add the 3v3 levelers.

         
        • Chris S

          Chris S - 2023-03-23

          So, what your saying is, even though I have the PICkit3 set for 3.3V, I have to power VCC of the LCD separately at 5V but the logic levels have to be at 3.3V?

          I am going to try that out before I do a PCB revision, but it will be with another PIC since I dont have the DIP version of that IC.

          Thirdly, do we have a list of confirmed and working GLCDs? I picked this one out because it should be supported.

           

          Last edit: Chris S 2023-03-23
          • Anobium

            Anobium - 2023-03-23

            re 5v0 and 3v3. I have tested and validated on three similar GLCDs. They all have 5v0 supply and 3v3 logic. And, I have written this on the GLCD to remind me. So, you can run at 3v3 for logic but power the supply at 5v0.

            The list of supported GLCDs is in the Help. The Help can always be improved to cover this specific voltage issue.

             
            • Chris S

              Chris S - 2023-03-23

              Well, I see there is a jumper on the back that can be soldered for 3.3V so I went home on my lunch to give it a shot. Used latest above and tried to change the background to purple and still nothing. The screen does go to black/grey though, rather than the usual "white".

              The only reason I ask about the GLCDs is so I can get the GLCD you are testing with. I kind of already built my platform around this screen, so its just a matter of getting it to work.

              I do also wonder if this is a ILI9488 and not an 86.

              Edit: IIRC we went through this before and I think the only other screen I have that is working is the 2.4" or 1.8". I'll have to check when I get home.

               

              Last edit: Chris S 2023-03-23
  • Anobium

    Anobium - 2023-03-23

    Next Tuesday, I will test here. I have your chip.

    You can try the other 86 library. No harm in trying.

     
  • Anobium

    Anobium - 2023-03-23

    re the GLCDs. Look at the demos. Those have all been tested. It is a good way to show all the chips and GLCDs.

     
    • Chris S

      Chris S - 2023-03-23

      Unfortunately, Demo's is empty. Is it supposed to be that way? I can still pull from an older version though

       
  • Chris S

    Chris S - 2023-03-23

    OK So good news! the ILI9341 works! So thats progress. Changes: swapped RB0 and RB2. So at least we have a starting point. Funny enough, when I had the OLD code in for the ILI9486...this screen worked. Going to test the other one next..

    #chip 18F26K83
    
    #include <glcd.h>
      #define GLCD_TYPE GLCD_TYPE_ILI9341
    
    #define GLCD_DC       PORTB.3           ' Data command line
    #define GLCD_CS       PORTB.5           ' Chip select line
    #define GLCD_RESET      PORTB.4           ' Reset line
    
    #define GLCD_DI       PORTB.0          ' Data OUT | MOSI
    #define GLCD_DO       PORTB.2          ' Data IN | MISO
    #define GLCD_SCK      PORTB.1          ' Clock Line
    
        #startup InitPPS, 85
        #define PPSToolPart 18f26k83
    
        Sub InitPPS
            #IFDEF ILI9341_HardwareSPI
                UNLOCKPPS
                RB2PPS = 0x001F    'SDO1 > RB0
                RB1PPS = 0x001E    'SCK1 > RB1
                SPI1SCKPPS = 0x0009    'RB1 > SCK1 (bi-directional)
                //SPI1SDIPPS = 0x000A    'RB2 > SDI1
                LOCKPPS
            #ELSE
                RB1PPS = 0
                RB0PPS = 0
            #ENDIF
        End Sub
        // Template comment at the end of the config file
    #define ILI9341_HardwareSPI
    GLCDBackground=TFT_PURPLE
    GLCDRotate(Landscape)
        GLCDfntDefaultSize = 3
    
    do
    //GLCDBackground=TFT_NAVY
    GLCDPrint(10, 10, "Test of the ILI9486L Device")
    GLCDPrint(30, 30, "3/23/2023",TFT_RED)
    RoundRect(40,40,80,80,TFT_GREEN)
    loop
    
     
1 2 > >> (Page 1 of 2)

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.