PDA

View Full Version : Has this being fix with 2.45?



TONIGALEA
- 1st June 2004, 12:49
If you use DATA or EEPROM to load values into data space at program time, you will encounter inconsistency in the addressing of this data. The Microchip assembler won't address odd-numbered locations in data space. Therefore, you have to multiply the addresses in the DATA and EEPROM statements by 2. The EPIC programmer will correct the addresses at program time, so you can read the values back without the address doubling.

Example:
Data @8,"E","F","G","H"

Read 4, result ' result = "E"
Read 5, result ' result = "F"
Read 6, result ' result = "G"
Read 7, result ' result = "H"

Toni

NavMicroSystems
- 1st June 2004, 13:36
Toni,

I have had a similar problem, see the following thread:

http://www.picbasic.co.uk/forum/showthread.php?s=&threadid=255&highlight=eeprom

picnaut
- 1st June 2004, 15:52
Hello,

I haven't noticed any weird addressing problems and I load a lot of data into e-squared at program time.
I use the EEPROM command.

i.e.

EEPROM MemLoc, [DataByte0, DataByte1, DataByte2, etc...]

IF I am loading word-sized values I use the following:

EEPROM MemLoc, [DataWord0HiByte, DataWord0LoByte, etc...)

If you have a lot of word values to load, this could be pretty tedious. You may want to write up a little VB application to generate the code from a table of word values. Otherwise, you need to convert each word value to hexadecimal and split the word's high bytes and low bytes and program them into the EEPROM seperately. This is what I've used and it works for me.

Cheers!

TONIGALEA
- 2nd June 2004, 13:02
Have tried this with the 18F series of pic's ?

Toni

picnaut
- 2nd June 2004, 15:02
Hi,

No, I haven't tried this with the 18F series PICs.

:(

I hope this is NOT a compiler problem.