|
|||||||||||
|
Technical Support Support Resources
Product Information |
µVISION DEBUGGER: Generating Interrupts in Simulation ScriptInformation in this article applies to:
QUESTIONI want to simulate an interrupt input in my application. I have hardware that uses the output signal on Port 1.5 and loops this output back to the interrupt input INT0 on Port 3.2. I have written the following signal function to accomplish this:
SIGNAL void LoopBackInterrupt (void) {
while( 1) {
if (P1 & 0x20) PORT3 &= ~4 ;
else PORT3 |= 4 ;
twatch(1) ;
}
}
This method works fine, but slows down simulation speed when I start the signal function with LoopBackInterrupt () in the Command Window. Is there a better way to do this? ANSWERYes. A better way to generate the interrupt is to use an access breakpoint that triggers only when the value at P1 changes. For example, the following command sets a breakpoint that executes only when P1 changes. bs write P1, 1, "PORT3 = (PORT3 & ~0x4) | ((P1 & 32) ? 4 : 0)" When triggered, this breakpoint changes the state on the interrupt input P3.2. Of course, this is triggered only when your application writes to P1. SEE ALSOLast Reviewed: Tuesday, January 5, 2021 | ||||||||||
|
|||||||||||
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.