Code works wierdly in standalone mode but works fine in Emul

Hello,

The code works wierdly when the code is loaded in the controller and let run in standalone mode. SOme times it works fine sometimes it crashes. But the same code work fine with the JTAG Emulation.

Please can someone suggest where i am doing the mistake.

I am using timer B in the program.

Thanks

-Guru

Hi. :idea:

It might be that your interrupt code cycle is sometimes longer that time cycle in timer.

The interrupt routine is short and runs with in a smaller duration than timer configured value. The timer is configured for 200ms interrupt and the processor runs at 125nsec (8Mhz).

The behavior is very random.

Ok, Your stack can is scratch by data stored in RAM ? Your interrupt routine or your program write great data in RAM ?

Perhaps you have something wrong with your hardware, like the reset pin floating when the JTAG is removed.

Leon

… Or, power supply voltage too low, noise, …

Did you setup the stack pointer? I’ve had code run quite oddly when the stack pointer pointed to nonexistant memory [sometimes it would work!]

Cheers,

–David Carne