Yahoo Groups archive

Lpc2000

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

Message

LPC2138 Timer0 & Timer1

2005-09-09 by yvesr123

Hello ,

I have a small soft running on the LPC2138 using CAP0.0 input & 
timer0 -1.
I'm using Timer1 as a free running Timer (Pclk = Timer1) 1:1
Clock on CAP0.0 input clock Timer0.
Match Register (MR0) is set to 200.
No need for interrupt.

When Timer0 match MR0 , I stop Timer1 then read it.
Purpose :
Setting of UART on different external clock.

Test :

			T0TCR  = 0x02;				
	/* Timer Disable & Reset 				
			*/
			T1TCR  = 0x02;
			T0PC   = 0x00;				
	/* Prescale Counter reg Divide by 1			
		*/
			T1PC   = 0x00;
			T0CTCR = b00000010			
	/* Timer0 on falling edge, CAP0.0			
		*/
			T1CTCR = b00000000			
	/* Timer1 on Pclk					
				*/
			MR0	   = SX;			
		/* Match register = 200				
		*/
			T0MCR  = 0x0004;			
	/* Stop on MR0: the TC and PC will be stopped 		*/
while (!TCR0)							
				/* and TCR[0] will be set to 0 if 
MR0 matches 		*/
 
From the PDF file , Register T0TCR bit 0 serve as Flag.

I am right or completly lost ?


thanks in advance

Yves

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.