hi all iam using LPC1788 M3 cortex ARM 7 controller iam trying to execute the timer and serial interrupt program. in both the cases iam unable to return from the interrupt handler routine.
iam also working on LPC2378 ARM 7 controller where i have executed both the programs mentioned above. there iam using VICVECTADDR=0 to return from interrupt to main. what is the case in LPC1788? please help. Thanks in advance
Show the code, and use the PRE tags, the issue might be more apparent.
Cortex-M3 interrupt code and requirements should be a lot simpler, requiring straight C routines called directly via the NVIC.
Not returning? or stuck in a loop? If you fail to clear the source an M3 will keep calling the interrupt handler, and not run other code.
main() { // UART TX AND RX LINE SELECTION LPC_GPIO0->P0_0=0X1; LPC_GPIO->P0_1=0X1;
// UART INIT
LPC_UART0->LCR=0X80; // DLAB=1 LPC_UART0->DLL=78;//9600 BAUDRATE LPC_UART0->LCR=0X03;// 8BIT DATA LPC_UART0->IER = 0x01; // interrupt enable
NVIC_ENABLE(UART0_IRQn);
if(ch==0x24) { serial_send("AMS"); }
}
void serial_send(char *ch) { while(*ch!='\0') { while(!(LPC_UART0->LSR & 0x20)); LPC_UART0->THR = *ch; ch++; } }
void UART0_Handler(void) { ch=LPC_UART0->RBR; }
this is my code its not working......... here i am trying to execute interrupt.. when i type $ through keyboard then only it should send string AMS...... but its not coming out from interrupt handler....
when i put the same code which i have written in main i.e if(ch==0x24) in isr then it works fine.....
i dont want to place the code in isr.... i will just monitor ch value from isr if ch equals to dollar then it should come to main and execute the rest of program.....
There are so many samples out there, and even on your hard disk !
May be also you should spin in a while doing this test, in case a) you don't type quick enough for an instant response, and b) don't drop off the end of the world be exiting main().
hi all please help in lpc1788 interrupt coding if possible can you place the sample serial or timer interrupt code in lpc1788..
If you were the Worlds First Programmer to write the code for UART and/or Interrupt of LPC1788, what would you have done??
"If you were the Worlds First Programmer to write the code for UART and/or Interrupt of LPC1788, what would you have done??"
Wait for the worlds second programmer to be born, write the code and send it?
InThe Name Of Allah
Hi
I was Downloaded LPC1788 CMSIS and use GPIO Interrupt Project and run keil Debugger.
Problem is that GPIO Handler Never Call.
NVIC_SetPriority(GPIO_IRQn, 1); NVIC_EnableIRQ(GPIO_IRQn); GPIO_IntCmd(2, 1<<9, 1);
but with Software Trriger, GPIO Handler called :
NVIC->STIR = GPIO_IRQn;
Which port pin are you using as interrupt? Are you configuring the interrupt enable registers? (ENR/ENF) Have you enable the interrupt in NVIC? NVIC_EnableIRQ(GPIO_IRQn);
In case if you have the firmware library, there is an example code. refer to it.