Part Number: TMS320F28377S
Hello,
I curently use eCAP module to mesasure phase shift between the ePWM CTR = 0 and an external signal comming from a GPIO.
The ePWM SyncOut signal is routed to eCAP SyncIn signal in order to reset the eCAP counter. the external signal (from GPIO) is routed to the eCAP input. The rising edge of the external signal triggers a capture in CAP1 register in continuous mode.
To test this design, I have loop back the ePWM output A used to reset the eCAP counter, to the eCAP external signal input. This, in order to have a fixed phase shift measurement that ease the software design and debug. (See schem in attached file)
This design work fine, except a constant offset of +10 SYSCLK in mesasurement (CAP1 register).
The eCAP CAP1 expected value is:
CAP1 = (ePWM CMPA * 2) - 4
* ePWM CMPA * 2 : because ePWM CMPA is used to force ePWM output A at high level, * 2 is du to ePWM clock prescaler configuration.
* - 4 : Becaue it is the ePWM SYNCOUT propagation signal delay.
Instead of this value, I read (CMPA * 2) + 6. A total diference of 10 SYSCLK.
I try to find a response in TMS320F2837xS TRM and TI forums, that I unfortunately haven't found.
Questions:
Is there a technical explaination of this diff?
Is my software design faulty?
Is my expected value in CAP1 register faulty?