AN2090 Freescale Semiconductor / Motorola, AN2090 Datasheet - Page 4

no-image

AN2090

Manufacturer Part Number
AN2090
Description
Using the SC140/SC1400 Enhanced On-Chip Emulator Stopwatch Timer
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Setting Up the Stopwatch Timer In an Application
2.1.1 Event Detector Control
The EDCA1_CTRL register controls the behavior of the EDCA. The fields of the EDCA1_CTRL register are
shown in Figure 2.
Table 1 describes the settings of these fields in the stopwatch timer implementation.
The EDCA is enabled as soon as these values are written into the control register. The EDCA stays enabled for the
duration of program execution to enable repeated use of the stopwatch timer.
2.1.2 Address Comparison Set-up
EDCA address comparison detects writes to the stopwatch timer flag variable. Because writes can occur on either
of the two data memory buses, both EDCA1_REFA and EDCA1_REFB are set up to contain the address of the
stopwatch timer flag variable.
The EDCA1_MASK register allows masking of address bits when the sampled address is compared with those in
the EDCA1_REFA and EDCA1_REFB registers. Our implementation of the stopwatch timer uses all 32-bits of the
flag variable address, so EDCA1_MASK is set to 0xFFFFFFFF.
2.2 Starting the Stopwatch Timer
The C code to start the stopwatch timer is shown in Example 2. This code contains the write commands that trigger
the event counter.
4
EDCAEN
CS
CBCS
CACS
ATS
BS
Field
32-bit EDCA mask register (EDCAi_MASK).
16-bit EDCA control register (EDCAi_CTRL).
1111
11
00
00
01
10
(binary value)
Setting
Using the SC140/SC1400 Enhanced On-Chip Emulator Stopwatch Timer, Rev. 1
This channel is enabled
Trigger event if the address matches on either comparator A or comparator B
“address match” is detected when the sampled bus value equals the value in EDCA_REFB.
“address match” is detected when the sampled bus value equals the value in EDCA_REFA.
Detect write accesses only
The sampled buses are XABA and XABB
Figure 2. EDCA Control Register (EDCA1_CTRL)
Table 1. EDCA_CTRL Settings
Description
Freescale Semiconductor

Related parts for AN2090