writing word variables to data memory


Results 1 to 14 of 14

Threaded View

  1. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by malc-c View Post
    http://www.picbasic.co.uk/forum/show...2176#post92176

    Just don't quite understand it... (sorry I'm thick ! - care to actually explain how I would do this " Aliases " ... where it is shown how to " slice " your values thing ?)
    Ok Malc ...

    let's make it easy :

    The last PBP2.60 Version has introduced a Qualifier that permits you NOT to care with slicing your variables ...
    so, if you own a v2.60 ( and You SHOULD ) ... the link you gave me becomes ... obsolete.

    as you, NOW, just have to write:

    WRITE Location, Word AlarmHigh[1] , Word AlarmHigh[2] , Word AlarmHigh[3] ,...

    READ Location, Word AlarmHigh[1], Word AlarmHigh[2] , Word AlarmHigh[3], WA[1],WA[2],WA[3]

    BUT remember a word need 2 EEPROM locations ... so,

    WRITE Location +6 , Word AlarmHigh[4]
    READ Location +6 , Word AlarmHigh[4] ,WA4

    Alain

    PS: of course, you can keep on using the " old method "

    WRITE Location, AlarmHigh[1].Lowbyte
    WRITE Location+1, AlarmHigh[1].Highbyte
    WRITE Location+2, AlarmHigh[2].Lowbyte
    WRITE Location+3, AlarmHigh[2].Highbyte
    WRITE Location+4, AlarmHigh[3].Lowbyte
    WRITE Location+5, AlarmHigh[3].Highbyte
    WRITE Location+6, AlarmHigh[4].Lowbyte
    WRITE Location+7, AlarmHigh[4].Highbyte

    ... but, is it really reasonnable ???
    Last edited by Acetronics2; - 5th August 2010 at 12:53.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

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