Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] capture problem in LPC2214

2006-05-13 by 3gpabko

Do you have properly setup exceptions vector table?
Do you have properly configure MEMAP?
Are you sure that you enter main() with "I" bit in
CPSR cleared?

Here are some other minor remarks:

The code:
PINSEL0 |= 0x00000020;
is better(safer) to look like this:
PINSEL0 = (PINSEL0 & (~0x30)) | 0x00000020;

Here you don't need read-modify-write:
VICIntEnable |= VIC_BIT(VIC_TIMER0);
Simple put:
VICIntEnable = VIC_BIT(VIC_TIMER0);


Regards
Zdravko


--- Mukadder CEYHAN <mukadder_c@...> wrote:

> I have a problem with capture 0.0 channel in
> lpc2214. 
> There is no interrupt?
> What is wrong the following code?
> 
> void initTimer0(void)
> {
> 	PINSEL0 |= 0x00000020;
> 	// setup Timer 0 to count forever
> 	T0TCR = TCR_RESET;                    // reset &
> disable timer 0
> 	T0PR = T0_PCLK_DIV - 1;               // set the
> prescale divider
> 	T0MCR = 0;                            // disable
> match registers
> 	T0CCR = 0x05;         // capture mode
> enabled,risingedge
> 	T0EMR = 0;                            // disable
> external match register
>   
>   	VICIntSelect &= ~VIC_BIT(VIC_TIMER0);  		//
> selected as IRQ
>   	VICVectAddr2 = (unsigned long)tc0_isr;  	// set
> interrupt vector in 2
> 	VICVectCntl2 = VIC_ENABLE | VIC_TIMER0; 	// use it
> for Timer 0 Interrupt
> 	VICIntEnable |= VIC_BIT(VIC_TIMER0);    	// Enable
> Timer0 Interrupt
> 	
> 	T0TC = 0;
> 	T0CR0 = 0;
> 	T0TCR = TCR_ENABLE;                   		// enable
> timer 0
> }
> 
> void tc0_isr(void) __irq
> {
> 	if (T0IR & 0x10)
> 	{
> 		T0IR = 0x10;
>         }
> 	VICVectAddr = 0;	// Acknowledge Interrupt
> }
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 


\u0417\u043d\u0430\u043d\u0438\u0435\u0442\u043e \u0435 \u043b\u0438\u0447\u043d\u043e \u043f\u0440\u0435\u0436\u0438\u0432\u044f\u043d\u0430 \u0438\u0441\u0442\u0438\u043d\u0430.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.