Menu

Problem with EEPROM routine

2009-08-04
2013-05-30
  • Nobody/Anonymous

    I have multiple EEPROM reads in a row.  The last read statement has a bank select wrong.  The ones before are correct.  Here's the last one:

        call    SYSEPREAD
        banksel    EEDATAVALUE
        movf    EEDATAVALUE,W
        movwf    TEMP
        banksel    STATUS
        return

    The banksel STATUS should be before movwf TEMP.  I coded another dummy read as last as a workaround.  Make sure your TEMP variable is NOT allocated below 20H.

     
    • Nobody/Anonymous

      After some more work, I moved the EPReads in my program, and they are ok.  I believe the above time, they were at the end of program or near it after compile.  So, probably not worth looking at unless someone else has the same problem.

       
    • Hugh Considine

      Hugh Considine - 2009-08-12

      That bug was caused by some dodgy bank selection code that I've now rewritten. Please download the latest update ( http://gcbasic.sourceforge.net/update.html ) and see if it helps.

       
    • Nobody/Anonymous

      Tried the latest update.  The EPReads and writes are fine (although since the move they worked before).  I don't have the exact source code that had trouble above to test.

      The update reduced a few bankselects that were unneeded in the main program.  Great.  Added one in the interrupt context restore that wasn't needed.  Ok.

      The interrupt handler still has the clrf STATUS missing that is needed (for the PIC12 as least, not sure of others).  Latest version of GCBasic with the clrf STATUS manual edit is stable for my application with two interrupt routines, EEProm reads and writes, etc.

      Thanks for the support!

       

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.