Yahoo Groups archive

Lpc2000

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

Message

Timer Interrupt problem in LPC2106

2005-05-04 by rockraj_2003

Hello Friends,

Interrupt problem in LPC2106.
I am using IAR EMBEDDED WORKBENCH.The Timer Interrupt is not 
responding.

Simply for Half an hour it typing only SET.
Its not typing Timer Interrupted. 
I can't able to find any mistake.
When i worked with the Simulator it works fine. Its correctly 
entering data into the reg.


This is the code.
#pragma language=extended
#include "ma_tgt.h"    
#include "ma_sfr.h"    
#include "iolpc210x.h" 
#include <inarm.h>  
#include "ma_scb.h" 
#include "ma_uart0.h"
#include "ma_pcb.h"     
#include "stdio.h"
#include "timer.h"
#include "LPC21XX.H"                          

extern void init_timer (void);

static void DefDummyInterrupt()
{}

__irq __arm void TIMER0 (void)  {

    MA_PutString_UART0("Timer Interrupted");
    T0IR = 1;                                   
    VICVectAddr = 0;                            
  }


void init_timer (void)
 {
  MEMMAP = 2;
  VICProtection = 0;
  VICIntEnClear = 0xffffffff;
  VICDefVectAddr = (unsigned int)&DefDummyInterrupt;
  T0TCR = 0; 
  T0PC = 0; 
  T0CCR = 0;
  T0EMR = 0;
  T0MR0 = 0xFFFF;                              
  T0MCR = 3;                                  
  VICVectAddr0 = (unsigned int)TIMER0;        
  VICVectCntl0 = 0x20 | 4;                    
  VICIntEnable = 0x00000010;                  
  T0TCR = 1;                                  
}

void main(void)
{
	MA_Reset_SCB();
	MA_Reset_PCB();
	MA_Init_UART0();
        MA_Reset_UART0();
        init_timer();
for(;;)	
{
	MA_PutChar_UART0(0xD);
	MA_PutChar_UART0(0xA);
	MA_PutChar_UART0(0xD);
	MA_PutChar_UART0(0xA);
	MA_PutString_UART0("SET");
	MA_PutChar_UART0(0xD);
	MA_PutChar_UART0(0xA);
        for(S8 i=0;i<10;i++)	
	Sleep(135000);
}	
                                                 
}

Kindly clarify my doubt.

with regards,
Raj

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.