| |||||
Technical Support Support Resources
Product Information | ULINK: DO ARM PERIPHERALS HALT DURING BREAK?Information in this article applies to:
QUESTIONI 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? ANSWERNo. 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 µVision Simulator during driver development. The Simulator stops peripherals as you single step in your program and provides correct timing. MORE INFORMATION
Last Reviewed: Sunday, January 28, 2007 | ||||
| |||||