PCLATH and page switching - ICD
On Wed, 21 Mar 2001 07:33:39 MST, you wrote:
>Bob Ammerman <PRODIGY.NET> wrote: RAMMERMAN
>If you value your time at all: run to buy an ICD!
>OK...I agree, just need to see if the boss does too...I'm supposed to be smart
>enuf to not need it!
If you're smart enough not to need an ICD, you shouldn't be working
for someone who doesn't think a $99 investement is worthwhile!
>Reading over the specs, it targets the chips I am using (how lucky am I for
>that?), so the question begs to be asked...if my target assembly has the
>16F874, can I not build my own ICD? I thought someone had done this, since it
>simply interfaces to MPLAB.
>Of course its probably not that simple is it? It never is...
>But I have to go back...why isnt this working? I did a call to a display
>routine in page 2, set the bits...didnt do ANY calls or goto's in the called
>routine yet it won't work. Come on...this should be simple right? Of course
>once I get the ICD it will be obvious no doubt.
Remember that the bits are page preselect, not select. They determine
where the upper address bits come from on call and gotos only. Return addresses are pushed with the full address, but the bits are
NOT restored to PCLATH on return. e.g. From page 0 <SET PAGE 1>
<SET PAGE 0> ; if this is omitted, the next call or goto will go to
page 1, probably into the weeds.
What I usually do is this, which avoids having to remember which page
each routine is in. for routines called more than once it is fairly
Page 0 : call routine1
errorlevel -306 ; suppress warnings so we only see 'real' ones
<set page 1>
<set page 1>
errorlevel +306 ; re-enable warnings to see unintentional cross-page
page1exit <set page 0>
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email mitvma.mit.edu with SET PICList DIGEST in the body listserv
In reply to: <firstname.lastname@example.org>
See also: www.piclist.com/techref/microchip/devprogs.htm?key=icd
You must be a member of the
piclist mailing list
(not only a www.piclist.com member) to post to the