Skip to content Skip to navigation

OpenStax_CNX

You are here: Home » Content » 1.4 - Setting Breakpoints in Workbench

Navigation

Lenses

What is a lens?

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

This content is ...

Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
  • TI MSP430 display tagshide tags

    This module is included inLens: Texas Instruments MSP430
    By: Texas InstrumentsAs a part of collection: "Introduction to the Texas Instruments ez430"

    Comments:

    "This is the entire course organized at Rice University for all the basic lessons for using an MSP430. It is designed for the use of an eZ430 tool and is still under construction."

    Click the "TI MSP430" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

Recently Viewed

This feature requires Javascript to be enabled.

Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.
 

1.4 - Setting Breakpoints in Workbench

Module by: Naren Anand. E-mail the author

Based on: Setting Breakpoints in Crossworks by CJ Ganier

Summary: A brief tutorial on how to set breakpoints in Workbench.

C with an embedded controller does not have as many input-output (IO) features as a regular computer. To help you debug, it will sometimes be necessary to stop the processor while it is running and examine the state of the system. To accomplish this we will use breakpoints. A breakpoint is a specific command to the development environment to stop execution of the processor when a certain condition happens. These conditions range from when a certain instruction is reached to when certain data is written or read. The advanced options are broad.

To set a basic breakpoint, one which will stop execution when a certain line is reached, just click on the left margin of the C file on the line you want to trigger. A red 'X' should appear to indicate you have set a break point. Click once more to make it go away. Workbench keeps track of all of the breakpoints for you. To see this information go to Window->Breakpoints. This will pop up a list of all of the breakpoints you currently have enabled. Right clicking in the window will allow us to create, delete, and modify breakpoints. We will use the same terminology for breakpoints as the IAR environment does, but the usage is not standardized.

The most useful and important breakpoint is the the code breakpoint. It triggers on arrival at a certain instruction in the source code. This kind of breakpoint can be created simply by left clicking on the left margin of the line in question. The breakpoint should then appear in the breakpoint window. Right clicking on the entry for a breakpoint allows you to edit it. For all breakpoints, you may select that they only trigger on a certain iteration by editing the skip count field. If left as 0, the breakpoint will trigger each time it occurs. Entering a number into the skip count field will trigger the breakpoint on that numbered time the event occurs.

In tandem with breakpoints, we can use the Locals and Watch windows. To access either of these windows select View->Locals or View->Watch. Whenever the program pauses at a breakpoint, these windows will be updated with the proper current values. The locals window displays the values for all local variables, variables within the function being processed, that are currently being used. The watch window displays values for variables that you add to it. Right click any variable or macro directly in your code and select "Add to Watch." Now, whenever your code pauses at a breakpoint, you can see the current value of that variable.

Alternate explanations of breakpoints can be found in the help contents of the Workbench IDE.

Content actions

Download module as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Add module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks