Keil Logo

µVISION DEBUGGER: Simulating INT0 Interrupt


Information in this article applies to:

  • C51 Version 6.12
  • µVision Version 2.10

QUESTION

How can I generate an INT0 when I'm simulating my program using the µVision Debugger?

ANSWER

On the 8051, INT0 is triggered whenever P3.2 goes low (if INT0 is configured for level-sensitive) or on the falling edge of P3.2.

To trigger the INT0 interrupt when you're simulating your program, all you have to do is set P3.2 (the input pin) low or toggle it low and back high again.

The debugger supports VTREGs which allow you to manipulate the simulated pins of PORT3.

So, to set P3.2 to a 0, in the Command Window enter the following:

PORT3 &= ~0x04

To toggle P3.2 low and back high, enter the following:

PORT3 &= ~0x04

// Delay for at least one clock cycle

PORT3 |=  0x04

Last Reviewed: Tuesday, January 5, 2021


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

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.