Hello! I trying to simulate the signals given to the microcontroller. My special point is to start and stop a simple square wave. Everything works fine exept the SIGNAL KILL. After the "exec()" it is impossible to stop or reset the target program or to leave the debug mode of uVision. There is no error message and the only way to leave is to use the Windows Task Manager. I created a .ini file with the Function Editor. Any ideas?
(thread6908 did help a lot, thanks to Gary Lynch!)
/* simulate the input (square wave) */ signal void CoolingWater (void) { while (1) { /* repeat forever */ PORT3 |= 0x80; /* set bit */ swatch (0.0200); /* delay */ PORT3 &= ~0x80; /* clear bit */ swatch (0.0200); /* delay */ } /* repeat */ } /* show output every time it changes */ /* start and stop signal function * FUNC void ShowOutputs (void) { printf ("Output %04X %04X %04X %04X\n", ausgabe[0],ausgabe[1], ausgabe[2], ausgabe[3] ); if (ausgabe[1] & 0x0002) if (waterOn==0) { waterOn=1; CoolingWater(); /* start simulating impulses */ } if (!(ausgabe[1] & 0x0002) && waterOn) { waterOn=0; exec ("signal kill CoolingWater"); /* stop simulating impuses --- CRASHES HERE--- */ } if (ausgabe[0] & 0x0100) /* if output is 1 ... */ PORT3 |= 0x40; /* ...then simulate input */ } BS spiAusgabe,1,"ShowOutputs()" /* breakpoint to start the user function */
Update: It runs without any problems with a small RTXTiny project - but my problem is still not solved. As a workaround (I did not want waste more time on it) I do not use "kill" command. I've created the simulation of my hardware (digital I/O, extern ADC, CAN, RS232). That took me some days and together with the belonging PC software makes the two cores of my PC glow ;-) But now I'm able to debug my program without having all that hardware stuff. With the help of com0com I even don't need a RS232 cable (see: com0com.sourceforge.net/) My impression is that only a few people are using this powerful but bad documented simulation tool.