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.

TMS320F2800157: eQEP Timer Period and Value

Part Number: TMS320F2800157

In eQEP watchdog I have found that while changing the 'watchdog timer period' and 'watchdog timer value' where both the values are capped between 0 to 65535, the 'watchdog timer value [ns]' is not changing and is stuck at default value of 8.333 approx. Is this a bug? And to get a watchdog time of 1 second what can be the value of both 'watchdog timer period' and 'watchdog timer value'.

  • Hi Kaustuv,

    Are you using any examples for this? Are you using driverlib function to update the watchdog timer period/value?

    Best,

    Ryan Ma

  • I am building the code from scratch as I cannot find example related to watchdog EQEP. And I am not using any diverlib function either to update the watchdog timer value. As the explanation and examples for every modules are concise that for new developers it is difficult to learn properly. 

    We are seeking solution for our problem in another thread https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1357275/tms320f2800157-ecap---interrupt-source---counter-equals-compare-isr-source using this watchdog and a single signal input at any GPIO. Here input Signal is continuous pulse of 1 Hz.

    If the raise ISR at watchdog time out in eQEP can solve our problem then what configuration is needed to be done?

  • Hi Kaustuv,

    This may be a solution for the other thread. If you're using eQEPxAIN, you can source QCLK by this signal. Then by using the eQEP watchdog, you can then send out an interrupt like you're mentioning.

    1. Configuring the input to eQEPxAIN

    2. Configuring QDECCTL[XCR] = 0x00 ? 

    3. Configuring QDECCTL[QSRC] = 0x01;

    4. Configuring the QEPCTL[WDE] (enable watchdog), QWDPRD(set watchdog period of 1s), QEINT[WTO] (enable the watchdog interrupt source). 

    Driverlib functions: EQEP_enableWatchdog(uint32_t base, uint16_t period); EQEP_enableInterrupt(uint32_t base, uint16_t intFlags);

  • Hi Ryan,

    I currently tested the above configuration. I might be missing something in '.syscfg' file. I attached all the changes in the file as jpg. Kindly, provide some input as this method is still not working properly.

    Here, for the interrupt function  I created "ISR_Card....._ISR" (3rd Uploaded File)  properly.  Input pulse GPIO 40 is connected to a function generator with 1 Hz.

    Irrespective of the input 1 Hz signal is on or off (the 1 Hz input pulse from Function generator is connected or not connected to GPIO Pin 40) two cases I have found. (i,e no effect of the input pulse)

    - When value of Watchdog period is <= 59 (Refer to picture where it is showing 10000), it will raise interrupt for first time and will never raise further interrupts.

    - When value of Watchdog period is > 59, it will not raise any interrupt.

    I seek valuable input from your side.

    Thanks Ryan

  • Hi Kaustav,

    Please refer to the following PIE table. You've correctly cleared the eQEP interrupt flags, however you will need to clear the interrupt ack group.

    This is an example of clearing an interrupt generated from ePWM. note "Interrupt_clearACKGroup" function.

    Best,

    Ryan Ma

  • Hi Ryan,

    We are happy to inform you that the method discussed with all required changes worked as intended.

    Now, we have got last problem which is needed to be figured out.

    Problem:

    We have 7 signals of same frequency. In eQEP we have only 2 instances meaning only two input GPIOs i,e eQEPxAIN, eQEPxBIN.

    We want to detect all the 7 signals in round robin fashion. We can achieve that if we are able to change the  eQEPxAIN input in run time. While going through the syscfg file I was not get such functionality.

    Is there any way to change the GPIO input in run time?

    Regards

    Kaustuv

  • Hi Kaustuv,

    Glad to hear it's working!

    Changing the input during run time would require custom logic that SysCfg will not be able to provide. You need to disable the eQEP before changing input pins.

    If you use the PWMXBAR as input to the eQEP, you can then route the INPUTXBAR to PWMXBAR. That way you can change what GPIO INPUTXBAR is sourced from to achieve what you want. If you use the device pins, you would need 7 dedicated GPIOs to roudn robin through. However if you use PWMXBAR + INPUTXBAR you can achieve the same with just one INPUTXBAR that is configured for the GPIOs when round robining. 

    eQEP <- PWMXBAR <- INPUTXBAR <- GPIO

    Best,

    Ryan Ma

  • Hi Ryan,

    We are delighted to inform you that we implemented and tested the above technique and it is working absolutely fine.

    Thanks a lot for your consistent effort on solving it.

    In near future we are planing for upgrading the system to use a different Board which is having more than 7 eQEP module.

    Kindly suggest any board, if exist, where I can have more than 7 eQEP instances.

    Regards,

    Kaustuv

  • Hi Kaustuv,

    Unfortunately the most eQEPs on a device is our TMS320F28P65x  which has up to 6 eQEPs. If you have any further questions please open another post!

    Best,

    Ryan Ma

  • Hi Ryan,

    Thanks a lot for your input.

    Regards

    Kaustuv