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

Getting Watchdog timer reset

Hi,

For executing asm instructions in C51 compiler(KEIL IDE) I did 1.Enable Generate Assembler SRC file and 2.Enable Assemble SRC File.

After settings done, i had compiled and make the file without errors. When start for simulation/debug continuously issuing watchdog timer reset.

I have not receiving any errors and debug problems when I won't done above settings and won't add asm instructions.

Please help on this.

and please help me how do i can clear the stack or reinitialize the stack after receiving the software reset.

Thanks with regards

Eranna K

  • "For executing asm instructions in C51 compiler..."

    Why do you want to do that?

    "Enable Generate Assembler SRC file"

    Think about what that does: exactly as it says, it generates an assembler source file: so the C51 compiler does not "execute" assembler instructions - it simply translates the entire 'C' source file into assembler...

    "Enable Assemble SRC File"

    The assembler does not know that this SRC files happens to be the compiler's output; it just treats it as any other assembler source file.

    So, rather than have the compiler translate your 'C' source to assembler, why not let the compiler do its full job of creating an Object file?
    Then create a separate assembler file (or files) with any function(s) that you need in assembler.

    For an example, see: www.8052.com/.../149030

    Note that, when the C51 compiler creates an Object file, it does include information that allows the Linker to recognise it as a 'C' file. When you do the 'C' to ASM conversion, this does not happen, and so the Linker cannot tell that it came from 'C' - and so it will not automatically include all the necessary runtime support for a 'C' program.

    The best way, I think, to avoid this is simply to not use the SRC directive.
    If you really, really must use it, then ensure that you apply it only to those files that specifically require it.
    Probably best to ensure that the file containing main() is not compiled with the SRC diective!