gnupic: Switching processor for gpsim
Subject:
Re: Switching processor for gpsim
From:
Chris Emerson ####@####.####
Date:
21 Apr 2004 09:34:12 +0100
Message-Id: <20040421083405.GA27390@ixion.tartarus.org>
On Wed, Apr 21, 2004 at 09:01:58AM +0100, Matt Marsh wrote:
>
> > What I'd really like to do is to have some way of automating
> > this, so that I can build my project either for simulation,
> > or for a real chip, and have it set those two lines as
> > appropriate. So what I'd really like is two make targets, say
> > "projname.hex" and "projname-sim.hex" where those two lines
> > are set appropriately. Can anyone think of a way of doing this?
>
> Actually, thinking about this a bit more, I guess I'll
> generate a 'processor.inc' file as part of each of the make
> rules for the two targets and include that generated inc file
> in the assembly source. That should work. I'll give it a try
> later and post the results.
That sounds like it could get into sticky difficulties with
dependencies...
Try something like this:
ifdef __16F84
include "p16f84.h"
else
include "p16f84a.h"
endif
And then you can add "-p16f84" or "-p16f84a" to your gpasm command line
as appropriate.
Having said that, I think the '84 and '84a are identical as far as
simulation is concerned, so you needn't bother here.
I presume you've read the various reasons not to use the 16F84 anymore?
(More expensive and less capable than new chips like the 16F628, 16F88,
etc.)
Chris