Shop OBEX P1 Docs P2 Docs Learn Events
Lookup table in SX28 ? — Parallax Forums

Lookup table in SX28 ?

DavehamDaveham Posts: 2
edited 2006-11-20 14:43 in General Discussion
New user here....

I'm working on a project that requires a 512 byte look up table. Based on on a set of inputs, certain blocks of this look up table will be clocked out. The program to access and clock out parts of the look up table should be very simple (requiring little program memory).

The data sheet indiacates that the SX28 has 2K bytes of EE memory so is the SX28 a good candidate for this?·I'm a little confused about the memory banks.

Thanks for any help.

David.

Comments

  • YendorYendor Posts: 288
    edited 2006-11-19 03:29
    If you're using SX/B you can use DATA statement and put your values in there, and don't have to worry about databanks, as SX/B handles that for you.

    Then you can use the READ or READINC functions to read in values from the data statement, based on your input.

    There's also a LOOKUP in SX/B, but with that many values, is you're limited to the number of characters in one line in the IDE.

    I'm using 128 WORDS, and several byte lists using DATA statements on an SX28, and still chugging along fine w/ Codespace.

    Rodney
  • JonnyMacJonnyMac Posts: 9,213
    edited 2006-11-20 14:43
    I agree with Rodney and use READ and READINC quite frequently in my programs. If you're storing words you'll need to use WDATA instead of DATA (unless you want to place the values manually, little Endian). See the READ section of the SX/B help file for examples of storing and retrieving values from a table.
Sign In or Register to comment.