use of DATA and READ


Closed Thread
Results 1 to 3 of 3
  1. #1
    smikes's Avatar
    smikes Guest

    Default use of DATA and READ

    When using DATA in pbp, an optional label may be used. The assembler (MPASM) with an 18Fxxx part uses even address (WORD) boundaries for EEPROM BYTEs, thus the labels are on even boundaries.

    BYTEs are aligned on WORD address boundaries when entered, according to the MPASM list file. How does this affect the use of READ i,j? Does the 'i' correspond with the WORD address boundary, or the actual byte offset in the table? If the label is based on a WORD boundary, must it be divided by 2, or used directly as the entry point in the table?

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


    Did you find this post helpful? Yes | No

    Default

    Hi smikes,

    Data, Read and Write operate on the EEPROM, which are byte sized locations. They are not affected by labels or word boundaries.

    ReadCode and WriteCode work with Code space. For more info on these two, check out Melanies thread called "Making Program Code Space your playground... " in the Sample Code section.

    Here's a link to that thread.

    http://www.picbasic.co.uk/forum/show...=&threadid=137

    Best regards,
      Darrel Taylor
    Last edited by Darrel Taylor; - 18th December 2003 at 19:55.

  3. #3
    smikes's Avatar
    smikes Guest


    Did you find this post helpful? Yes | No

    Default Found the answer

    Thanks Darrel,

    But that's not my problem. I understand what the instructions do. I found the potential problem by examining the assembler code generated by MPASM win, v3.50. I actually found the answer when I spoke with Jeff Schmoyer. It's due to a compatibility issue between pbp and MPASM.

    It seems that my version of pbp, 2.43, generated the asm instructions 'DE' per each byte requested by the DATA statement. The Microchip assembler, v3.50 and earlier, builds that instruction into WORDs, at least for the 18F family, thus tossing a byte of EEPROM each time. Jeff said they (Microchip) have never changed it, so he has a later version of pbp that solves the problem by using a different approach.

    Thus, if anyone is using the EEPROM or DATA statements in a program targeted toward an 18Fxxx part, a compiler upgrade may be needed.

Similar Threads

  1. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 04:47
  2. SEROUT WORD variable problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th April 2009, 11:20
  3. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 02:21
  4. LCD + bar graph
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th October 2005, 14:50
  5. Sinus calculating !
    By Don Mario in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 28th November 2004, 23:56

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