Menu

PIC16F1938 memory is full

Help
JANIS
2020-12-30
2021-01-02
  • JANIS

    JANIS - 2020-12-30

    I have a problem with the compiled program. The memory of the microcontroller is full. What would you recommend instead of a PIC16F1938 with more memory so that the PIN outputs matches the same functions.

    Error: First page of program memory is full, please reduce size of Main and Interrupt routines

     
    • Anobium

      Anobium - 2020-12-30

      If the page is full... then, cut the large sub routines into small subroutines.

      But, if that does not help then these are your only options with 32 KWords of Progmem but the page size is the same...

      PIC16F18857 - Great Cow BASIC supported
      PIC16F15214 - not supported yet.

      But, you should use the

      PIC18F27K42 - Great Cow BASIC supported - memory is flat so the page limit does not exist. And, you should be able to test compile to verify this.

      Evan

       
  • Anobium

    Anobium - 2020-12-30

    Analysis

     

    Last edit: Anobium 2020-12-30
  • Anobium

    Anobium - 2020-12-30

    18f Analysis

     

    Last edit: Anobium 2020-12-30
  • JANIS

    JANIS - 2020-12-30

    I replaced the microcontroller, another message appeared

    21:52:48    G+Stool started with parameter 'hexflash'   ->   processing   C:\GCB@Syn\G+Stools\makeHEX.bat
    Source-File  =  C:\JANIS\viss\MANI PROJEKTI\SW.MODE  CHARGER\CHARGER_COLOR_GLCD_5A_2020\CHARGER_2020_16lf1938_for_st7735@32.gcb
    >>>  WARNINGs / ERRORs reported by Great Cow BASIC  (if Syntax Error, doubleclick on the errormessage below)  <<<
    
     
  • JANIS

    JANIS - 2020-12-30

    i replaced the microcontroller but the code remained the same.

     
  • Anobium

    Anobium - 2020-12-30

    But, I just downloaded and I cut a section out of your main code. created a sub of the code. Any now it fits in the 1938.

    See attached.

    Keep creating subs....

     
  • JANIS

    JANIS - 2020-12-30

    super... simple... thanks!

     
    • Anobium

      Anobium - 2020-12-31

      You should... some advice.

      Turn #option explicit on, as you have many variables types that are not defined.

      And, resolve these warnings - NOWx should be defined as a Bit or Byte, or test NOWx.0 to test the bit.

      Warning: Comparison will fail if NOW3 is any value other than 0 or 1
      Warning: Comparison will fail if NOW1 is any value other than 0 or 1
      Warning: Comparison will fail if NOW2 is any value other than 0 or 1


      And, you have some weird coding that may not work as you planned. There are a few places where you need to sort.

      if now3>_prev3 then mode++:set_amps=0:set_duty=255

      As NOWx is undefined. But, you set NOW3 !button_menu. So, it safe to assume NOW3 is a bit, but then you compare now3 > prev3 (where is undefined,so a byte)... so the greater than test is not really valid. But, as I do not know the logic of all this.. I cannot correct.

       

      Last edit: Anobium 2020-12-31
  • JANIS

    JANIS - 2021-01-02

    The program works OK :) I once, long ago in other projects where I use a front detector, I tried to define NOWx as a bit, then it didn't work ...

     
    • Anobium

      Anobium - 2021-01-02

      No problem.

      Good to see you are making progress!

       

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.