How do I get DATA @ to work with a 18F452?


Results 1 to 9 of 9

Threaded View

  1. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    I didn't quite understand your explanation that it must be split WORD sized in 2 BYtes or how to do that for the particular word variables that I want to use in my DATA statements? If my DATA @ statements must work AS IS then why would the WORD sized variables have to be split into 2 bytes?
    It's just because, as far as i'm aware of, DATA statement don't accept the WORD sized data you enter in. I just re-check it, and if you use
    DATA @0, $1234,$5678

    The DATA will load $34 @0 and $78 @1. Just for that. You'll need to split your data like...
    DATA @0,$12,$34,$56,$78

    Now Read back the results to the var as i did in the previous example with .LowByte and HighByte.

    There's also other way to do it Using MPASM statement and few assembler lines... up to you.

    Darrel Did something interesting in the Code example section.
    http://www.picbasic.co.uk/forum/show...ghlight=EE_var

    There's also another way to do it
    Code:
    data           @0, $12,$34,$56,$78
    data           word $abcd
    data           word $A1B2
    This will load your EEPROM like this
    Code:
     Address  00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F      ASCII      
    
       0000   12 34 56 78 CD AB B2 A1 FF FF FF FF FF FF FF FF .4Vx.... ........
       0010   FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ........ ........
       0020   FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ........ ........
       0030   FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ........ ........
       0040   FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ........ ........
       0050   FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ........ ........
       0060   FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ........ ........
       0070   FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ........ ........
       0080   FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ........ ........
       0090   FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ........ ........
       00A0   FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ........ ........
       00B0   FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ........ ........
       00C0   FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ........ ........
       00D0   FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ........ ........
       00E0   FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ........ ........
       00F0   FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ........ ........
    But you still need to load you value with .LowByte and .HighByte
    Last edited by mister_e; - 2nd February 2006 at 04:26.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Char. LCD and 18F452 on 20 MHz not work
    By samettin in forum General
    Replies: 11
    Last Post: - 28th July 2008, 09:59
  2. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30
  3. Internal EEPROM Read/write Addressing Errors with 18F PIC's
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 18
    Last Post: - 12th July 2005, 19:42
  4. help
    By zugvogel1 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th February 2005, 20:42
  5. Need once your help one please
    By zugvogel1 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 9th February 2005, 20:33

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