Data tables in ROM


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2010
    Location
    Europe
    Posts
    2

    Thumbs up Data tables in ROM

    Hello All,

    I am looking to store an 8 bit look up table in an 18F4410. I would like to use the table read instructions. I am using MPLAB and I don't know how to put the data into the code space.

    I have tried :

    org 0x0100
    LUT:
    data 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07

    When that compiles the listing shows that it's been converted to a NOP

    I can use :
    addwf PCL,f
    retlw 0x00
    retlw 0x01
    retlw 0x02....

    But that takes 2 bytes to store each byte, and a few clocks wasted jumping about.

    What is the best way to do this ? Any ideas / constructive advice always welcomed

    Regards

    Dren

    <))))><

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


    Did you find this post helpful? Yes | No

    Default

    Maybe you did not notice but this forum mainly deals with Pic Basic Pro.
    Are you using PBP? If not you may want to try here
    http://www.piclist.com/techref/piclist/index.htm
    Or are you trying to save a bit by using ASM?
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Oct 2010
    Location
    Europe
    Posts
    2


    Did you find this post helpful? Yes | No

    Default

    I found I could get around it by using :

    data 0x0000
    data 0x0001...

    (stands up)

    My name is Dren and... I am an alcoholic !

    (long pause)

    ...err, I seem to be in the wrong room ?

    (shuffles off awkwardly)

Members who have read this thread : 1

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts