Motorola USB08 Betriebsanleitung Seite 17

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 100
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 16
17
5 DEBUGGING
5.1 Breakpoints
Tracing, and running programs to breakpoints, requires that breakpoints can be established at the right
places in the MCU program code. On the HC908 chips only a single breakpoint can be set at one time,
by writing a value to the breakpoint register. Programs may be run or traced in both RAM and FLASH
memory. When tracing at a branch instruction, Xplor8 calculates where program execution will
continue by its own analysis of the condition code register, and sets the next breakpoint accordingly.
A breakpoint cannot be set at:
illegal opcodes
indexed jump instructions
the SWI instruction
BIH or BIL instructions
any instruction which jumps or branches to itself
A breakpoint may be set or deleted as part of the Go (Run) command. The Trace command
automatically sets the breakpoint. When a breakpoint address has been written, the Breakpoint
Register display on the main form is updated.
The breakpoint module in the HC908xx MCU's has some quirks, probably due to the instruction
pre-fetch architecture. You may find that setting breakpoints at branch destinations or at RTS
instructions results in a running program stopping at unexpected places. This odd behavior does not
appear to affect tracing. The \Samples\ subdirectory contains a program which demonstrates this.
5.2 SWI in user code
If a Software Interrupt (SWI) instruction is encountered by a running program, while in monitor mode,
control will return to the monitor and this is useful for testing code segments. When control does
return to the monitor in these circumstances, the output window will display the message: ‘unexpected
break received’.
Seitenansicht 16
1 2 ... 12 13 14 15 16 17 18 19 20 21 22 ... 99 100

Kommentare zu diesen Handbüchern

Keine Kommentare