Should i use single transfer mode instead of double buffer mode in DMA for my program?
Hello everyone,
Actually I am making a data acquisition system in which my mcu takes analog data from a sensor and stores it in a buffer, and then into a 2nd buffer with the help of DMA in double buffer mode.
Now i want to transfer this data via UART to my screen with the help of PuTTY with the same ping-pong architecture. For this i need to convert 12 bit adc value to data suitable for uart (8 bit). which i do with the help of a function without any issue and then store them in different two buffers. now the thing is that i want a system in which when buffer 1 is being filled by adc, buffer two will be transferred by uart and vice versa, now the main problem is that there is no sync between the buffers and the ownership. and it is mostly due to the conversion and size of buffers (uart buffers are twice the size of adc buffers) as i am using double buffer transmission mode in DMA controllers of both adc and uart.
So do you think i should use single buffer transmission with circular buffer in DMA or should i continue with my double buffer approach.
Here is my project: Vishwas1523/dataAcquisitionSystem
