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.

TMS320F28388D: Using epwm to generate adcsoca and internally route it to the strobe input of eqep to latch the position count

Part Number: TMS320F28388D

Tool/software:

Hello,

This question is about the TMS320F28388D (337 bga pin) processor.

My goal is to use only internal signal routing to accomplish the following: generate an adcsoca signal from a pwm and use it as the strobe input to an eqep to latch the eqep count value on each adcsoca.  I want to keep all signal routing (e.g. adcsoca from epwm to eqep) internal to the chip, thus avoid needing to configure any gpio pins.

(This part seems to work...) In the code composer studio registers window, the ETFLG.SOCA pin go high when the program starts running, so I think the adcsoca is being generated.

(This part seems to work...) In the code composer studio registers window, the eqep qposcnt value changes as expected for quadrature A and B input signals in accordance with changing input signals.

(This part does not seem to work...) The eqep qposslat register is never being populated which seems to indicate that something in the strobe latching is not working as expected.

The trm seems to indicate that if the epwm is generating the adcsoca signal, then by simply selecting it as the strobe input for the eqep, the eqep qposcnt should be latched on each occurrence of the adcsoca signal.

The eqep registers contain the following values:

QEPCTL = 0xD008

QEPSTROBESEL = 0x2

QEPSRCSEL = 0x1075

Any insight into why this doesn't work is greatly appreciated.

Thanks!

  • Hi Chris,

    There is a solution for this. Please make sure that the QEPSRCSEL.bit.QEPSSEL is set to 1.

    https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1280604/tms320f28388d-the-configuration-of-qposslat

    Here is the e2e thread as reference.

    Best,

    Ryan Ma

  • Hi Ryan.  Thank you for the reply.

    I have QEPSRCSEL.QEPSSEL set to 1 (and I've tried 0, 2, and 0xffff, too), and the eqep still doesn't latch on the strobe signal.

    The eqep strobe is set to be adcsoca which is being generated by epwm.  Two adc modules also covert on adcsoca, and manually setting ETSEL.SOCAEN to 0 via the registers window causes the adc modules to stop update.  So, it appears that epwm is generating the adcsoca signal and it is at least making it to the adc modules, but the eqep is not latching on the soca.

    The eqep is, however, getting the A and B signals through internal routing from two cmpss modules and the eqep count changes in accordance with the quadrature signals, but the eqep strobe just dosn't seem to work.

    I saw in a document that assigning the adcsoca to the eqep strobe is only available in eqep version 2 and higher.  The tms320f28388d that I have has REV.MINOR = 1 and REV.MAJOR = 1 according to the registers window.  Does that make sense?  Should this tms320f28388d be able to have the adcsoca from an epwm assigned to its strobe signal and routed internally in the chip?

    Thanks,

    Chris

  • Hi Chris,

    This device has the ability to use the ADCSOCA as strobe signal to latch the counter.

    Can you confirm by reading the QFLG.SEL register is being set at all? Is it always reading back 0?

    Ensure that you have the SYSCTL.ADCSOCOUTSELECT enabled for the respective PWM that you are using for the ADCSOCA.

    Best,

    Ryan Ma

  • Hi Ryan,

    Without the PWM13SOCAEN = 1 (as pasted in below), the QFLG.SEL was set, but the strobe latch register never changed.

    The eqep strobe latch register is updating if I add the following:
    SyncSocRegs.ADCSOCOUTSELECT.bit.PWM13SOCAEN = 1; 

    Is that a required setting for internally creating/routing an adcsoca signal?  What does it do?

    Thanks,

    Chris

  • That is a required setting. It enables the ADCSOCA/B signals to be generated.

    Best,

    Ryan Ma

  • Thanks for the help, Ryan!

    Can you help me understand what information from the trm I missed that would have let me know that it was required?  I've read section 3 of the trm several times and still haven't been able to figure out what I missed that would have made me see that PWM13SOCAEN = 1 is a required setting, nor what it actually does.

  • Hi Chris,

    Apologize for the confusion. Let me file a ticket so we can get this further clarified in our TRM. 

    This register is apart of the System control configurations. Only place that there is definition of this feature is in the following registers.

    I will see where we should add more details about this feature in the SYSTEM control section of our TRM.

    Best,

    Ryan Ma

  • Ryan,

    Thanks for helping me get this straightened out.

    Best regards!

    Chris

  • You're welcome Chris! Thank you for bringing this to our attention.

    Best,

    Ryan Ma