AN2090 Freescale Semiconductor / Motorola, AN2090 Datasheet - Page 2

no-image

AN2090

Manufacturer Part Number
AN2090
Description
Using the SC140/SC1400 Enhanced On-Chip Emulator Stopwatch Timer
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Stopwatch Timer Basics
1
This section presents the features of the emulator stopwatch timer and the resources required for implementation.
The capabilities of the stopwatch timer are also explained.
1.1 Features
The emulator stopwatch timer provides the following features:
Conversion between clock cycles and absolute time, based on the operating clock frequency of the DSP, is
described in Section 2.4.
1.2 Resources
The emulator stopwatch timer requires use of these resources:
Because the emulator supports only one event counter, the stopwatch timer cannot be used if the event counter is
required for other debugging purposes, such as to set up a debugger breakpoint that requires counting of events.
1.3 Implementation
The stopwatch timer allocates a variable in memory to serve as the target for memory write operations. The
emulator event detector is set up to detect writes to this flag variable. When an event detector is set up to detect
memory access operations, it is necessary to specify which of the two data memory buses should be “snooped”.
Because the bus is selected dynamically, the event detector is set up to snoop both buses (XABA or XABB). Upon
detecting the write to the flag variable, the event detector enables the event counter, which starts counting down.
The emulator event counter can be configured as either a 64-bit counter or a 32-bit counter. Configuring the
counter to use 64-bits eliminates the danger of counter overflow, at a negligible extra cost.
To stop the stopwatch timer, an appropriate value is written into the emulator memory-mapped event counter
control register. When this operation completes, the cycle countdown halts. Now, you can read out the values of the
emulator event counter registers and translate them into an elapsed number of cycles or elapsed absolute time.
2
Stopwatch Timer Basics
A 64-bit counter, incrementing on each DSP clock cycle. The counter is less susceptible to overflow
with 64-bit precision.
The stopwatch timer can be used repeatedly while an application executes.
One emulator event detector (of the six available on each DSP)
Emulator event counter
Program memory of 724 bytes
Using the SC140/SC1400 Enhanced On-Chip Emulator Stopwatch Timer, Rev. 1
Freescale Semiconductor

Related parts for AN2090