We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
<bI am exploring the MCB2300 board with simulator. I am trying to generate a some signal at MAT0.0.
It is working fine, except that not entering into the ISR.
WHile observing the simulation, when MR0=TCR, interrupt generated,
VICVectAddr took the address of VICVectAddr4. But then it is not taking the address 0, which is last line of ISR.>
Here is the code.
#include <stdio.h> #include <LPC23xx.H> /* LPC23xx definitions */ #include "LCD.h" /* Graphic LCD function prototypes *
extern __irq void T0_IRQHandler (void);
int main (void) {
int i=0;
PCLKSEL0 |=0x00000000; // pclk=cclk/4=18MHz PINSEL3 |=0x03000000; // Select MAT0.0 Pin 44 P1.28 T0PR=5000; T0MR0=1800-1; // To generate a 1 sec pulse with 18 Mhz Pclk clock T0MCR=3; // Interrupt generated & reset TC on match T0EMR=0x30; // T0TCR=1; //ENABLE Timer VICVectAddr4 = (unsigned long)T0_IRQHandler;/* Set Interrupt Vector Gives ISR Address to VICVectAddr4 */ VICVectCntl4 = 15; /* use it for Timer0 Interrupt */ VICIntEnable = (1 << 4); /* Enable Timer0 Interrupt It gives the content of VICVectAddre4 to VICVectAddr */ }
Here is the ISR
#include <LPC23xx.H> /* LPC23xx definitions */
__irq void T0_IRQHandler (void) {
T0IR|=0x01; // clear interrupt register VICVectAddr=0;//acknowledge interrupt
}
According to the last line of ISR, VectAddre should become 0, which is not happening; while observing the simulator.
Even I tried with disabling the T0TCR=0 as the 1st line of ISR to disable the timer. But TC continues to increase, even after interrupt occured.
Can some body tell me ; what exactly I am missing.
Thanks in advance
Sri