cancel
Showing results for 
Search instead for 
Did you mean: 

CPU,DMA UART Transfer Independently

manoritesameer
Associate II
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
14 REPLIES 14
manoritesameer
Associate II
Posted on June 08, 2014 at 01:35

Thanks Clive for the awesome example and all your effort. But by this  for every element to be transferred the CPU need to intervene so it is kinda not an independent memory to peripheral transfer using DMA. 

      I have no problem transferring binary format of data block, I can convert that back to decimal on the PC's end. Hope I could explain this right ?

Regards

Sameer

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 Venmo
Up vote any posts that you find helpful, it shows what's working..
manoritesameer
Associate II
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

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 Venmo
Up vote any posts that you find helpful, it shows what's working..
manoritesameer
Associate II
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