Menu

GLCD & ILI9341 problem with page boundrys?

2020-04-27
2020-04-28
  • James Whyte

    James Whyte - 2020-04-27

    I have been having trouble with GCLD and the ILI9341 LCD
    Everytime I go over 50% program memory, even slightly I can't get anything to work.
    Comment out some lines to get below 50% and it works again.
    I am sure it is not my code as it doesn't matter what I coment out. Comment out anything to get below 50% and all is well.

    Is there some procedure or process I should be doing around page boundrys and GLCD?
    Works:
    Program Memory: 3957/8192 words (48.3%) RAM: 189/368 bytes (51.36%) Chip: 16F877A

    Doesn't even start:
    Program Memory: 4283/8192 words (52.28%) RAM: 193/368 bytes (52.45%) Chip: 16F877A

    I can provide sample code if of use

     
  • Anobium

    Anobium - 2020-04-27

    Post the code. I do not want to guess. 😃

     
  • James Whyte

    James Whyte - 2020-04-27

    You can comment in and out lines;
    112
    113

    to bring below, or above 50%, or many other lines to get the same results.

     
    • Anobium

      Anobium - 2020-04-27

      I can see nothing wrong from the first inspection. Your code looks good.

      I am not aware of any page handling issue. There is nothing you need to do. However, there could be a new issue but let us try to resolve.

      I can see that you are the maximum stacks. I recommend.

        1. Change to software SPI - comment out line 27 & 28
      1. Change the calls on line 112 and 113 to macros
      2. Change the chip.

      Try the first two - report back.

       
  • James Whyte

    James Whyte - 2020-04-28

    Software SPI works (1) and Lines 112 and 113 changed to macros works, but I still have to comment out line 138 (GLCDPrint(0,100,HX711_RAW,ILI9341_YELLOW)) to get it too work.

    How did you determine the maximum stack please? Maybe a tool I should be using?

    Historicaly I have used assembler where I could see and control the CALLS and stack use. But I have realised with GCB, using functions will make CALLS, and possibly and unknown number of calls without deep inspection that are not imediately obvious. This is a whole in my knowledge rather than a GCB failing. A stack tool or SIM would help.

    This is on a PIC16F887A dev board for now while I wait for a PCB to arrive, but stuck in shipping at the moment. I then intend to use a PIC16F1788... Which has a 16 deep stack as opposed to the PIC16F887A's 8 Deep stack

     
  • Anobium

    Anobium - 2020-04-28

    For quick analysis I used MPLAB-X. I posted a thread on debuggers.

    I am entirely sure that you maxed the stacks out. You were at 7 (of 8) stacks.

    When you get the new chip, let me know what happens. Please.

     
    • Anobium

      Anobium - 2020-04-28

      Remember, when you get new chip. You can use PPSTOOL to enable SPI module.

       
  • Anobium

    Anobium - 2020-04-28

    And, Mr Dim here.

    What version of Great Cow BASIC compiler? I am on the release candidate for the next version.... so, please look at the top of you ASM file. Post the first line.

    And, for more info on Pages etc - look at the HTML report generated.

     
  • James Whyte

    James Whyte - 2020-04-28

    Yes, I had checked that. (0.98.06 2019-06-12 (Windows 32 bit))

    If you can see a stack problem I will start using MPLAB-X.... and upgrading the PIC is likely to solve this problem. Thanks

     
    • Anobium

      Anobium - 2020-04-28

      I meant to use MPLAB-X only to see the stacks.... can I check that is what you are thinking....

       
  • James Whyte

    James Whyte - 2020-04-28

    Yes, just for the checking the stack... MPLAB-X is bloatware that I lost interest in long ago.

    I have just aslo been looking at PIC Simulator IDE which does show the stack.
    https://www.oshonsoft.com

     
    • Anobium

      Anobium - 2020-04-28

      I would look at the MPLAB-X. Sorry for that... but, if you want to walk the ASM.. this is truly the best.

       
  • stan cartwright

    stan cartwright - 2020-04-28

    is line 28 needed as help says it's optional and defaults to for chips below 64mhz? #define HWSPIMode masterfast.

     

Log in to post a comment.