I am using two interrupts in ARM7 lpc2378:
1) UART1 to receive data from some external module 2) External Interrupt(EINT3) for ADC reading.
During the execution of the External-Interrupt ISR, sometimes received data from UART1 is lost due to UART1 interrupts are disabled.
How should I collect or save the UART1 data when some other ISR is being executed?
What measures should be taken in order to ensure that data from UART1 does not get lost?
UART1 received data varies from min 6bytes to max 50bytes and UART1 buffer size is 100bytes.
I just want to save the received data on UART1 when i am into some other ISR.
It is a really basic programming technique:
www.lmgtfy.com
Also known as a Ring Buffer:
"A circular buffer doesn't help if the issue is that one ISR takes too long"
But it can be a good tool for minimising how long a UART ISR takes...
But right now, the OP needs to fix his other interrupt handler - the one that blocks the UART ISR from servicing the UART.
But of course it's meaningful for the UART ISR to make use of some buffer technology that can guarantee a reasonably low fixed upper bound on execution time for adding more characters to the buffer. And a circular buffer is most probably the most common concept used for fixed-size serial data.