How to define constants that specify eeprom addresses


Closed Thread
Results 1 to 5 of 5

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    EEPROM allocation only increments.

    And whether you're counting from end up or top down, you still need to know where the original program's highest EEPROM location is, and how many bytes you need now.

    Going from end-up will make it longer before you overwrite locations, but it won't keep you from doing it.
    If you start from the end of previous eeprom usage and add more as needed, then the compiler will let you know when you've run out.

    But anyhow, if you know how many bytes you are adding(EEusedNow), and you know how many bytes are available ...
    Code:
    MaxEEPROM    CON 255
    EEusedNow    CON 65
    
    DATA  @MaxEEPROM - EEusedNow + 1
    
    ee_patnum    DATA 2
    ee_stepnum   DATA 0
    ee_bright    DATA 255
    ee_xfade     DATA 254
    
    ;... etc. ...
    DT

  2. #2
    Join Date
    Dec 2009
    Location
    Edmonton AB Canada
    Posts
    5


    Did you find this post helpful? Yes | No

    Default

    I think that will work quite nicely.

    I know how many system variables that I have (not many) and I will certainly keep track of the user variables.

    This does exactly what I want: provides me with a single place where I can specify the eeprom size.

    Many thanks!

    dwayne

Similar Threads

  1. RF Modules
    By tonyfelloni in forum mel PIC BASIC Pro
    Replies: 44
    Last Post: - 26th June 2010, 17:42
  2. Can't read sequential addresses in external EEPROM
    By tjkelly in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th February 2010, 14:46
  3. RX TX modules - intermitent communication
    By ruijc in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 11th June 2009, 00:13
  4. Data EEPROM gets clobbered during programming
    By BrianT in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 18th July 2008, 02:46
  5. word variable to 25lc640
    By TONIGALEA in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 6th July 2004, 19:59

Members who have read this thread : 0

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

Tags for this Thread

Posting Permissions

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