Keil Logo
This feature works with...
ARM C166 C251 C51 Eval

Debugger Functions

The µVision debugger incorporates a C function language you can use to respond to program output and create input stimulus. A number of built-in debugger functions, like printf, memset, and rand, are available.

You may create:

  • Signal functions to simulate analog and digital inputs to the CPU.
  • User functions that extend the command scope of the debugger and combine repetitive actions.

Signal functions describe the behavior of external hardware and supply input to the microcontroller's I/O pins. Signal functions run in the background while the µVision debugger simulates your target program.

For example, the following signal function generates an analog input ramp on A/D Input 0.

SIGNAL void analog0 (float limit) {
  float volts;

  printf ("ANALOG0 (%f) ENTERED\n", limit);
  while (1) { /* forever */
    volts = 0;
    while (volts <= limit) {
    AIN0 = volts;    /* Set A/D Input 0 */
    swatch (0.5);    /* Delay for 0.5 seconds */
    volts += 0.5;    /* Increase voltage */
    }
  }
}

There are several ways you can invoke debugger functions:

  • From the Command Line in the Output Window,
  • From a button in the Toolbox,
  • or From a breakpoint definition.
  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.