Searching \ for '[PIC] Examples of project with MPLINK' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Examples of project with MPLINK'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Examples of project with MPLINK'
2004\10\13@095701 by Mohit Mahajan

flavicon
face
I am looking for sample projects/tutorials for MPLAB with MPLINK.

The posts on "Splitting assemblies in to multiple files" have interested
me to move away from absolute to relocatable code. I understand the
concept but don't know how to actually go about it.

The samples in Microchip's MPLINK tutorial (DS51185A.pdf) use C
programs. I would like examples in asm with multiple files (lcd.asm,
keypad.asm etc.) and how to link them in a main program.

Regards,
Mohit.


_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\13@105317 by Alan B. Pearce

face picon face
>The posts on "Splitting assemblies in to multiple files"
>have interested me to move away from absolute to
>relocatable code. I understand the concept but don't
>know how to actually go about it.

Well I would re-iterate the advice I gave in that thread, to go and download
Olin's development environment, and example projects. The Halloween whatsit
is a good complete example of what to do. Do observe his installation
instructions though, to ensure that everything is installed correctly.

http://www.embedinc.com/pic/


_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

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

face picon face
Mohit Mahajan wrote :

> I am looking for sample projects/tutorials for MPLAB with MPLINK.

I posted one Yesterday (or the day before) in the thread you mention
below. Did you see that one ?

> The posts on "Splitting assemblies in to multiple files" have
> interested me to move away from absolute to relocatable code.
> I understand the
> concept but don't know how to actually go about it.

Frankly, I can not understand why this sometimes is regarded
as something hard or complicated !! It's realy simple actualy.

If you want to stay with the MPLAB environment, there is actualy
just two things to do (for a *single* file project) :

1. In the "Project" (.mcw) window, add a "Linker Script". Just
  add the LNK file mathing your PIC from the LNK directory
  in the MPLAB installation directory. When you do that, MPLAB
  automaticly changes the command line switches used when
  calling MPASM (and now MPLINK, of course).

2. Make whatever changes needed to your source code. Such as:
  ORG => CODE
  EQU and CBLOCK => RES
  (Or just begin writing it in the right way, if you don't have
  any code to convert...)


For a *multiple* file project you have to add the a bit more.
GLOBAL (for symbols that must be "seen" in other modules),
EXTERN (to "see" symbols in other modules) and so on. See
my examples that I posted... See the online help in MPLAB
for the syntax of those.

For the time beeing you can still specify absolute addresses
for the Reset and Interrupt vectors (using CODE). One can
change the LNK file to get away with that, but IMHO that isn't
needed to begin with.

Olin Lathrop also have a complet environment (not using MPLAB)
that is using relocatable code (and a lot of other stuff), but then you
have a *LOT* more to do then the simple steps above, and I'd not
recomend that for the avarage hobbyist. It's nice for large
projects, in particular if you belive that your application will be
moved between different PIC models.

So, when you have added the LNK file (and begun writing your code
in the right way), you can more or less forget about the linker, it's
just an integral part of MPLAB and MPLAB takes care of calling
MPLINK whenever needed.

> The samples in Microchip's MPLINK tutorial (DS51185A.pdf) use C
> programs. I would like examples in asm with multiple files (lcd.asm,
> keypad.asm etc.) and how to link them in a main program.

As I said, by reading those docs, you can easily get the impression that
this is something complicated. It isn't. Just add the LNK file
to your project and MPLAB takes care of the rest. You have to
write your code the right way, of course :-)

- See my examples I posted.
- Change them into a project with your own code.
- Come back when (if) you're stuck... :-) :-)

Best Regards,
Jan-Erik.
_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\14@023828 by Mohit Mahajan

flavicon
face
Thanks Jan-Erik,

> - Come back when (if) you're stuck... :-) :-)
Will do so.

Regards,
Mohit.

> {Original Message removed}

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