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.

TMS570 ADC Jitter

Other Parts Discussed in Thread: HALCOGEN, TMS570LS1224

I am working on a TMS570LS1224 processor with HalCoGen 3.06.00, and I'm experiencing a strange jitter between the two groups on ADC1.

I have ADC1 set up so that both GROUP1 and GROUP2 trigger off ADC1EVENT signal and take a single sample per trigger event.  I am not using DMA.  The ISR / notification handles moving data from adc->GxBUF[n] to my storage buffer.

This is mostly working fine except intermittently I will see the data buffer for GROUP1 contain the exact data that is in GROUP2's buffer at that data point.  Please see the attached graph, in which GROUP1 is in blue and GROUP2 is in red.

As you can see, GROUP1's data at point N spikes to exactly GROUP2's at point N for one measurement point and then resumes course at point N+1.

This is odd because GROUP1 and GROUP2 have isolated data buffers, or so I'd assume.  GROUP1 gets its data from adc->GxBUF[1].BUF0 and GROUP2 gets its data from adc->GxBUF[2].BUF0.  GROUP1 and GROUP2 have independent ISRs; I'm using HalCoGen's API functions adc1Group1Interrupt() and adc1Group2Interrupt() so there doesn't seem to be any immediately obvious way that these buffers could get mixed.

Is there something I'm missing?  Thanks in advance for your help.

Regards,

Joe Shidle

  • Joe,

    On seeing your data points and the glitch being consistently matching with the other group, it looks more to do with the software code. Without looking/running the code on our side it might be difficult for us to debug this further.

  • I can post the ADC-related segments.  Attached is a zip file including:

    a) HalCoGen generated adc.c, adc.h and reg_adc.h containing initialization state of the ADC as well as the HalCoGen generated adc1Group1Interrupt() and adc2Group1Interrupt(), calling adcNotification().

    b) HalCoGen generated notification.c containing HalCoGen generated adcNotification() which calls (in USER CODE) my own local_adcNotification().

    c) local_notification.c which is a fragment of our app code which shows the definitions of the data structures for the "A data" (GROUP1) and the "B data" (GROUP2) as well as the copy mechanism inside local_adcNotification().

    I feel like this should be sufficient to give a picture of the configuration and data movement on ADC1.  I am omitting what seems to me to be other obvious code pieces such as calls to adcInit(), adcEnableNotification(), and adcStart/StopConversion().

    Thanks in advance,

    Joe Shidle

    1777.adc_code.zip

  • Joe,

    I have just started looking in to your code, if you do not have any restrictions to post your code, then pls post the complete zip which will help me evaluate it quicker. Since I would also need the codes on how you start the conversions etc. Let us know.

  • Thanks for your response.


    I was able to resolve the issue today.  At some point I'd changed the HalCoGen "ADC1 Memory" tab to have 0 words for Buffer C for Group2.  I made a few changes:

    1) Set the sample "FIFO size" to 1 in Group1 and Group2 HalCoGen section

    2) Adjusted the "ADC1 Memory" tab to provide 32 words to Buffer C (and 16/16 to Buffers A and B)


    What was likely happening is, with 0 words allocated to Buffer C then my "B Data" was getting put into my "A Data" Buffer B lacking anywhere else to put it.


    Thanks again,

    Joe Shidle

  • Thanks for confirming the closure of this issue.