Yahoo Groups archive

Lpc2000

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

Thread

PLEASE HELP Cannot find a way to use timer interrupt for lpc2106

PLEASE HELP Cannot find a way to use timer interrupt for lpc2106

2005-10-05 by vicky gosar

If anybody out there has an idea or program how to use the timer interrupt with lpc2106 pl................... help
 
Regards 
 
Vicky

		
---------------------------------
 Yahoo! India Matrimony: Find your partner now.

[Non-text portions of this message have been removed]

Re: [lpc2000] PLEASE HELP Cannot find a way to use timer interrupt for lpc2106

2005-10-05 by Aalt Lokhorst

Hello Vicky,

This is a snip of my code for the LPC2129, don't know about
the LPC2106 exactly, but I guess it will be the same or almost the same.

Beside this code you also need to enable the IRQ's if this isn't done in 
  your startup code already.

Succes,
Aalt



<snip>
#include "LPC21xx.h"

unsigned long timeval;

// declare tc0 as interrupt handler
void isr_tc0 (void) __attribute__ ((interrupt("IRQ")));

//-----------------------------------------------------------------------------
// Setup the Timer Counter 0 and prepare it for IRQ
//-----------------------------------------------------------------------------

void initTimer0 (unsigned long pclk_cycles) {
   T0MR0 = pclk_cycles-1;                 // 'n' cycles needs match 'n-1'
   T0PR = 0;                              // Timer 0 incr on every pclk
   T0MCR = 3;                             // Interrupt and Reset on MR0
   T0TCR = 1;                             // Timer0 Enable

   timeval=0;                             // reset timertick counter

   VICIntSelect &= ~(1<<4);               // Timer 0 Interrupt is an IRQ
   VICVectAddr0 = (unsigned long)isr_tc0; // set interrupt vector in 0
   VICVectCntl0 = 0x20 | 4;               // use it for Timer 0 Interrupt
   VICIntEnable = (1<<4);                 // Enable Timer0 Interrupt
}


//-----------------------------------------------------------------------------
// Timer Counter 0 Interrupt handler
//-----------------------------------------------------------------------------

void isr_tc0 (void) {
   timeval++;                             // increment timertick

   T0IR = 1;                              // Clear interrupt flag
   VICVectAddr = 0;                       // Acknowledge Interrupt
}

<end of snip>

vicky gosar wrote:
> If anybody out there has an idea or program how to use the timer 
> interrupt with lpc2106 pl................... help
> 
> Regards
> 
> Vicky
> 
>            
> ---------------------------------
> Yahoo! India Matrimony: Find your partner now.
> 
> [Non-text portions of this message have been removed]
> 
> 
> 
> SPONSORED LINKS
> Microprocessor 
> <http://groups.yahoo.com/gads?t=ms&k=Microprocessor&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=tsVC-J9hJ5qyXg0WPR0l6g> 
> 	Microcontrollers 
> <http://groups.yahoo.com/gads?t=ms&k=Microcontrollers&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=DvJVNqC_pqRTm8Xq01nxwg> 
> 	Pic microcontrollers 
> <http://groups.yahoo.com/gads?t=ms&k=Pic+microcontrollers&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=TpkoX4KofDJ7c6LyBvUqVQ> 
> 
> 8051 microprocessor 
> <http://groups.yahoo.com/gads?t=ms&k=8051+microprocessor&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=1Ipf1Fjfbd_HVIlekkDP-A> 
> 
> 
> 
> ------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
> 
>     *  Visit your group "lpc2000
>       <http://groups.yahoo.com/group/lpc2000>" on the web.
>        
>     *  To unsubscribe from this group, send an email to:
>        lpc2000-unsubscribe@yahoogroups.com
>       <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe>
>        
>     *  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
> 
> 
> ------------------------------------------------------------------------
> 

-- 
==============================
Aalt Lokhorst
Schut Geometrische Meettechniek bv
Duinkerkenstraat 21
9723 BN Groningen
P.O. Box 5225
9700 GE Groningen
The Netherlands
Tel: +31-50-5877877
Fax: +31-50-5877899
E-mail: Lokhorst@...
==============================

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.