Menu

Program size and 2K boundary

lou
2009-11-07
2013-05-30
  • lou

    lou - 2009-11-07

    I encountered a problem with programming the 16F289.  My code went over the 2K boundary and stopped working.  Looking through the listing I found several instances of "far" calls (to page 2 of code) that were not preceded with the proper "pagesel" (BSF PCLATH,3) statement.  I manually inserted these pagesel statements and got it to work.  Seems like a compiler problem.  Not sure what else could cause this.  .  I highlighted the suspect calls in red.

      : http://eflyer.no-ip.org/compiled.pdf

     
  • lou

    lou - 2009-11-12

    Update:  There are bigger issues with 16F chips with > 2K program memory.  If you are using interrupts and they can happen while executing on another page, the interrupt handler needs to be at location 4, not just a GOTO statement to the handler.  Otherwise, the goto will take you to a different page and not where the interrupt handler resides.  I ended up finishing my program in assembly language.

     
  • Hugh Considine

    Hugh Considine - 2009-11-15

    The missing pagesels were due to a bug when dealing with overloaded subroutines and functions, which should be fixed in <a>http://gcbasic.sourceforge.net/newfiles/update.zip</a>.

    I see what you mean about PCLATH not being set before the goto Interrupt at location 4 and will fix this as soon as possible. Busy week coming up unfortunately!

     
  • Hugh Considine

    Hugh Considine - 2009-11-27

    The latest update should now fix this by moving the interrupt subroutine to location 4, not just using a goto. The download links are at .

      : http://gcbasic.sourceforge.net/update.html

     

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.