跳至主要內容
Knowledgebase
Home
Renesas Electronics Taiwan - Knowledgebase

Error messages-Programcounter is odd-and-Stack pointer_E8/E8a

Last Updated:10/11/2017

Question:

The error messages “Programcounter is odd” and “Stack pointer is odd” are displayed when trying to execute a program with using the E8/E8a on a H8 family. How do I avoid it?

Answer:

About Program counter
Make sure whether downloading the user program or not.
Select the load module from [Debug] -> [Download] or select [Download] from the pop-up menu which is displayed by right clicking the load module name of [Download Modules] in [Workspace] window to download program.
Execute [Reset CPU] after that.
If the downloading is not completed, even if a user program sets reset vector, nothing is reflected. As a result sometimes the program counter is odd number or the stack pointer is odd number due to runaway after execution, so execute after downloading for sure. 
If it can not be helped by above troubleshooting, re-check the setting of the reset vector in your program.


About stack pointer
The initial value of the stack pointer is not determined on a H8 family, and it is prohibited that the stack pointer is odd number.
Also an emulator itself uses a user stack when the E8/E8a executes a user program, an initial value is set to RAM area on creating a workspace. 
However, the error message “Stack pointer is odd” is displayed when trying to execute after setting odd number on purpose or becoming odd number due to runaway.

In this case, the stack pointer is not changed even if you execute [Reset CPU].
Set ER7 or R7 register which is set in a user program to the same value manually as the initial value of stack pointer before execution by the following way.
Open the register window by selecting the High-performance Embedded Workshop menu [view] -> [CPU] -> [Register] and set the value.

Suitable Products
E8a
E8
  • 本文是否實用?