piclist 2008\07\04\195225a >
Thread: Code packing
www.piclist.com/techref/microchip/devices.htm?key=pic
face picon face BY : Jinx email (remove spam text)



> Again, I think you want DB not DE, but otherwise this looks fine

I'd generally use db for something like '0'-terminated strings in program
memory and de for EEPROM. Just my way of doing things, and de is
a reminder of which memory the data is going to

> Also, while F00000h is correct for all 18F as far as I know, it is
> different for other PICs

There's just 0x2100 and 0xF00000. Had a glance at the 30F3012
d/s (might be looking at a project that would suit a 3040) and
EEPROM handling appears quite different for that range

> I don't like hard coding the EEPROM start address into the code,
> so I use the symbol EE_START which is defined seperately
> depending on the processor being built for

That's a definition that you'd think *should* be in the .inc file. Now
that you mention it, I'll do that

> Of course CODE_PACK won't port to other than a PIC 18, but
> I still think it's better to use a symbol.  A symbol like EE_START
> is a better hint than F00000h unless the reader happened to
> remember that EEPROM starts there on PIC 18.

Symbols should be used and are obviously more meaningful than
bare numbers. This code uses so many 18F features it's not going
to work in another PIC without a lot of re-writing, but that's no
excuse for at least trying to make it look good


<01b901c8de30$ebdaa330$89aafea9@ivp1> 7bit

See also: www.piclist.com/techref/microchip/devices.htm?key=pic
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Code packing

month overview.

new search...