Fullfilling lookup tables


Closed Thread
Results 1 to 16 of 16

Hybrid View

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

    Question Fullfilling lookup tables

    Hi, Everybody

    Suppose we want to have a 250 values LOOKUP table ....

    Writing all values by hand is quite boring and not error-free guaranteed ... isn't it ???

    Now, working with MPLAB ( or else ) permits to locate the beginning of the RETLW xx list in the ASM listing .... and we know how to include a text file containing RETLW xx 's , ... coming from an Excel page or so ... precomputing media.

    Would it be possible to find something to include the DATA file into the PbP brackets ( easiest solution !!! ), or a modifier, i.e " REP x\250 ", or another trick to keep free space in the ASM Listing to allow including the DATA file .... ????

    Alain
    ************************************************** ***********************
    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 " !!!
    *****************************************

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


    Did you find this post helpful? Yes | No

    Default

    Or i'm dumb or i need more cofee but i can't figure out what you ask for.

    Please, help the old Quebecer guy to understand. It sounds an interesting idea overall, it's just unclear to me...

    Un dessin, un dessin, un dessin
    Steve

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

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


    Did you find this post helpful? Yes | No

    Wink Bad trip ???

    Hi, Steve

    No design needed .... just strong coffee.

    You want a big lookup table ... how to fill automatically, from an existing text file, the values between the brackets ???

    Of course with a PbP source program ...

    1St way : a modifier in the LOOKUP statement, plus including the file at the right ASM line ???
    2Nd way : include the text file between the brackets ...????
    3Rd way : ????

    Last way: Modify the Lookup routine !!!
    Lazy way : Copy and Paste .....

    PbP 's hard point is there is a L 00001 label that is inserted by the compiler just past the LOOKUP routine ... so, impossible to only use the ORG directive to make room !!! The brackets must contain the right number of constants ...

    Alain
    Last edited by Acetronics2; - 25th July 2006 at 15:04.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Hi Alain. If you figure out a way to do this, it would help alot. Right now I'm using about 8K of code space that repeats the same opcode to an ISD5008 using the shiftout command. However, each opcode has a different address. To put these different addresses between the brackets into a lookup table re-using one opcode would shorten the code much.

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


    Did you find this post helpful? Yes | No

    Default

    Hi,Peter

    The only way I see at the moment is to create a simple program ( GW or QBasic ...) that gives your DATA bytes separated by a comma ... into a .txt file.

    Then, you copy it and paste between the brackets. so simple as this !!!

    Of course it must exist a mathematical relation between input and output ... or the loading can't be made else than by-hand !!!

    I think I'll have a look to the SIN routine in the PbP libs ... to see if it's possible to modify it. ( or a similar routine )

    Alain
    ************************************************** ***********************
    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 " !!!
    *****************************************

  6. #6


    Did you find this post helpful? Yes | No

    Default

    Hi Alain. I guess I wasn't being clear in my last post. For example, someone pushes a series of buttons. Each button is a different ISD address. Now comes playback time. What I have done that is memory intensive is this:

    ShiftOut PORTC.5,PORTC.3,0,[FIRST\16] 'first is variable for 1st playback address
    ShiftOut PORTC.5,PORTC.3,0,[SECOND\16] 'second is variable for 2nd playback address
    ShiftOut PORTC.5,PORTC.3,0,[THIRD\16] 'third is variable for 3rd playback address

    Now, if those variables were written into the program by itself such as [224,132,188] I could use the lookup command, put it into X and use something like:

    ShiftOut PORTC.5,PORTC.3,0,[X\16] 'X is variable for all addresses
    next X

    Right now I have 20 address variables & 20 shiftout commands and a large block of code that says LET FIRST = 111, LET SECOND = 222, etc. I even thought of using read & write but the problem is getting those numbers into brackets. - Peter

Similar Threads

  1. PICs can do more if use others than delays instructions
    By hardcore in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 24th February 2010, 19:52
  2. ADCIN and LOOKUP ...
    By Acetronics2 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th June 2007, 21:02
  3. problem with USART
    By leemin in forum Serial
    Replies: 4
    Last Post: - 11th December 2006, 17:56
  4. Confused On Dig & Lookup
    By SOMRU in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 5th December 2006, 21:49
  5. Using large lookup tables
    By speck in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th April 2006, 21:40

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