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.
Hello,
I'm triyng to simulate an external interrupt with the LPC378 but it doesn't work.
I already saw other threads about this problem. It seem's to work with MCB2100 with a .ini file but it doesn't work with the MCB2300 (LPC2378). What can I do ?
I try it with µV3 and µV4 ! Here is my source code :
#include "LPC23xx.h" void isr_EINT0 (void) __irq { FIO2PIN0 = ~FIO4PIN0; /* alternate the LED display */ EXTINT = 0x01; /* clear interrupt */ VICVectAddr = 0; /* Acknowledge Interrupt */ } void init_EINT0(void) { PINSEL4 = 0x00100000; /* set P2.10 as EINT0 and P2.0~7 GPIO output */ FIO2DIR = 0x000000FF; /* port 2, bit 0~7 only */ FIO2CLR = 0x000000FF; /* turn off LEDs */ EXTMODE = 0x01 ; /* INT0 edge trigger */ EXTPOLAR = 0; /* INT0 is falling edge by default */ VICVectAddr14 = (unsigned)isr_EINT0; /* set interrupt vector */ VICIntEnable = (1<<14); /* Enable Interrupt */ } int main() { init_EINT0(); /* Call function to initialize EINT0 */ while(1); }
And my simulation .ini file :
// // Generates a number of pulses on GPIO 2.10 // signal void GPIO_2_10_Square (unsigned int pulses) { float frequency; // pulse frequency in Hz frequency = 10; // 100 Hz printf ("%d Square Pulses on GPIO 2.10\n", pulses); while (pulses) { PORT2 |= (1 << 10); // set pin 2.10 swatch (0.5 / frequency); PORT2 &= ~(1 << 10); // reset pin 2.10 swatch (0.5 / frequency); pulses--; } } GPIO_2_10_Square (100); // 100 Pulses at debugger startup define button "EINT0 1 Pulse", "GPIO_2_10_Square (1)" define button "EINT0 100Pulses", "GPIO_2_10_Square (100)"
Best Regards, Yann