2008-04-08 10:08 PM
trouble with ISR driven UART + loopback
2011-05-17 12:51 AM
Hello all,
Here is the situation: I configure my UART to support loopback and to generate an interrupt when the fifo is 1/2 full but it goes wrong even if the fifos are disabled. the thing is that even I do acknowledge the interrupt, the ISR is invoked for the same character! Please note: this happens even if I send a single character! This is the ISR:Code:
<BR>unsigned char l_data = UART1->DR ; <BR> <BR> <BR> UART_ClearITPendingBit(UART1, UART_IT_Receive) ; <BR> //UART_ClearFlag(UART1) ; <BR> <BR> VIC0->VAR = 0; // Acknowledge Interrupt <BR> VIC1->VAR = 0; // Acknowledge Interrupt
UART1->DR keeps on containing the same character! I know the UART works, because when I disable UART1_IMSC's RXIM bit, interrupts are not longer generated but the data ends up on the bus (still looped back though...). Can you help me?[ This message was edited by: michael.tamir on 09-04-2008 09:15 ]2011-05-17 12:51 AM
Hi,
could you please calrify more: what do you mean by this? ''the ISR is invoked for the same character! ???'' Regards, Eris.2011-05-17 12:51 AM
Hello and thanks for your reply,
I mean that every time the ISR is invoked, I read the same character from the DR register! The ISR is invoked continuousely, delivering the same character.