Drenov
- 26th October 2010, 16:18
Hello All,
I am looking to store an 8 bit look up table in an 18F4410. I would like to use the table read instructions. I am using MPLAB and I don't know how to put the data into the code space.
I have tried :
org 0x0100
LUT:
data 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
When that compiles the listing shows that it's been converted to a NOP
I can use :
addwf PCL,f
retlw 0x00
retlw 0x01
retlw 0x02....
But that takes 2 bytes to store each byte, and a few clocks wasted jumping about.
What is the best way to do this ? Any ideas / constructive advice always welcomed
Regards
Dren
<º))))><
I am looking to store an 8 bit look up table in an 18F4410. I would like to use the table read instructions. I am using MPLAB and I don't know how to put the data into the code space.
I have tried :
org 0x0100
LUT:
data 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
When that compiles the listing shows that it's been converted to a NOP
I can use :
addwf PCL,f
retlw 0x00
retlw 0x01
retlw 0x02....
But that takes 2 bytes to store each byte, and a few clocks wasted jumping about.
What is the best way to do this ? Any ideas / constructive advice always welcomed
Regards
Dren
<º))))><