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.

TMS570LS1114: Interference between resetting RTI up counter and ECAP period measurement

Part Number: TMS570LS1114

MCU: Hercules TMS570LS114

Problem: Interference between resetting RTI up counter and ECAP period measurement of clock/oscillator circuit signals

Background:  I have developed a radio-based product, a Master Radio and multiple slave Radios utilizing a time division multiplexed radio protocol.  The Slaves Sync onto the Master Radio Time Sync Packet with the aid of an GPIO input, which triggers an interrupt at the end of receiving a radio packet.  When servicing the GPIO interrupt the RTI up counter is cleared (every 10 seconds).  To account for crystal drift between the various units (master and multiple slaves) I have to periodically clear the RTI up counter when a Radio Sync packet is received.   The RTI is used to generate scheduled events and time slots for all the radios to work in.

The following code is used to Reset the RTI counters during an interrupt.  This method works well and all the radios keep synchronized to the Master Radio.

                    rtiStopCounter(rtiCOUNTER_BLOCK0);

                    rtiREG1->CNT[rtiCOUNTER_BLOCK0].UCx = 0x00000000U;

                    rtiREG1->CNT[rtiCOUNTER_BLOCK0].FRCx = 0x00000000U;

                    rtiREG1->CMP[rtiCOUNTER_BLOCK0].COMPx = 400U;

                    rtiStartCounter(rtiCOUNTER_BLOCK0);

However, I are performing frequency measurements with ECAP1 and ECAP5 modules and using the ETPWM to generate some timing signals for external hardware that is used to control oscillator circuits that I am trying to measure accurate frequency (40k-65Khz).  Each input to the ECAP has two oscillators multiplexed by the ETPWM generating a clock that is used to select which oscillator to sample.  The ETPWM is also used to generate a sample inhibit period for the oscillator to start up and stabilize.

For testing purposes and to eliminate the oscillators as a potential source of the interference I use a function generator as a clock source to the inputs of ECAP1,5.

When I enable the RTI code to periodically clear the RTI up counter, I am experiencing interference in pulse width measurements performed by ECAP1 and ECAP5.

If I disable the RTI code to clear the RTI up counters the pulse measurements performed by ECAP1 and ECAP5 work perfectly, ie are stable and reproducible BUT the radios eventually drift out of their time slots as the RTI up counters are not kept in sync with the network Master Timing Packet.

I can’t understand how the RTI is affecting the ECAP measurement.  I have checked on a scope and the ETPWM timing signals look unaffected.  The ECAP and ETPWM are clocked from the same source, VCLK4 which is a different source to the RTI clock, RTI1CLK.

When the interference occurs, I am seeing variations in frequency measure of up to 100Hz with a test input frequency of 50Khz.  Normally the measurements are very stable with 0Hz deviation between samples.

Could you please suggest how to fix this interference issue?