Lookup Tables


Closed Thread
Results 1 to 8 of 8

Thread: Lookup Tables

Hybrid View

  1. #1
    Join Date
    Nov 2008
    Posts
    26


    Did you find this post helpful? Yes | No

    Default Low cost option

    Have you considered the MCP9700 temp sensor from Microchip.
    About to use one on a project myself, Cheap £0.22 @10off in farnell and hopefuly a lot less coding than a Thermistor.

  2. #2
    Join Date
    Dec 2004
    Location
    nebraska
    Posts
    79


    Did you find this post helpful? Yes | No

    Default

    Thanks guys for posting.
    That helped me understand the lookup table.
    Would it be faster and take up less code if I placed the table inside of an eeprom. Also to get the resolution I want over the temp. range I want, I think I am going to switch to a mcp 3202 12bit ad chip.

    Another question for ya all. If I am reading a temp of 70.8 is it possible to store that in a 1 byte memory location. How I handle this now is to put the 70 in the high byte of a word variable and I put the .8 in the low byte.This works very well but doubles the memory requirments.

    Thanks to You all
    Nick

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


    Did you find this post helpful? Yes | No

    Default

    A correction to my not so good example
    Code:
    'Lets say 
    TXI = 0
    GOSUB D_INDEX
    ' Now TXIU will hold the value 2500
    " If Index is zero, Var is set to the first Value."

    Would it be faster and take up less code if I placed the table inside of an eeprom.
    Faster-- No, it takes time to read the EEPROM. Less code-- Probably yes.

    If I am reading a temp of 70.8 is it possible to store that in a 1 byte memory location.
    Not that I can think of.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Storing 1024 WORD values in LOOKUP2 statements would take over 8K words of program space.

    But using the technique described here ... http://www.picbasic.co.uk/forum/show...php?t=3891#LAB
    You can do it with just over 1K.

    Faster, smaller, no external parts.
    DT

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