Can any one help me to solve PIC32 RX ISR for unknown data length.
Thanks in advance
you could use a ring buffer, e.g.
even if data flow speed is variable so long as you can empty the buffer before it becomes full there is no problem
what happens when you get overflow (buffer full) ? could you
1. thorw away the oldest data?
2. ignore some of the imcomming data?
3. implement hardware or software flow control?
what processing do you have to do on the incomming data?
I want to receive data from modbus simulator and the same data is to be transmitting to same uart port.
what speed are you receiving/transmitting data?
if it is just a question of receiving data and transmitting it onwards do you need to buffer it at all?
e.g. in an interrupt service routine receive a character and retransmit it (ssuming you are transmitting at the same or faster speed than receiving)
if you need to buffer data and do some processing could you double buffer it, e.g.
1. using DMA receive data into one buffer
2. processing data in second buffer and then transmitting it?