This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DMA tive c series TM4C123

Other Parts Discussed in Thread: TM4C123GH6PM

Hi

I have initialized PWM to have 1.25 square wave on PA7, and I need to read an 8 bits data from external ADC with 2.5M sample per second. At first I have used PWM interrupt but that maximyum spped that I have read data was 520K sample per second.

Now I want to use DMA. I just need to know that whether I can read data from PORTD and directly put it in UART buffer to send it to computer with 2.5MS/S? I really appreciate it if you could help me in this regards.

Thanks

Majid

  • Hello Majdi,

    It is still unclear as to follows

    1. What is the source of DMA trigger?

    2. How many bits the external ADC is and what is the Baud Rate of UART as UART may end up becoming the bottleneck in throughput.

    Regards

    Amit

  • Hi Amit, 

    Thank you for your prompt reply.

    I am using PWM to generate required pulses for external ADC, I want to use one of this pulses as a trigger for DMA. The frequency of the pulse is 1.25MHz but I want to read portD with 2.5M sample/second. So I need to read ADC in rising and falling edge of this pulse.

    I want to set the source of the DMA as portD and destination as UART0. I am using TM4c123GH6PM Launchpad at 80MHz clock frequency. The length of the data is 4096 bytes.

    Actually I want to connect a linear CCD to Tiva C series Launchpad via an ADC(AD9822 : 14 bits output which multiplexed in 8 bits).

    Thanks

    Majid

     

     

  • majid shokoufi said:

    I am using PWM to generate required pulses for external ADC, I want to use one of this pulses as a trigger for DMA. The frequency of the pulse is 1.25MHz but I want to read portD with 2.5M sample/second. So I need to read ADC in rising and falling edge of this pulse.

     PWM generate the start of conversion @ 1.25MHz, your application require to read data from this device, so other from your first post your data rate is 2.5MB/S, this data rate is not a problem to TIVA but is a biggest problem if not internally processed. Data bit  rate is at almost 2.5* 8 resulting to 20Mbsp, so this is more than serial devices on 123 series can transfer out of.

     This can be done by 129 series on High speed USB with external PHY or better thru network also using EPI to read from dac.

    majid shokoufi said:
    I want to set the source of the DMA as portD and destination as UART0. I am using TM4c123GH6PM Launchpad at 80MHz clock frequency. The length of the data is 4096 bytes.

      UART cannot transmit @20Mbps nor USB can, so a better destination can be internal memory buffer to do further processing on slow UART transmission or more faster USB.. Both require a FAST memory buffer.

     This in the only case data is transferred from CCD one frame at a time.

     Generally CCD can supply data in a slower rate allowing for less noise... Is your choice the best to use a 14bit converter?

  • Just asking - might experience/background/resources ever begin to approximate desire?

    "Tip of the iceberg" revealed - many high-level "gotchas" lurk - await their opportunity.

    KISS is far from this scene - proceed by refinement (methodically) seems sacrificed to the god of "instant gratification."

  • cb1_mobile said:
    KISS is far from this scene -

     Hey.. stay away, the pretty woman Kissing appear to me as devil hidden profile too...

     Yes we are searching information thru a huge lot of garbage...

     Forever add a little garbage to wine and you obtain garbage.

     Add Huge quantity of wine to garbage and you get garbage too...

     Murphy law advanced mode

  • The ADC is running at 1.25MHz but it is 14 bits ADC and output of that multiplexed at 8pins so in order to read 14 bits (one conversion) in each clock cycle we need to read two bytes from ADC, one in rising edge of the clock and the other in falling edge of same clock pulse.

    For each package, we need to read 4096 bytes from ADC. If I want to write them in RAM with DMA and while reading second frame we can send the first frame’s data to computer with DMA.

    Could you please help me in this regards?

    Thanks

    Majid

     

  • Hello Majid,

    The UDMA does not know what a clock edge means. It only gets a trigger and then performs a data transfer. The Clock cycle that you have mentioned is the 1.25MHz Clock to the ADC which is being generated by the PWM Module. Now PWM does not generate a DMA request, so what you need is the ADC Clock as a GPIO Port Pin which will generate the DMA request at both edges and this will cause UDMA to transfer the data from the GPIO to internal memory/UART.

    Also how much is the delay from the ADC to the multiplexer to the GPIO. Otherwise, the UDMA may end up reading the wrong data.

    Since you plan to send the data to a PC via a UART, and as others have mentioned the Baud rate of UART or USB would not be sufficient, you may want to downscale the frequency of conversion.

    Regards

    Amit