Skip to main content
manoritesameer
Associate III
June 5, 2014
Question

CPU,DMA UART Transfer Independently

  • June 5, 2014
  • 14 replies
  • 1920 views
Posted on June 05, 2014 at 22:21

Hello,

       I want to transmit 10000 samples taken by adc continuously stored in an array. Is it possible the DMA-UART can transmit this to the PC while the CPU can take the next set of samples(independently) i.e without slowing the CPU.

#fast-dma #stm-rocket-science
    This topic has been closed for replies.

    14 replies

    Tesla DeLorean
    Guru
    June 8, 2014
    Posted on June 08, 2014 at 13:36

    Correct, you could set up half your ADC DMA buffer to be sent at each HT and TC interrupt. The USART would send the lagging half of the buffer which you had just filled, while the ADC would continue to fill the other half.

    You need to make sure the USART is sending the data quicker than the ADC is collecting it, and slow the ADC pacing if required.
    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    manoritesameer
    Associate III
    June 10, 2014
    Posted on June 10, 2014 at 07:58

    Hello Clive,

            As u had suggested I am transmitting all data in raw form as binary, But I cannot find a concrete way to read binary data  on my PC end. Can u please help me on that.

    Regards

    Sameer

    Tesla DeLorean
    Guru
    June 10, 2014
    Posted on June 10, 2014 at 14:14

    On the PC end you'd need to create an array of similar type and dimensions. You'd probably want to packetize the data, or use a preamble, so you can get byte and array level synchronization.

    As all the other words are 12-bit ADC values, a preamble like 0xF8F8, 0xAA55 or 0x1234 would probably suffice, as they wouldn't naturally be in the byte stream.

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    manoritesameer
    Associate III
    June 10, 2014
    Posted on June 10, 2014 at 20:07

    Hello Clive,

          When I am transmitting my data over the UART. There I get a 8 bit (0xFF) value initially before valid data is sent which actually misalign my data. Do have any idea of why this is happening. 

    something like this :

    11111111 10010110 00000000 10011010 00000010 

    Regards

    Sameer