Sign in

username:

password:



Not a member?

Search lpc2000



Search tips

Subscribe to lpc2000



lpc2000 by Keywords

2106 | ADC | ARM7 | Atmel | Bootloader | CAN | CrossStudio | CrossWorks | DDS | ECos | Ethernet | ETM | FIFO | FLASH | FPGA | GCC | GDB | GNU | GNUARM | GPIO | I2C | IAP | IAR | JTAG | Kickstart | LCD | Linux | LPC | LPC-E2294 | LPC2000 | LPC2100 | LPC2104 | Lpc2106 | Lpc210x | LPC2114 | LPC2119 | LPC2124 | LPC2129 | Lpc2138 | LPC213x | LPC21xx | LPC2210 | LPC2212 | LPC2214 | LPC2292 | LPC2294 | LPC2xxx | LPC3128 | MCB2100 | Olimex | Philips | PWM | Rowley | RTC | RTOS | SPI | SSP | UART | UART0 | UART1 | ULINK | USB | Watchdog | Wiggler

Sponsor

Stellaris® MCU Family:

New Parts
New Package
New Price


Details Here!

Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | LPC2000 | LPC2148 Timer0 Interrupts

Discussion group dedicated to the Philips LPC2000 family of ARM MCUs

LPC2148 Timer0 Interrupts - rtstofer - Jun 22 14:32:57 2006

This is embarrassing: I have nearly identical code on a LPC2106 that
works fine. I do not get the interrupts on the LPC2148. The code
changes between versions have to do with the divisors, not the VIC stuff.

I can see the timer match output toggle on pin 22 so I know the timer
is working and the frequency is correct.

void T0ISR(void) __attribute__ ((interrupt));

volatile unsigned int CurrentTime = 0;

void T0_init(void)
{
T0TC = 0;// clear the timer count
T0PR = 1;// prescale divide by 2
T0MR0 = 7500;// divide by 7500 to get approx 1000 ints per second
T0MCR = 0x03;// interrupt on match, reset on match
T0TCR = 0x01;// start the timer
VICVectCntl3 = 0x00000024;// set priority 3 for Timer 0
VICVectAddr3 = (unsigned long) T0ISR;// pass the address of the ISR
VICIntEnable |= 0x00000010;// enable interrupt
T0EMR = 0x30;// toggle external match pin
}

void T0ISR(void) // interrupt handler - see timer.h
{
CurrentTime++;
T0IR = 0x01;
VICVectAddr = 0xFF;
}

I am missing something simple but I have been staring at this for a
couple of hours with no success. Oh, the pin setup to allow me to
watch the match bit toggle is handled elsewhere. Fortunately, it works!

And I don't think I am getting interrupts from the I2C gadget either
but that's another problem. I'm doing something wrong with the VIC.

Anybody see where I messed up?

Thanks
Richard





(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )


Re: LPC2148 Timer0 Interrupts - Robert Adsett - Jun 22 15:11:59 2006

Quoting rtstofer :

> This is embarrassing: I have nearly identical code on a LPC2106 that
> works fine. I do not get the interrupts on the LPC2148. The code
> changes between versions have to do with the divisors, not the VIC stuff.

Any chance you havn't enabled interrupts in the startup on the 2148?

Robert





(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: LPC2148 Timer0 Interrupts - rtstofer - Jun 22 16:12:13 2006

--- In l...@yahoogroups.com, Robert Adsett wrote:
>
> Quoting rtstofer :
>
> > This is embarrassing: I have nearly identical code on a LPC2106 that
> > works fine. I do not get the interrupts on the LPC2148. The code
> > changes between versions have to do with the divisors, not the VIC
stuff.
>
> Any chance you havn't enabled interrupts in the startup on the 2148?
>
> Robert
>

Robert,

Sure, I could have done something like omit:
MSR CPSR_c,#MODE_SVC /* enable interrupts */
MSR CPSR_c,#MODE_USR

in crt.s I really thought I was using the same startup file as I had
for the LPC2106.

Thanks for the help!

Richard





(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )