DPRG List  

[DPRG] HELP with 68HC11 stack problem

Subject: [DPRG] HELP with 68HC11 stack problem
From: Jeff Sampson jsampson at pobox.com
Date: Thu Jun 21 14:20:40 CDT 2001

Is it possible something is being done in the wrong order?

So on power up it doesn't work. But on a reset something has already
been setup so it now works.

Jeff Sampson
jsampson at pobox.com

Mike McCarty wrote:

> I agree with the facts as you state them, and that the initial stack
> address is suspicious, but I fail to see how it explains why his
> program would work on a straight RESET but not on POWER ON RESET. If
> his stack is incorrectly being set, then that is a fact which will not
> be altered by the type of reset being used.
> > I have read the other responses and would like to add my 2 cents
> > worth.
> >
> > There are 4 types of stack mechanisms.  They are pre increment,
> > post increment, pre decrement and post decrement.  Pre refers to
> > whether the pointer is changed before the write to memory and
> > post refers to after the write.  Then there is incrementing and
> > decrementing which is self explanatory.
> >
> > The 68HC11 uses a post decrement type of stack pointer.  The data
> > byte is written then the pointer is decremented.  When the stack
> > is set up you want the pointer at the last address of the RAM
> > memory.  $4000 doesn't sound right.  It sounds like the beginning
> > address of a memory space and there my not be memory chip there
> > to write the first by on the stack to.  $3FFF sounds like a more
> > reasonable pointer.
> >
> > I agree there are a couple of other things to check.  Make sure
> > you have the MODA and MODB pins set correctly.  This gets
> > complicated when your program starts from internal memory.  Your
> > program can turn on the external memory by writing to one of the
> > configuration registers (I don't have the data here to give you
> > the details).

More information about the DPRG mailing list