AN2090 Freescale Semiconductor / Motorola, AN2090 Datasheet - Page 16

no-image

AN2090

Manufacturer Part Number
AN2090
Description
Using the SC140/SC1400 Enhanced On-Chip Emulator Stopwatch Timer
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Conclusion
6
This application note presents two techniques for measuring the execution speed of software running on a DSP
device based on the StarCore SC140 or SC1400 core, using the enhanced on-chip emulator. The first technique
requires instrumenting the application code with calls to stopwatch timer routines. The second technique controls
the stopwatch timer within the Metrowerks Code Warrier debugger. Examples in this application note demonstrate
setting up the SC140 Phase Lock Loop, and software control of the LED available on the Software Development
Platform.
7
The following documents are available at the Freescale web site listed on the back cover of this document:
[1]
[2]
[3]
[4]
16
cycle_req = CLOCK_SPEED*10;
}
Conclusion
References
SC140 DSP Core Reference Manual (MNSC140CORE)
Device Application Development System (ADS) Reference Manual.
SC1000-Family Processor Core Reference Manual.
OCE10 On-Chip Emulator Reference Manual.
EOnCE_stopwatch_timer_start();
do {
} while (clock_cycle <= cycle_req);
EOnCE_stopwatch_timer_stop(&clock_ext, &clock_val); /* Stop timer, return bit 63-0
EOnCE_LED_off();
time_sec = Convert_clock2time(clock_ext, clock_val, EONCE_SECOND);
printf("duration = %u sec\n", time_sec);
cycle_req = CLOCK_SPEED*7.5;
EOnCE_stopwatch_timer_start();
do {
} while (clock_cycle <= cycle_req);
EOnCE_stopwatch_timer_stop(&clock_ext, &clock_val); /* Stop timer, return bit 63-0
EOnCE_LED_off();
time_sec = Convert_clock2time(clock_ext, clock_val, EONCE_MILLISECOND);
printf("duration = %u ms\n", time_sec);
return;
READ_IOREG(ECNT_VAL,clock_cycle);
clock_cycle = MAX_32_BIT - clock_cycle;/* Minus max value due to count down */
READ_IOREG(ECNT_VAL,clock_cycle);
clock_cycle = MAX_32_BIT - clock_cycle;/* Minus max value due to count down */
Using the SC140/SC1400 Enhanced On-Chip Emulator Stopwatch Timer, Rev. 1
/* Calculate total clock cycles required
counter value */
counter value */
/* Calculate total clock cycles required
/* Event 1 happens, counter & LED on */
/* Event 1 happens, counter & LED on */
/* Read bit 31-0 counter value */
/* Read bit 31-0 counter value */
/* LED off */
/* LED off */
by 10 sec */
by 7.5 sec */
Freescale Semiconductor

Related parts for AN2090