Sim Fra

Defining a variable fails

Discussion created by Sim Fra on Oct 6, 2008
Latest reply on Oct 29, 2008 by Jorge Andres Reyes Alvarez
Hello,

I use the CodeWarrior IDE 5.9.0.

In an application for the MPC5516, I define a variable outside of any function as follows:
static unsigned long intervalUL = 0x10;
Doing so, after flashing the application on the MPC5516, the value of intervalUL is 0xA5A5A5A5.

If I define the variable as
const unsigned long intervalUL = 0x10;
the value of intervalUL is always 0x200.

If I define the variable as
unsigned long intervalUL = 0x10;
the value of intervalUL is always 0xA5A5A5A5.

What do I do wrong? The question may not be the most complex one, but I really don´t know how to define the variable.

Thank you very much in advance.

Best regards

SimFr

Outcomes