PC pointing to SFR after Watchdog

Hi All,

I am working on a Renesas M16C Micro and I am having problems debugging my code....

I get a watchdog at a certain point in my code. I am unable to figure out where the watchdog occurs because the program counter points to special function register 0x000343.

Is it possible that the program counter can ever point to a special function register? I thought it should always point to an instruction.

Thanks

Reply to
hendrik
Loading thread data ...

And why would you want to know that? A genuine watchdog bite, as opposed than one you triggered on purpose, will occur at a moment that is, for all practical purposes, perfectly random. When or where it happens has nothing to do with the actual problem that caused it.

Possibly --- I don't know that architecture. But since it's apparently von-Neumann enough that an SFR address can even _be_ in the PC register, then well, if you jump to an SFR's address, that's what it'll point to. But odds are you're expressly forbidden from doing that, by some statement in the datasheets. Not to mention that common sense already forbids it.

It should. But are your sure your program isn't doing what it shouldn't, like jump to never-never-land and happen to land in SFR-space?

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
Reply to
Hans-Bernhard Broeker

And why would you want to know that? A genuine watchdog bite, as opposed to one you triggered on purpose, will occur at a moment that is, for all practical purposes, perfectly random. When or where it happens has nothing to do with the actual problem that caused it.

Possibly --- I don't know that architecture. But since it's apparently von-Neumann enough that an SFR address can even _be_ in the PC register, then well, if you jump to an SFR's address, that's what it'll point to. But odds are you're expressly forbidden from doing that, by some statement in the datasheets. Not to mention that common sense already forbids it.

It should. But are your sure your program isn't doing what it shouldn't, like jump to never-never-land and happen to land in SFR-space?

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
Reply to
Hans-Bernhard Broeker

Hendrik,

Do you use a C compiler or do you program in assembly ?

Before being able to provide a uesful reply you should describe what you are doing.

This also includes what the M16C Watchdog is set up to do. If it is set to trigger an interrupt you should carefully check the entries of the interrupt vector table.

Other than that you am also check whether or not all registers in use are properly saved in the event of an interrupt.

I guess some reading of the M16C user Manual, section interrupts will reveal the solution.

grtnx /jan

"hendrik" schrieb im Newsbeitrag news: snipped-for-privacy@p79g2000cwp.googlegroups.com...

Reply to
Jan Homuth

Jan Homuth schrieb:

Hi Hendrik, take a look into chapter 24 (Precautions) of the hardware manual. I got unexpected interrupts due to the problem described in part 24.7.6 (Rewrite the Interrupt Control Register), which crashed my program -- not too often, to make it more interesting. Jan is right: you ought to describe what you are doing and which tools you use (ice?) so you can get a more specific answer.

-- Dirk

Reply to
Dirk Zabel

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.