??? 03/12/11 20:26 Read: times |
#181564 - A double-buffered solution also possible Responding to: ???'s previous message |
It would work just as well with a doubly-buffered solution, where the ADC capture alternates between two buffers while the serial transfer picks up the other buffer for transmission.
But having a single buffer that the ADC first fills before the serial transfer is started is a solution that will generate breaks in the sampled data when the ADC have to wait for the serial transfer to finish. It will also mean that the serial link is only used for a limited time, before having to idle while the buffer gets filled again. As long as the serial port have enough bandwidth, the goal must be to keep the ADC constantly running. Switching between ring buffers or double-buffering is a question of architecture. The 8051 is best suited for ring buffers. A more high-end processor with DMA support would better like a double-buffered solution since one DMA channel can transfer data from one buffer to the serial port while another DMA channel can fill data from the ADC into the other buffer. |