Writing to non-volatile memory?[stares into space]


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Writing to non-volatile memory?[stares into space]

    They say the first sign of madness is talking to yourself....

    ok, seek and you shall find as the saying goes, and it should be no surprise that DT has a hand in the solution...

    http://www.picbasic.co.uk/forum/showthread.php?t=2444

    ok, out the blocks I'm getting an error (this'll be the plea for help bit!)

    Code:
    pattern var byte
    @  EE_var  _pattern, byte, 1  ; Link an EE variable to it.
    (the variable I want to track & store has the name 'pattern')

    gives a compilation error....

    "Symbol not previously defined (byte)" for it seems the following bolded asm line....

    Code:
    EE_assign  macro   Name , Value, Size               
      local Assign_Done
      nolist
        if ((EE_PTR + Size) >= EEPROM_SIZE )      list
            error "EEPROM is Full, Could not Fit", Name
        endif
    Any ideas?

    The PIC I'm using is a PIC16f1824
    Last edited by HankMcSpank; - 28th March 2011 at 00:10.

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Woohoo, another EE_vars user.
    That's an old one.

    Use Uppercase for the "Size".
    Code:
    @  EE_var  _pattern, BYTE, 1  ; Link an EE variable to it.
    MPASM is case sensitive.
    DT

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    I should probably mention that you can do the same thing with ...
    Code:
    pattern  var byte : EE_pattern DATA 1             : READ EE_pattern, pattern
    MyWord   var WORD : EE_MyWord  DATA WORD 12345    : READ EE_MyWord, WORD MyWord
    MyLong   var LONG : EE_MyLong  DATA LONG 123456789: READ EE_MyLong, LONG MyLong
    
    ; to save the variables to EEPROM ...
    WRITE EE_pattern, pattern
    WRITE EE_MyWord, WORD MyWord
    WRITE EE_MyLong, LONG MyLong
    No include needed.
    The only difference is that you can't restore to the original "default" value like EE_vars.

    This stuff wasn't available in 2005
    Last edited by Darrel Taylor; - 28th March 2011 at 04:12. Reason: added LONGs
    DT

  4. #4
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Writing to non-volatile memory?[stares into space]

    Quote Originally Posted by Darrel Taylor View Post
    I should probably mention that you can do the same thing with ...
    Code:
    pattern  var byte : EE_pattern DATA 1             : READ EE_pattern, pattern
    MyWord   var WORD : EE_MyWord  DATA WORD 12345    : READ EE_MyWord, WORD MyWord
    MyLong   var LONG : EE_MyLong  DATA LONG 123456789: READ EE_MyLong, LONG MyLong
    
    ; to save the variables to EEPROM ...
    WRITE EE_pattern, pattern
    WRITE EE_MyWord, WORD MyWord
    WRITE EE_MyLong, LONG MyLong
    No include needed.
    The only difference is that you can't restore to the original "default" value like EE_vars.

    This stuff wasn't available in 2005
    Many thanks Darrel...I shall try this tonight. As it goes, I don't need to restore the original default so that should be dandy.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts