infineon4engineers Facebook

infineon@google+ Google+

infineon@linkedin linkedin

infineon4engi@twitter twitter

infineon@youtube youtube

+ Reply to Thread
Results 1 to 6 of 6

Thread: Achieving a 1MHz data acquisition rate

  1. #1
    Beginner Beginner Steven M is on a distinguished road
    Join Date
    Sep 2016
    Posts
    6
    Points
    60

    Achieving a 1MHz data acquisition rate

    Hi,

    Is it possible or has anybody managed to achieve an ADC sampling rate of 1MHz?

    I have been trying for a while using many methods, I have also come across a lot of documentation that suggest this is possible, yet I am unable to achieve this.

    The fasted I have been able to achieve is ~700kHz.
    I used an XMC4500 relax kit and Dave 4 to achieve this speed. Within Dave 4, I configured an ADC_Measurement App to start at initialization and continuously convert.
    I also configured a CCU8 PWM to 1MHz calling an interrupt on every period match.
    The interrupt simply toggles a digital pin, to generate a waveform on the oscilloscope, and get ADC conversion result. However, it seems on the scope that it is this 'ADC_MEASUREMENT_GetResult' function that is the problem.
    If I comment the 'ADC_MEASUREMENT_GetResult' function, it appears the interrupt is called at the correct times...
    NewFile0.bmp

    void Interrupt_ISR(void)
    {
    DIGITAL_IO_ToggleOutput(&DIGITAL_IO_0);
    // result[0] = ADC_MEASUREMENT_GetResult(&ADC_MEASUREMENT_Channel _A);
    }

    NewFile1.bmp

    void Interrupt_ISR(void)
    {
    DIGITAL_IO_ToggleOutput(&DIGITAL_IO_0);
    result[0] = ADC_MEASUREMENT_GetResult(&ADC_MEASUREMENT_Channel _A);
    }

    As the interrupt toggles the pin, the frequency measured is half the actual. Ie, 500kHz = 1MHz or 342kHz = 684kHz.
    As soon as I uncomment the 'ADC_MEASUREMENT_GetResult' function, my frequency is thrown off, as seen above. I am only converting the one channel but I will eventually need 5/6.

    I have read documentation on concatenating registers, running apps in parallel etc but I am yet to find any examples or useful documentation I can apply.

    I am looking for a bit of guidance and wondering if you guys have had this issue or have a solution I could try?

    Thanks in advanced,
    Steven
    ?????? ?????? NewFile0.jpg‎  

  2. #2

    Infineon Employee
    Infineon Employee
    jferreira will become famous soon enough
    Join Date
    Oct 2012
    Posts
    539
    Hi,

    If not done already please increase the compiler optimization to at least -O1. When you create a project in DAVE the default compiler optimization is set to -O0 (no optimizations) for a better debug ability.
    I would recommend to trigger the ADC conversion using a timer instead and in the end of measurement interrupt you read the results.
    See attachment.

    Regards,
    Jesus
    ?????
    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

  3. #3
    Beginner Beginner Steven M is on a distinguished road
    Join Date
    Sep 2016
    Posts
    6
    Points
    60
    Hi Jesus,

    Thank you for your insight and thank you your example, I should have came to you first!

    I also found a method by 'bypassing' the function call, ADC_MEASUREMENT_GetResult, and instead equating a variable to the desired registries.
    Ie, Result[0] = ADC_MEASUREMENT_Channel_A.group_handle->RES[15];

    However, I prefer your example.

    I managed to get your example working on xmc4700 relax kit. I will try to convert it across to the XMC4500. If I run into any problems, ill keep you updated.

    Thanks for the help Jesus.

    Regards,
    Steven

  4. #4
    Beginner Beginner Steven M is on a distinguished road
    Join Date
    Sep 2016
    Posts
    6
    Points
    60
    Hi,

    Is it possible to convert more than 1 channel at this speed?
    I optimized the compiler and have a successful conversion speed of 1MHz with one channel and an interrupt is generated on completion of the conversion.
    However, when I increase the channel count to 2, the interrupt is no longer called. It is called the once at the start but never again.
    It seems as though the conversion of the 2 channels takes more than 1us, because if the CCU is slowed down, to 100kHz, 2 channels can easily be converted.

    The desired sample time is 67ns and the actual is 550ns, I have read documentation which suggest this is possible. Can you help me with how?

    Thanks,
    Steven

  5. #5

    Infineon Employee
    Infineon Employee
    jferreira will become famous soon enough
    Join Date
    Oct 2012
    Posts
    539
    Hi,

    You can sample and convert up to 4 channels in parallel. You can use in DAVE, 4 ADC_MEASUREMENT_ADV APPs instances which are triggered by the same period match event of any timer.

    Regards,
    Jesus
    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

  6. #6
    Beginner Beginner Steven M is on a distinguished road
    Join Date
    Sep 2016
    Posts
    6
    Points
    60
    Thank you for all your help Jesus

+ Reply to Thread
Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.