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

debugging of digital systems

sir,
i am using basic 8051 microcontroller
how is it possible to get the value of the program counter through c program.

i need to keep track of the program counter value. whenever it reaches certain specified value, the program execution has to be stopped.the new value may be reloaded from the user specified

waiting for your reply
ravikira

Parents
  • I strongly suspect you don't know what you're talking about.

    The program counter keeps changing constantly, as the program executes. In particular, it'll always have the exact same value when any given instruction is executed --- that instruction's address in code memory.

    The thing you're trying to construct is called a breakpoint, and you need special hardware to create one on an 8051. Once you have that hardware, the Keil toolchain's debugger will let you set breakpoints, so there's absolutely no need to DIY. Until then, use the simulator.

Reply
  • I strongly suspect you don't know what you're talking about.

    The program counter keeps changing constantly, as the program executes. In particular, it'll always have the exact same value when any given instruction is executed --- that instruction's address in code memory.

    The thing you're trying to construct is called a breakpoint, and you need special hardware to create one on an 8051. Once you have that hardware, the Keil toolchain's debugger will let you set breakpoints, so there's absolutely no need to DIY. Until then, use the simulator.

Children