PDA

View Full Version : My Head Hurts with Tables, Lookup, EXT etc etc



retepsnikrep
- 8th June 2012, 20:22
After some general guidance and ideas here.

I have a program which uses 255 parameters as an index to a table.

These parameters need to lead me to an address in a table which is made up of 3 hex bytes and a 3 character string.

Something like

0 = $12,$34,$44,"VOL"
1 = $22,$F4,$40,"AMP"
2 = $01,$57,$13,"SOC"


Each of the 255 parameters has a different set of values.

I would like a big list/table/memory area with all my data in it but i'm very confused about which is best to use. Lookup, Lookup2, EXT, Eeprom :?

I'm working with a 18F2620 Pic and Pbp 3.01

Thanks Peter

aratti
- 9th June 2012, 07:21
Peter, I would use eeprom.

Just load all your hex values with

EEPROM 0,[$12,$34,$44,$22,$F4,$40,$01,$57,$13,.............]

Then to load the value into a byte variable use read instruction.

READ index * 3 , byte_value

Cheers


Al.