This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Code works after giving a debug statement

Hi,

I have experienced a strange problem. When a particular variable is initailised to a particular value, sometimes it never works. But if a debug statement is put before the initialisation statement, it starts to work.

This problem need not be only during initiasation but this can happen anywhere( i.e... before calling a function or initialising the structure variables etc..). Strange thing is that after removing the debug statement and recompiling, The code works properly.

Sometimes it need not be only debug statement, a "delay" or "wait" can also work wonders.

We are using C51 compiler - ver 3.20. Pls let me know if there is any solution for this. Thanks in advance.

Guruprasad K