Tool/software:
Hi, I'm using the TM4C1230H6PM to receive UART data (among other things). In my use case, I randomly might only receive a few bytes of data within a couple of seconds. In other cases, I could be sent over 500 bytes of data all in one go.
The problem I have is similar to this question I asked last year that Charles Tsai so kindly answered. However, it's slightly different in that this time around I can control the sender side as well as the receiver.
On the Tiva side (the receiver) it seems ping-pong mode is the best DMA mode to use for my case, the problem I have is what size to chose for my DMA buffers.
If I chose a smaller size, say 64 bytes, if a higher priority interrupt is being serviced when I receive 500 bytes of data it's possible both my primary and alternate buffers will fill before I can service the DMA interrupt.
If I chose a larger buffer, say 512 bytes, I will have to send a full 512 bytes every time I want to process the 3 bytes of data as quick as possible. It seems like a huge waste, making the sender send 512 bytes when I it only needs to actually send 3 bytes.
Am I missing something? Is there a better approach I'm not thinking of?