How would I store and retrieve any number over 255 in say a pic 18f2550


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2008
    Posts
    52

    Default How would I store and retrieve any number over 255 in say a pic 18f2550

    It may be simple but I'm not geting it.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    http://melabs.com/resources/samples/pbp/eeword.htm

    The LOW and HIGH byte need to be stored separately.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Default

    Hi,

    PBP 2.60 also adds a new feature:

    you can directly Write and Read Words and Longs ... ( see 2.60 Manual )

    But it's you to keep track of the position in the EEPROM ... to give the good address for the LowerByte of your number ...

    THIS
    Code:
    '****************************************************************
    '*  Name    : EE_Vars.PBP                                       *
    '*  Author  : Darrel Taylor                                     *
    '*  Date    : 8/22/2005                                         *
    '*  Version : 1.0                                               *
    '*  Notes   : Requires MPASM, NOT PM                            *
    '*          : This is an INCLUDE File for PicBasic Pro          *
    '*          : Please keep it as an INCLUDE File                 *
    '****************************************************************
    '* Linked                                                       *
    '*    EE_var   Variable, [BYTE/WORD], Value                     *
    '*    EE_read_var   Variable                                    *
    '*    EE_write_var  Variable                                    *
    '*    EE_write_default  Variable                                *
    '****************************************************************
    '* UN-Linked                                                    *
    '*    EE_byte       Name, Value                                 *
    '*    EE_word       Name, Value                                 *
    '*    EE_read       Name, Variable                              *
    '*    EE_write      Name, Variable                              *
    '****************************************************************
    here : http://www.picbasic.co.uk/forum/show...444&pagenumber=

    Also could be to consider ...

    Alain
    Last edited by Acetronics2; - 23rd December 2010 at 13:52.
    ************************************************** ***********************
    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