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.

TMS570LS1227: ADC sampling rate

Part Number: TMS570LS1227
Other Parts Discussed in Thread: HALCOGEN

Hello,

 I want to sample ADC module at the rate of 250 µs. As far as I know, we can manage only up-to 400 ns by selecting the prescalar. I'm thinking to use of NHET module to have the sampling rate of 250 µs. But my NHET module is already occupied with another HET program. How can I execute these 2  HET programs separately?

Regards,

Suyog

  • I did not understand your question well, but one option could be to use the ETPWM module as a capture trigger and you only have to modify the period of the signal.

    the resolution of the etpwm module is quite broad, so achieving a sampling rate of 250us is not a problem.

    Take into account the number of channels you will use.
    If you want to gain speed you can use the ADC1 modules and parallel the ADC2.

    I attached a file with code example to RM57L version of how to use the ADC with interrupts, with the etpwm as a trigger, review the configuration fuses from the HalCoGen.

    7380.RM57_ADC_INT.rar

    Best Regards

    Martin

  • Hello Martin,

     Thank you for your reply. Yes, the problem is solved with ETPWM module.

    I was having the query about using 2 HET programs ( '.c' and '.h' files )  simultaneously on same NHET channel. In my program, I'm already using 1 HET program for my 'custom' PWMs  but in parallel I've to use ADC module. But in ADC module I was having the  requirement of  larger sampling period. As far as I know, we can't import 2 different programs  ( '.c' and '.h' files ) on same channel . I was thinking to use other than HET module and I think, ETPWM seeems to be a better choice :D. 

    Thank you for helping me out !

    Regards,

    Suyog

  • I was glad to help you, greetings!
  • Hello Suyog,

    As Martin describes, the EPWM module can be configured as a trigger for the ADC and it will avoid additional NHET development. However, if you are set on using the NHET, a PWM can be programmed with only a few instructions added onto your existing program. i.e., it is not a new NHET program it would be additional instructions to you existing program if you have instruction space left in NHET memory. This is because NHET runs on a micromachine that steps through the instructions one at a time executing them in a serial manner unless there are branch and other conditional instructions that affect program flow. Once the code gets through all of the instructions (first to last), it begins again at the top of the NHET RAM to execute the program.

    With that said, the EPWM solution is one that would be less complex and meet your needs provided you aren't using the ePWM signal for something else.

    Another potential solution would be to use the RTI compare interrupt as the trigger. This way anytime there was a compare match the ADC conversion would be triggered.

    Below is a list of the available triggers listed in the device datasheet so you can evaluate your options:

    Note that use of the RTI compare 0 interrupt is valid for the default PINMMR (PINMUX) setting and the use of the ePWM requires manipulation of the PINMMR settings for the ADC triggers.