EEPROM Variables (EE_Vars.pbp)


Closed Thread
Results 1 to 40 of 80

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Posts
    20


    Did you find this post helpful? Yes | No

    Default EE_Vars starting address

    Hello Darrel, I see this line in the include file.

    EE_start CON 0 ; Starting address for EE_Vars

    Is this the starting address for your EEprom storage? I use the beginning addresses for specific things that may not be able to use your EE_Vars method. I actually want that area blocked out.

    Can I mix and match your method with generic PBP read and write if I set the EE_Start address up higher. Say for an 18F part if I set it to 512 that would leave the bottom half for me to do what I want with and the top to experiment with your method.

    Is this correct?

    Thanks, Bob

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by brittons View Post
    Is this the starting address for your EEprom storage? I use the beginning addresses for specific things that may not be able to use your EE_Vars method. I actually want that area blocked out.
    That's the way I read it.

    Can I mix and match your method with generic PBP read and write if I set the EE_Start address up higher. Say for an 18F part if I set it to 512 that would leave the bottom half for me to do what I want with and the top to experiment with your method.
    I don't see why not. Just be careful you don't start overwriting what you don't want to start overwriting...

  3. #3
    Join Date
    Feb 2006
    Posts
    20


    Did you find this post helpful? Yes | No

    Default How can I reinitialize the 'First Run'

    Yes, I tried setting the starting address to 511 and the variables get stored there.

    I haven't been able to get the variables to start out in the 'First Run' or default value unless I execute the EE_write_default command. Is there a way to create the 'First Run' sate of the vars without doing this? It seems when you create the var using EE_var the first time it creates the default value but I was only able to do it for the first var I experimented with. Subsequent attempts seemed to come up with 'FFFF' as the default value.

    I have been reading through the EE_Var.pbp code but I have to admint my knowledge of macros is limited. Any recomendations on where I can get up to speed on macros?

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Reinitialize the first run? You mean program a set of initial values into the eeprom?

  5. #5
    Join Date
    Feb 2006
    Posts
    20


    Did you find this post helpful? Yes | No

    Default

    Yes, I've been trying this:

    Setpoint VAR BYTE
    @ EE_var _Setpoint, BYTE, 150

    RunTime VAR WORD
    @ EE_var _RunTime, WORD, 1200

    As shown in the docs but I look at Setpoint and Runtime using MicroCode studio ICD I get 'FF' for Setpoint and 'FFFF' for RunTime. The 'default value is not created when I execute the above.

    If I then do this:
    @ EE_write_default _Setpoint
    @ EE_write_default _RunTime

    The values become 150 and 1200 but only after I perform EE_write_default

    I must be doing something wrong. Note as I said before I have set the start address to 511 but I do see the new values 150 an 1200 stored in EEprom up above 511 so I think this is working properly

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


    Did you find this post helpful? Yes | No

    Default

    Hi Bob,

    Is the program jumping over those statements?

    Some people have a GOTO Start or something at the beginning, which doesn't allow the program to initialize the values.

    Those lines (and the INCLUDE) must be allowed to execute on Power-up.
    <br>
    DT

  7. #7
    Join Date
    Feb 2006
    Posts
    20


    Did you find this post helpful? Yes | No

    Default

    Hi Darrel, this is what I have:

    INCLUDE "Defines.bas"
    INCLUDE "EE_Vars.PBP" 'Darrel Taylors EE_Vars program
    INCLUDE "VarDefs.bas" ' These are my variable definitions
    Goto start 'Jump over assembly routine
    INCLUDE "AsmInt.bas" 'Assembly interrupt service routines
    INCLUDE "200819_2.BAS" 'Model#, Serial# configuration
    INCLUDE "LcdText.bas" 'Strings, lookup tables

    SysDat VAR WORD[100] 'This is in the VarDefs.bas include file listed above

    This is also in the VarDefs.bas INCLUDE FILE

    msNLamps VAR SysDat[50]:@ EE_var _msNLamps, WORD, 2

    SysDat is an Array the I created for looping through variables but this still seems to be ok. The 'start' label is after all of this. Shouldn't msNLamps be '2' when first programmed? I can set it to the default value if I do:

    @ EE_write_default _msNlamps

    after the start:

    Is there a way to reset all vars to the default value as if this was the 'First Run' you talk about. As I understand it if I assign default values using the 'EE_var' command that the default value is written and the variable will always be powered up to that value unless you change it. I seem to be getting values of 'FFFF' for word on power up until I do a 'EE_write_default'

    I know I've got something out of sorts but I'll keep trying. I also really like the EE_Vars program and thanks for sharing it. Starting to study macro's now too, but they don't really click yet.

    Thanks, Bob

    Shouldn't msNLamps be 2

Similar Threads

  1. Can't read sequential addresses in external EEPROM
    By tjkelly in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th February 2010, 15:46
  2. Problem with I2C EEPROM addressing
    By Atom058 in forum General
    Replies: 14
    Last Post: - 3rd November 2009, 04:17
  3. PIC16F684 + LCD to use the 256bytes of EEPROM - HELP
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 7th March 2008, 15:19
  4. How to write/read strings EEPROM/LCD
    By g-hoot in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 11th February 2007, 07:26
  5. word variable to 25lc640
    By TONIGALEA in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 6th July 2004, 20:59

Members who have read this thread : 1

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