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

Debug function for TRAP A simulation of NMI

Hi all,

can anybody help me with a simulatorfunction
to simulate a class A trap ?

I wrote a little program for XC16x starter kits, where the NMI pin is used to start
in debug mode to send out via ASC0 some
messages about my LIN activities and LIN frames.
Up to now the code seems working.

My problem in this case is:
In simulator I can access the VTREG NMIPIN,
what works too.
I wrote the following INI-file.


NMIPIN=1
KILL BUTTON *
DEFINE BUTTON "Activate NMI","Toggle_NMI()"

FUNC void NMI_Toggle (void)
{
exec("NMIPIN = 0x00");
exec("NMIPIN = 0x01");
}
Regardless of the improvable timing it works (after compiling)that the NMIPIN itself toggles, but no
TRAP function is called.
I have to call it by setting via
Peripherals -> Traps -> NMI.

I would like to force the trap via my defined button.
( As I understand the activation of NMI in the traps windows is done by the simulator.dll)

Can somebody imagine how to solve this.

Many thanks for help
Stefan

µVision 2.38a
Compiler V4.27
Linker V4.28
DialogDLL V2.38

0