dWord variables


Closed Thread
Results 1 to 8 of 8

Thread: dWord variables

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default 24 bit memory addressing

    I am using the M25P128 memory chip which needs a 24 bit address. I use

    Addr0 var byte ' LSB of 24 bit address
    Addr1 var byte
    Addr2 var byte ' MSB of 24 bit address

    Every time Addr0 overflows I increment Addr1.
    Every time Addr1 overflows I increment Addr2.

    In my case I run Addr2 all the way up to FF. In your case Addr2 will only be 0 or 1.

    HTH
    BrianT

  2. #2
    xnihilo's Avatar
    xnihilo Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by BrianT View Post
    I am using the M25P128 memory chip which needs a 24 bit address. I use

    Addr0 var byte ' LSB of 24 bit address
    Addr1 var byte
    Addr2 var byte ' MSB of 24 bit address

    Every time Addr0 overflows I increment Addr1.
    Every time Addr1 overflows I increment Addr2.

    In my case I run Addr2 all the way up to FF. In your case Addr2 will only be 0 or 1.

    HTH
    BrianT
    Right. Thanks.
    I use address_low as a word var and address_high as a word var.
    When address_low overflows, it increments address_high by 1.

    I use a word var because with that I can increment this variable up to $FF.

    I think it should do the trick.

Similar Threads

  1. Max Variables
    By shawn in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 19th January 2008, 05:05
  2. Changing declared variables names on the fly
    By jessey in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 16th December 2006, 07:34
  3. 32-bit Variables and DIV32, Hourmeter 99999.9
    By Darrel Taylor in forum Code Examples
    Replies: 9
    Last Post: - 23rd November 2006, 08:23
  4. Variables not appearing in Watch Window MPLabv7.3
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 16th June 2006, 15:36
  5. Problems with variables
    By egberttheone in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th December 2004, 19:37

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