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.

Force the McBsp0 to give the last 3 values

Other Parts Discussed in Thread: ADS8558

I'am using the McBsp0 to get ADC values from a ADS8558 ADC converter.
Also EDMA is used to fill my ping/pong buffer and gives a HWI if there are new values ready in memory. (buffers are than full)
This works ok, only 1 sorting issue explaint in (http://e2e.ti.com/support/embedded/f/355/t/70809.aspx not aswered yet)

Now i have a function that needs the actual last 3 values from the ADC that can't wait till the buffers are full becaurse the values are to old then.
So i need a way to force the McBsp to give me the current last 3 values.

Is there a way to achieve this? 

  • I'm not too sure if I understand. Can you provide more clarification?

    If you only require the last 3 values in your application, is there a need for the buffers?  Or is it possible to make the buffers smaller, so you interrupt more often with newer values?

    --Christina

  • Depending on the buffersize, it takes time to fill them. I get a HWI if the buffer is full. there are situation in the proces theat i need the values at that moment and not waiting on the new values or using old ones. So can I trigger the Mcbsp or get the latest values from a register or so?

  • I don't think there is an simple solution, because you are trying to use the EDMA/McBSP in a non-conventional way.  It'll require some creative methods to implement what you are trying to accomplish.

    For instance, you can try reading the EDMA TCC registers to calculate the last memory location the EDMA filled.  After calculating the memory location, you can read the last 3 values straight from the buffers.

    --Christina

     

     

  • Hi Christina,

    Thanks for replaing on my question. You say that I coud read the EDMA TCC register and calculate the last memory address where the EDMA put the last value and read from there.
    How can I check witch channel it was that was writen here? I have 6 ADC channels comming in like: CH0, CH1, CH3, CH4, CH5, CH0 ... CH5, CH0 ... and so on.

    You say that I am using the EDMA/McBSP in a non-conventional way. Do you mean when I want the last 3 values or also without this function?

     

    Thanks!