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.

TMS570LC4357 ADC2 triggered by ePWM_A2 configuration

Hi there,

I need to trigger my ADC2 event group with ePWM_A2 event. However, when I look at the table on page 167 of the TRM, Control Option A and Control Option B have the same PINMMR163[8]. I have tried to set PINMMR163[8] = 0 and it did not work.

Can you please provide me some direction how to do the configuration here? Thank you!

Update:

I actually figured it out. The Control Option B should be PINMMR163[9] = 1.

However, I need to trigger another channel in ADC1 with ePWM_B event, which should be configured with PINMMR162[16] = 0 and PINMMR162[17] = 1. it seems there is some kind of iomm conflict between ADC2/ePWM_A2 and ADC1/ePWM_B. If I configure one of them alone, everything is fine. If I configure both, the system would crash shortly after boot.

Shuozhi

  • Hi,

    Thanks for identifying the typo in the table 7-17. I have submitted a bug report for this document and it will be addressed in the next update.

    The control settings for triggering ADC1 with ePWM_B is PINMMR161[8:9] = "01" from table 7-16. The settings that you mentioned are for selecting ePWM_B to trigger ADC2, which is essentially overriding the earlier selection of ePWM_A2 for ADC2.

    Sunil
  • Thank you for the reply, Sunil!

    In my application, I need to have three ADC groups out of two ADC modules triggered by three different PWM events.The issue is in the group source selection configuration. When I configure all three of them, I had a system crash that cannot be traced by GDB. If I only configure any two of them, which means the third group is not triggered, everything is fine and I can read all the ADC data from the triggered two groups.

    Before this failure, I used to have three groups from the same ADC module, which worked perfectly. However, when we designed the board, we decided to use two ADC modules and I ran into this trouble.

    If possible, can you help me quickly verify my configuration?

    Here is my configuration:

    // configure ADC event source
    ADC1[ADEVSRC].EV_SRC = 0x3;     // ADC1 EVT group triggered by source select = 3
    ADC2[ADEVSRC].EV_SRC = 0x6;     // ADC2 EVT group triggered by source select = 6
    ADC2[ADEVSRC].EV_SRC = 0x1;     // ADC2 GRP1 group triggered by source select = 1

    // trigger from ePWM events
    PINMMR161[0] = 0;
    PINMMR161[1] = 1;


    // ADC1 EVT group triggered from ePWM_A1
    PINMMR161[16] = 0;
    PINMMR161[17] = 1;


    // ADC2 EVT group triggered from ePWM_A2
    PINMMR163[8] = 0;
    PINMMR163[9] = 1;


    // ADC2 GRP1 group triggered from ePWM_B
    PINMMR162[16] = 0;
    PINMMR162[17] = 1;

  • Actually I found it's my bad. My ISR handler was not updated when I switch from ADC1 to ADC2, in which some memory is corrupted.

    Thank you very much!