DW is "Declare Data of One Word" in assembly language.
And, sounds like you've got the right idea for the rest of it.
<br>
DW is "Declare Data of One Word" in assembly language.
And, sounds like you've got the right idea for the rest of it.
<br>
DT
That's a rather involved calculation to be sure. Honestly, I gave up trying to follow it.
You have just 1024 input values, I assume these lead to 1024 discrete output values else you wouldn't be looking for a look-up table solution.
However, can you solve this by some other simpler method? Piecewize linear, interpolation polynomial, or such? Do you have say an excel spreadsheet with the results calculated?
Also, you don't need EEPROM to save values, you can use RETLW (Return with literal in W) to get a byte look up table, that will take 2048 memory locations to get 1024 words (and yeah, its assembler, but not much).
What type of thermometer do you use ?
I always make a table of maybe 30 points and make an interpolation between this points. It is good for me, but I don't know, what you need...
PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2
Ernie,
Yes I do have an excel spreadsheet with the values calculated. And I could possibly linearize the curve but loose accuracy. But about this RETLW command, how does it work and where can I find the syntax etc etc for it?
Darrel,
I don't think I can use that approach since the ADCIN command only lets you store the result in a VAR not a CON. How would I tell it what values from 0-1023 to pull out from memory?
The reading from the POT should be put in a variable.
The CON is the address of the Data Table that gets stored in program memory.
Then the A/D reading would be used as an offset into the data table in order to find the correct value.
<br>
DT
Thanks Darrel,
I works GREAT! I just hope now there isn't a limit to the number of values I can put in the Datatable. If there is, then i'm praying that its 1024!!!!!
Nope,
You are only limited by the amount of available memory in Program Space.
Cheers,
DT
Bookmarks