about the stack operation error

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

about the stack operation error

2,120件の閲覧回数
m7Cgde
Contributor I

Hi,Dear Friends,

 

When the program returns from the Interrupt service program,the PC pointer must be poped from stack.But I found that the PC pointer is error,the stack content which is PC pointer saved is DE7F,but when poped from the stack,the PC pointer is FE7F.Could you help explain why?

 

Thanks.

 

Ningyinggen

ラベル(1)
0 件の賞賛
返信
4 返答(返信)

1,077件の閲覧回数
m7Cgde
Contributor I
Hi,Dear Friends,

Thanks for your reply, it is not the problem of stack size, I have a try to increasing stack size enough,but have the same problem.
0 件の賞賛
返信

1,077件の閲覧回数
peg
Senior Contributor IV

Hi,

 

How about you post your ISR code then.

 

0 件の賞賛
返信

1,077件の閲覧回数
bigmac
Specialist III

Hello Ningyinggen,

 

You might try increasing the size of the stack.  When the stack is too small, more often the stack will over-write static variables.  However, it is also possible that a write to a static variable, within an ISR, can corrupt the stack under these circumstances.

 

If the unspecified device that you are using has a very small amount of RAM, another possibility is to allocate global/static variables to zero page RAM.  This would allow you to increase the stack size.  With a small device, it is also inadvisable to attempt to implement floating point operations.  Nested interrupts should also be avoided.  These require copious quantities of stack.

 

Regards,

Mac

 

0 件の賞賛
返信

1,077件の閲覧回数
tonyp
Senior Contributor II
Could you be corrupting the stack while inside the ISR?
0 件の賞賛
返信