Keil Logo

Interrupt Signal

The following Signal Function template may be used to generate an GPIO interrupt signal.

//
// Generates a number of pulses on GPIO 0.14
//
signal void GPIO_0_14_Square (unsigned int pulses)  {
  float frequency;           // pulse frequency in Hz

  frequency = 1000;          // 1 KHz

  printf ("%d Square Pulses on GPIO 0.14\n", pulses);

  while (pulses)
  {
    PORT0 |=  (1 << 14);     // set   pin 0.14
    swatch (0.5 / frequency);
    PORT0 &= ~(1 << 14);     // reset pin 0.14
    swatch (0.5 / frequency);
        pulses--;
  }
}

GPIO_0_14_Square (100);      // 100 Pulses at debugger startup

define button "EINT1 1  Pulse",  "GPIO_0_14_Square (1)"
define button "EINT1 100Pulses", "GPIO_0_14_Square (100)"

The above setting generates the following signal on PORT0. The Logic Analyzer output shown is generated with the example project Using Interrupt EINT1 on Keil MCB2100 Board available at www.keil.com/download.

Logic Analyzer Signal Display

  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.