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.

TMS320F280025: Frequency measurement offset error

Part Number: TMS320F280025
Other Parts Discussed in Thread: TMS320F28379D,

We need very precise measurement of a frequency measurement using eCAP module of TMS320F280025. I have discussed my initial findings regarding some offset error in the original thread where I noticed that my frequency measurement appear to have around 2 usec offset from the 50 Hz signal generator. suggested that I generate a 50 Hz PWM from the DSP itself and measure its frequency. I have done this and found that the measurement is very accurate i.e. 2000000 counter value or 20.00000 msec. From this observation I understand that the eCap is setup correctly for measurement. Assuming that the function generator could have some offset (around 2.2 uSec), I did one more experiment: I programmed a Delfino (TMS320F28379D) launchpad for 50 Hz PWM. When I do its measurement with the  TMS320F280025 we again see an error of about 2.4 uSec (as compared to 2.2 uSec with function generator). I have captured the 50 Hz PWMs generated from the TMS320F280025C (Channel 1) and TMS320F28379D (Channel 2) using digital logic analyzer and below is the screenshot.

So I am getting more than 2 uSec measurement error in the frequency measurement for both the function generator as well as Delfino. The magnitude is also comparable. There seems to be a common source of error. Kindly guide on this and recommend if there is some method to improve the frequency measurement accuracy. Kindly also note that we are shifting our design to Delfino so if there is some better option in this controller then please let me know.

  • Asad,

    I've assigned your post to the subject matter expert, but due to US Holiday, please expect our response by the end of day Monday.

    Best,

    Matthew

  • Hi Asad,

    I have done this and found that the measurement is very accurate i.e. 2000000 counter value or 20.00000 msec. From this observation I understand that the eCap is setup correctly for measurement

    This seems to indicate there is some clock accuracy mismatch between your sources and the measurement F28002x device.

    The magnitude is also comparable.

    Is there a reason why the magnitude in your scope shot is less than 3v?

  • I will check why the magnitude is coming below 3 volts and reply to you. Both the Delfino and Piccolo are being powered from the same laptop USB ports. Maybe there is loading...

  • I have configured ECAP1 module in the TMS320F28379D Launchpad. I have generated the same 50Hz signal from our signal generator to feed into the ECAP1 input of the TMS320F28379D Launchpad as that generated for TMS320F280025 Launchpad. The Delfino is measuring count value to be 3999956. So this becomes 3999956 * 5 nS = 19999780 nSec. Assuming that the function generator is accurate ,the error in this case is 220 nSec. In case of piccolo it was coming around 2200 nSec i.e. 10 times large. I think that the crystal on the piccolo launchpad is not accurate. These are different make for sure as one is surface mount and the other one is through hole. Please advise so that we can conclude this thread.

  • Hi Asad,

    The crystal on the F280025 LP has a ppm of -/+25 which means it's frequency can vary from 19,999,500 Hz to 20,000,500 Hz.

    If you multiply that to get the 100MHz you are running at, it results in 99,997,500 Hz to 100,002,500 Hz. You divide that by the 50 Hz you are trying to measure and that gets you 1,999,950 to 2,000,050 counts.

    This works out to 50*10ns = 500ns possible error. In essence, you are seeing about 4x what you should typically see based on the crystal ppm. It's a bit higher than I would expect but I think it's within the realm of possibility. It might be possible to get the crystal more accurate than this by optimizing the load capacitors to minimize the effect of any frequency pulling that could be happening.

    However, nothing on the F28002x device requires this tight of a clock accuracy so we don't design the Launchpad PCB or select a crystal to squeeze out every last bit of ppm.

    I am not sure why you need to measure the 50Hz signal to that level of accuracy but based on the quick calculations, I think you are within the region of typical crystal freq ppm.

    Let us know if you have more questions on this.

  • There is an anti islanding algorithm that requires measurement resolution to be 400 nSec. However since we are shifting to Delfino and apparently its measurement accuracy is better than 400 nSec so we are hopeful to pass the test with it.  If TI has some good reference design for highly accurate grid frequency measurement circuit to interface with the eCap input then please let us know. We are having some issues with sporious rising edge triggers at the zero crossings causing unwanted eCap event triggers. We are looking into adding hysteresis option. Otherwise we can close this thread.

  • Hi Asad,

    There is an anti islanding algorithm that requires measurement resolution to be 400 nSec. However since we are shifting to Delfino and apparently its measurement accuracy is better than 400 nSec so we are hopeful to pass the test with it.

    I think you might have precision/resolution and accuracy mixed up. The F2837xD (5ns resolution) is more precise than F28002x (10ns resolution) but it is not more accurate. The accuracy we are talking about here is a function of the crystal ppm (input clock accuracy) and not the device clock speed. I don’t mean to be pedantic but this is a subtle but important distinction for your case here.  

    If TI has some good reference design for highly accurate grid frequency measurement circuit to interface with the eCap input then please let us know.

    I see a few options for you:

    1. For your board design, you can work with the crystal manufacturer to optimize the exact load capacitance you need to get for instance <10ppm across all conditions. For the accuracy you are looking for, PCB parasitics start to become very important to crystal load capacitance. Unfortunately, you can’t use any load capacitance because we have a requirement for our devices on allowable range so you might ultimately be limited here.
    2. Use an accurate single-ended clock rather than a crystal. Essentially you will need to find a can oscillator with perhaps <10ppm accuracy across its operating conditions. I think this might be a better option for you.
    We are having some issues with sporious rising edge triggers at the zero crossings causing unwanted eCap event triggers. We are looking into adding hysteresis option.

    This sounds separate from the accuracy discussion so please go ahead and create a new thread for it if you are still having that problem.