ARM Technical Support Knowledge Articles

DO ARM PERIPHERALS HALT DURING BREAK?

Applies to: ULINK USB-JTAG Debugger

Answer


Information in this article applies to:


QUESTION

I have written the following two timer interrupt functions on a Philips LPC2000 device:

long timeval = 0;
long timeval_1 = 0;

void tc0 (void) __attribute__ ((interrupt));    // Generate Interrupt
void tc1 (void) __attribute__ ((interrupt));    // Generate Interrupt


/* Setup the Timer Counter 0 Interrupt */
void init_timer (void) {
    T0MR0 = 149999;                             // 10mSec = 150.000-1 counts
    T0MCR = 3;                                  // Interrupt and Reset on MR0
    T0TCR = 1;                                  // Timer0 Enable
    VICVectAddr0 = (unsigned long)tc0;          // set interrupt vector in 0
    VICVectCntl0 = 0x20 | 4;                    // use it for Timer 0 Interrupt
    VICIntEnable = 0x00000010;                  // Enable Timer0 Interrupt
}


/* Timer Counter 0 Interrupt executes each 10ms @ 60 MHz CPU Clock */
void tc0 (void) {
    timeval++;
    T0IR = 1;                                   // Clear interrupt flag
    VICVectAddr = 0;                            // Acknowledge Interrupt
}


/* Setup the Timer Counter 1 Interrupt */
void init_timer_1 (void) {
    T1MR0 = 74999;                              // 5mSec = 75.000-1 counts
    T1MCR = 3;                                  // Interrupt and Reset on MR0
    T1TCR = 1;                                  // Timer1 Enable
    VICVectAddr1 = (unsigned long)tc1;          // set interrupt vector in 1
    VICVectCntl1 = 0x20 | 5;                    // use it for Timer 1 Interrupt
    VICIntEnable = 0x00000020;                  // Enable Timer1 Interrupt
}


/* Timer Counter 1 Interrupt executes each 5ms @ 60 MHz CPU Clock */
void tc1 (void) {
    timeval_1++;
    T1IR = 1;                                   // Clear interrupt flag
    VICVectAddr = 0;                            // Acknowledge Interrupt
}

When I run the code without breakpoints, it operates as expected. But when I set breakpoints (at tc0 and tc1) for each timer interrupt function, both interrupts seem to occur at the same time. Don't the peripherals stop when using the ULINK Debugger?

ANSWER

No. The ARM Embedded ICE does not allow the peripherals to stop when a breakpoint is reached. Therefore, it might become tricky to debug interrupt-driven code.

To solve that problem, you may use the Keil uVision Simulator during driver development. The Simulator stops peripherals as you single step in your program and provides correct timing.

MORE INFORMATION

Article last edited on: 2007-01-28 19:15:31

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential