Share

Great Cow BASIC

Subscribe

Program size and 2K boundary

  1. 2009-11-07 03:54:07 UTC

    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. here is the listing. I highlighted the suspect calls in red.

  2. 2009-11-12 02:25:17 UTC

    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.

  3. 2009-11-15 16:22:11 UTC

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

    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!

< Previous | 1 | Next >

Add a Reply

You can use Markdown syntax in your reply.

Preview

Monitor this

Log in to monitor this topic. Not registered? Create an account to receive email updates when replies are posted to this topic. If you do not log in or register, your reply will be added anonymously.