Data memory - explanation please


Results 1 to 10 of 10

Threaded View

  1. #3
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Hi Charles,

    Sorry, please bear with me as this is the first time I've experimented with saving data other than when programming mode.

    I want to save the following to the PIC once the user has set them so that in the event of a power failure they are remembered and the user doesn't have to re-enter the data.

    Code:
    save:
    Lcdout $FE,2
    LCDOUT $FE,$80,"Saving Settings"
    for fn= 0 to 3
    write ,lightsetHR[fn]
    write ,lightsetMN[fn]
    write ,lightoffHR[fn]
    write ,lightoffMN[fn]
    write ,droptemp[fn]
    write ,normtemp[fn]
    write ,StartHour[fn]
    write ,StartMin[fn]
    write ,StopHour[fn]
    write ,StopMin[fn]
    next fn
    pause 150
    goto mainmenu
    However as the program writes data to the memory at the time of programming and as part of the RTC settings (data@ 0,0 and data@150 respectively) I'm not sure what value to place before the colon after the word statement for each of the above. I don't want to corrupt the data stored at those data locations.

    For example - 0x50 address in that table appears blank (FF) - so could I use
    Code:
    write 0x50 ,lightsetHR[fn]
    Or whatever decimal 0x50 would be ???

    Hope that's clear ?

    Oh and I'm using DT's interrupts... would I need to use DEFINE WRITE_INT 1 withing that sub-routine ?
    Last edited by malc-c; - 1st August 2010 at 19:40. Reason: had an additional thought !

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