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.

Measuring ADC conversion time TMS570LS1227 with XDS100V2

Other Parts Discussed in Thread: TMS570LS1227

Hi,

I have read many thread related to ADC conversion time in TMS570. It all says how to calculate the ADC conversion time. Is there any way ,I can measure the ADC conversion time?.  Also is there any way to measure the time at which the PWM updated in each switching period?

I am running the sample project comes with my development kit DRV8301LS12   "FOC BLDC motor speed control".

It uses PWM interrupts for ADC conversion.

I am using debug tool XDS100V2. and code composer studio 5.5.

Thanks & Regards,

Rathinavel

  • Hi Rathinavel,

    There is actually a way to measure the ADC conversion time on the TMS570LS1227 MCU. This is possible only in the enhanced channel selection mode of operation, as described in the technical reference manual (SPNU515) section 22.4.2.2 starting on page 885.

    This mode of operation allows you to drive three signals (AWM1_EXT_ENA and AWM1_EXT_SEL[1:0]) out on device terminals. These signals are assigned to pins 51, 52 and 52 on the 144-pin QFP package, and to balls V8, W8 and V9 on the 337 BGA package.

    You do need to configure the I/O multiplexing control registers to enable AWM1_EXT_ENA to be output on the given terminal. This signal by itself is enough for the purpose of measuring the ADC conversion time.

    The rising edge of the AWM1_EXT_ENA signal is coincident with the start of the input channel sampling period. AWM1_EXT_ENA gets driven low 2 ADCLK cycles after the sampling period is completed. You can measure the rise-to-rise delay on the AWM1_EXT_ENA signal to measure the actual delay between the conversion of a single channel and the start of conversion of the next channel in sequence.

    Let me know if you have any questions.

    Regards,

    Sunil

  • Hi,

    Thanks for the reply.

    But the method you have mentioned gives only the time between two start of conversion. I thought of measuring time between the start of conversion interrupt occurrence(SOC)  and end of conversion interrupt (EOC)occurrence time.  

     I was trying to access the interrupt service routine, when EOC and SOC occurs and I can use it to toggle a GIO.

    I was going through the VIM interrupt request assignments in document SPNS192A (TMS570LS1227 datasheet) page 94. It has one interrupt mapped to VIM)(channel 15 )from ADC sw group1interrupts. 

    My doubt is ,   if I enabled both SOC and EOC interrupts in the interrupt registers for ADC, then VIM (channel 15) will get triggered at both SOC and EOC ? (if I understood the function of VIM correctly, if not could you please explain me how it works)

    Do you know any real time trace possibility for this controller. I have ready many documents, that is mostly possile only in TI core using CCS. For ARM core we need to use DAP for real time trace. But I dont know how to use DAP .

    Note: I am using EPWM1SOCA as source of SOC.

    Thanks & Regards,

    Rathinavel

  • Hi Rathinavel,

    The timing of the ADC is fixed once it starts sampling an input. The actual group1 sampling time is defined by the application via the programming of the ADG1SAMP register. Once the input has been sampled, the conversion period starts. This period is 10 or 12 ADCLK cycles depending on whether the ADC has been configured as a 10-bit or 12-bit ADC respectively. This can be selected via the "10/12BIT" bit of the ADC Operating Mode Control Register. The EOC occurs once the conversion period is done.

    If you want to measure the actual time from trigger condition to end of conversion:

    You can enable generation of an interrupt from the ePWM1 module to coincide with the ePWM1SOCA condition, and toggle a pin in this ISR. You can also enable a group conversion end interrupt for group1 with a single channel selected, and then toggle the same pin in this ISR.

    There are some internal delays related to the ADC conversions that are missing from our datasheet/TRM today. These are planned to be added in the next versions. I am including a snapshot with this post.

    Let me know if this helps.

    Regards,

    Sunil

  • Thanks for the reply. I would implement the same.

    Thanks & Regards,

    Rathinavel