Help!! how star with a lookup-table

Thread Starter

aleaguir

Joined Nov 3, 2006
1
I need to use a lookup-table to convert voltaje to Temparature using ATMEGA16. The problem is that i don´t how start the Lookup-table.
 

hgmjr

Joined Jan 28, 2005
9,029
You can place the look-up table in the cseg using .db compiler directive.

Rich (BB code):
Table7seg:
 
 .db  0xfd,0x90   ;0,1
 .db  0xa7,0xb6  ;2,3
 .db  0x9a,0x3e  ;4,5
 .db  0x1f,0xb0  ;6,7
 .db  0xff,0xfa    ;8,9
The inset is a lookup table I used to convert the digits 0 through 9 to their equivalent segments in a 7-segment display.

You can place it anywhere but I suggest you put it at the end of your executable code.

One more thing, when you access the table you will need to use the LPM - Load from Program Memory instruction.

hgmjr
 
Top