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.

Programming for TMS320F28335 - Is it ok to avoid ADC check?



Hello everybody,

I am programing an IIR filter that has to be executed really fast. It works with the measurement from the ADC.

In order to improve the speed of the function, I have removed the next ADC checking:

       while (AdcRegs.ADCST.bit.INT_SEQ1== 0){}
       AdcRegs.ADCST.bit.INT_SEQ1_CLR = 1;

This, if I understood right, is to wait for the measurement in the ADC to be ready.

But it is time consuming, and for my application, in spite of running as fast as I can, there is time enough for the ADC to have the measurement ready (80ns conversion rate).

Am I right about this?

 

Thanks,

Ricardo.

  • Ricardo,

    As long as you are within the timing limits of the ADC, there is technically no need to use the flags to know when the ADC is complete.  There are 4 ways to know when to read the ADC results:

    1)ADC ISR, which is triggered off the flag

    2)Poll the flag locally as above

    3)Rely on the ADC timing relationship to whenever you generate the SOC and read the results with the CPU

    4)Utilize the DMA to "auto-read" the ADC results and store them for you

    For your IIR needs, I believe option 4 is most attractive, since you will be collecting large amounts of data, and inline/post processing it through your filter code.  Using the DMA you can store a section of data, trigger the DMA interrupt to start the IIR process; and if needed while the IIR is working on the data the DMA can continue collecting data in a different RAM block.

     

    There is some example code in the header files for using the ADC with the DMA.  In that case the DMA is also doing some data re-arranging, which you won't need.

    Best,

    Matthew

     

     

  • Thanks Matthew!

    In principle is all I needed to now. I will check those points because I am still learning about this, but for the moment I can continue.

     

    Cheers,

    Ricardo

  • Hello Sir,

                      I am facing problem in creating the filters on TMS320528335, I am working first time on filters so I dont have an idea but I have worked in matlab, but not on any controller.So, if you can, please help me or mail me some programs on pdfs how to create filters.

     

    Saurabh Singh

    saurabh044@gmail.com