Searching \ for '[PIC] oops - splitting in to multiple files' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page:
Search entire site for: 'oops - splitting in to multiple files'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] oops - splitting in to multiple files'
2004\10\13@114756 by Mcgee, Mark

My apologies, must've replied to the wrong thread.


{Quote hidden}

This message is for the sole use of the intended recipient. If you received
this message in error please delete it and notify us. If this message was
misdirected, CSFB does not waive any confidentiality or privilege. CSFB
retains and monitors electronic communications sent through its network.
Instructions transmitted over this system are not binding on CSFB until they
are confirmed by us. Message transmission is not guaranteed to be secure.

View/change your membership options at

2004\10\13@121942 by Jan-Erik Soderholm

face picon face
Mcgee, Mark wrote :

> I've managed to get my project working with relocatable code
> now - it's not too bad really.

Right !

> Here's some things to consider that I've realised with help
> from this list:-
> i) You need to add the lnk script for your PIC to the linker

Not realy, you add it to the MPLAB project in the project window.
When MPLAB sees a LNK file in the "Linker Scripts" group,
it make a lot of changes to the MPLAB setup automaticly.

> ii) Don't use org, use code instead


> iii) Don't use cblock or equ, use udata instead

And RES...

> iv) whenever you need to access something living/defined in
> another file use
> extern <label> in your file, and use global <label> to export
> the label from the owning file


> v) make include files for common constants and "include
> <>" where necessary.

If you like, yes, but the concept of relocatable code works just fine
without them.

> One thing I'm still not really sure about is the label/name
> given to a code section.

Whatever name having any meaning to you. If left blank, MPLAB
adds a name that definitly not have any meaning for you :-)

>  I see these appearing in the .map file (after
> enabling it in the build settings) with the name I've given
> each distinct code  block,

Right. It's nice to see each module stacked up with a clear
table of the individual sizes and so on.

> but how do
> I get the interrupt vector set up without doing this for 16F628A?
> "SomeIsrName code 0x004" - that still looks like an absolute
> declaration to me.

It is. No problem. Don't bother.

> Or is there a standard name I should give like this;
> "isr_code code followed by goto real_isr_code", that'll ensure
> that the correct code gets placed at the interrupt vector?

The LNK files as-supplied are not setup that way. You can add
some new SECTION's to the LNK file at the Reset and
Interrupt vectors, but then you have to take care when you
update your MPLAB environment with new LNK file. Do as
you like. There was an actual example of this posted yesterday
or the day before.

>  Say I compile for another  PIC model, will it
> adapt automatically?

Not as-is. But, frankly, is there realy nothing else that have
to be changed if your change PIC ? And the reset and interrupt
vector addresses are not likely to show up in some "canned"
library routines, are they ?

> The MPLAB IDE docs on MPLINK aren't very useful at all here, I find.

Maybe this specific case isn't descibed as such, but probably
the basic info to do the change is there, I'd guess...

IMHO, don't bother, specify your reset and interrupt vector
addesses in the CODE directives, and live with it.

View/change your membership options at

2004\10\13@122947 by William Bross

picon face
hardware headers...... header files..... no big deal, all PIC stuff!

{Quote hidden}

View/change your membership options at

2004\10\13@124715 by Mcgee, Mark

Must've been the hair trigger on my mouse!  There again, I am using Windows
XP, so maybe it was that! ;-)

> {Original Message removed}

More... (looser matching)
- Last day of these posts
- In 2004 , 2005 only
- Today
- New search...