3 breakpoint generator – Texas Instruments MSC1210 User Manual

Page 189

Advertising
background image

Breakpoint Generator

15-7

Advanced Topics

15.3 Breakpoint Generator

The purpose of the breakpoint block is to generate an interrupt whenever the
desired program or data memory address is accessed. There are two kinds
of memory accesses it can detect:

-

Accesses to program memory (read or write)

-

Accesses to data memory (read or write)

The interrupt is handled by the interrupt controller (for details, see Chapter 10,
Interrupts). Breakpoints are useful in debugging code. You can set a break-
point at the start of a suspect piece of code. Once the program reaches the
breakpoint address, program flow can be suspended/interrupted so you can
force a memory dump or a register dump. You can specify up to two 16-bit ad-
dresses for which the interrupt may be generated.

15.3.1 Configuring Breakpoints

Breakpoints are controlled by the BPCON (A9

H

), BPL (AAh), BPH (AB

H

) and

MCON (95

H

) SFRs. The Breakpoint Control SFR (BPCON) controls the con-

figuration of the breakpoint. BPL and BPH together form a 16-bit breakpoint
address. BPSEL (MCON.7) selects which of the two breakpoints is to be con-
figured.

The BPCON SFR has the following structure:

7

6

5

4

3

2

1

0

Reset Value

SFR A9H

BP

0

0

0

0

0

PMSEL

EBP

00H

BP (bit 7)—Breakpoint Interrupt. This bit indicates that a break condition has
been recognized by a hardware breakpoint register(s).

READ: Status of breakpoint interrupt. Indicates a breakpoint match for any of

the breakpoint registers.

WRITE: 0—No effect.

1—Clear Breakpoint 1 for breakpoint register selected by MCON (SFR 95

H

).

PMSEL (bit 1)—Program Memory Select. Write this bit to select memory for
the address breakpoints of the register selected in MCON (SFR 95

H

).

0: Break on address in data memory.

1: Break on address in program memory.

EBP (bit 1)—Enable Breakpoint. This bit enables this breakpoint register. Ad-
dress of breakpoint register selected by MCON (SFR 95

H

).

0: Breakpoint disabled.
1: Breakpoint enabled.

Advertising