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.

Compiler/TMS320F28069M: ADC Inconsistent with Signal Generator

Part Number: TMS320F28069M
Other Parts Discussed in Thread: LAUNCHXL-F28069M

Tool/software: TI C/C++ Compiler

I am able to successfully run code from lab 6 of the C2000 2806x workshop. It uses the ADC with sample rate of 50k to sample the ePWM generated by the board. It's a 2k signal with 25% duty cycle. When I sample this same signal, but from a signal generator and graph it in CCS, it looks like samples are dropped or something isn't synchronized. 

What's going on here? It's the same signal!

  • ePWM from dev board:

    PWM from function generator:

    100 Hz @ 25%

    100Hz sine:

  • bass2,

    How are you connecting the function generator to your F2806x? Are you using a TI EVM?

    Can you confirm the signal on the pin using an oscilloscope?

    -Tommy
  • Function generator signal to ADCINA0 and GND to board GND. This is using the LaunchXL-F28069M dev board. Yes, I've confirmed the signal I'm sampling with a scope.

    The sample rate verification has come from toggling a GPIO in the ADC ISR and scoping it

  • Do you see any variability in GPIO toggling speed from your ADC ISR? Is there any signal distortion at the A1 pin?

    It might be worthwhile to plot your buffer conversions with another tool like a spreadsheet to see if it's an artifact from the CCS graph tool.

    You can also try to create a new graph with a display size equal to your buffer size so that you aren't seeing phase drift between updates and change the display type to include markers so that you can see the individual data points.

    If you still have issues, the next approach would be to configure the function generator to output a DC voltage and make sure that the ADC settings are compatible with the function generator. Once you have stable DC results, you can go back to AC wave forms.
  • The GPIO toggle rate is consistent and there's not any signal distortion. I've sent the buffer data to MATLAB via serial and the plot is consistent with that of CCS. In addition, I've watched the buffer contents update as the ADC runs. When it's sampling the PWM generated by the dev board, there are consistent chunks where the signal is high (6 samples I believe) and corresponding sample chunks of 0's where the signal is low. When I look at the buffer while sampling the function generator, there aren't consistent chunks where the signal is high. There may be 3-4 samples where it's high, then a 0, then it's high again, then 0. You can clearly see this in my above post of the 100 Hz square signal. For these reasons, I don't think it's a plotting issue.

    EDIT: I've verified that DC voltages don't show the same behavior.

  • How is your Sample/Hold time (ACQPS) set? Some function generators are only capable of rather low current.
  • I’ve varied it from 7-25 but didn’t observe any change.

  • bass2,

    Are you halting CPU execution when examining the conversion results? It would be a good idea to at least halt the EPWM so that it is no longer generating ADC SOC triggers to make sure that your data is not being corrupted by background data updates.

    Since DC conversions look good, I would recommend trying to sample a very slow (like 1Hz) ramp or triangle wave so that you can easily determine how well the ADC is synchronizing with the function generator.

    -Tommy
  • The CPU is running and I have continuous refresh on for CCS graph window and watch expressions. 

     

    This is a 1 Hz ramp with ePWM controlling sample rate at 50 kHz:

  • bass2,

    I highly recommend that you evaluate a static set of conversions. Continuous refresh will pull in background updates, which may corrupt your visible data set.

    A simple way to do this for debug is to stop storing ADC conversions when the buffer is full.

    -Tommy
  • bass2,

    It has been a while since your last update. I assume that you were able to resolve your issue. If this isn’t the case, please reject this resolution and reply to this thread. If this thread is locked, please make a new thread describing the current status of your issue.

    -Tommy