piclist 2008\07\05\105908a >
Thread: Code packing
face picon face BY : email (remove spam text)(Olin Lathrop)

Jinx wrote:
>> Sure, but I bet there is a lot of common code between projects
> Hmmm, no. Not really. I mean that, I thought long and hard. They're
> all so very different, on everything from 10F to 18F, and they have
> very little in common

While PIC projects really are very different from each other, I find some
things that I can reuse between projects.  These are the general structure
of projects, interrupt save/restore, UART I/O, input command stream
handling, multi-threading, timer 2 initialization for a periodic interrupt,
I/O pin initialization, and analog peripheral initial disabling.  Of course
not all projects have all these items, but there is a lot of commonality
when they do.

Other things don't seem to be all that common.  One of these is A/D
handling.  Every project is different enough that reasonably efficient
common A/D code doesn't seem possible.  I may look at what I did on a
previous project, but write new A/D code as needed.

> Tell you what though. I've got the current project at a stage where
> I'm happy to leave it for a short while and look into relocatable
> code. Then I can assess it for myself and see whether I really would
> benefit by switching

The RES directive and the private local namespaces per module make it worth
it by themselves, even if you don't really embrace the "relocatable" way of

Do you have a project you'd be willing to share the code for that's not too
big but no so small as to be trivial?  I might be interested in converting
it to relocatable mode and my development environment as a demonstration.
I'm not making any promises, but if there's code you're willing to make
public you've got little to loose.

Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.
<003401c8deaf$fc7eca70$0300a8c0@main> 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...