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.

CCS/SM320F2812: C2000™ microcontrollers forum

Part Number: SM320F2812

Tool/software: Code Composer Studio

Good Morning,

I am running on a SM320F28128HFGM150 and using capture ports 3 and 6 capture a square wave signal with timers set to 25MHz and 25hz/128, respectively, providing a high resolution and low resolution count.

The two capture ports work flawlessly without the qualification period/filter turned on.  I get an exact number of counts, 37765 every time and it is what I expect.

I turned the qualification filter on and set the qualprd to 150 (0x0096) which gives me a filtering sampling period of 2*5*150*.0000000067 (SYSCLKOUT) = 10 us qualification window.  When I do this, the count oscillates between two to three discrete values, 37745, 37765 and 37775. 

It seems as though there is a timing or some sort of priority issue. Could enabling the qualification period cause issues with timing of the capture port and capturing rising edges? 

Respectfully, 
Dan

  • Hi,

    The engineer supporting this device is out of the office returning Monday July 29th.  I will attempt to find another resource to assist with your inquiry.  I apologize for any delays in response time.

    Thanks

    Christian

  • Dan,

    when you say:

    Daniel Quinlan1 said:
    using capture ports 3 and 6 capture a square wave signal with timers set to 25MHz and 25hz/128, respectively, providing a high resolution and low resolution count.
     

    Are you saying that one GP timer is configured to 25MHz and the other is configured to 25Hz/128, and both of these capture ports capture the same signal, correct?

    Thanks,
    Cody

  • Cody, 

    That is correct. The timers for Capture ports 3 and 6 are configured to 25Mhz and 25/128 Mhz respectively and they are capturing the same signal.

    Vr, Dan

  • Dan,

    Is it possible that you input signal is sometimes smaller than your qualification period?

    Do both the low resolution count and the high resolution count get the wrong value? Please note that your low resolution clock looks like it may be less than 2x your qualification period. I haven't fully thought through it, but it seems reasonable to me that you may see some data loss.

    Regards,
    Cody 

  • Cody, 

    We are using a function generator which is set round 600Hz so it should never be filtered out.   We can later adjust the function generator to be at a frequency that should be filtered out.

    Running at 600Hz, without the qualprd set, is never wavers (or wavers very little).  I will head to the lab and check the counts out shortly, however, from what I remember on Friday, the high resolution count is the one that wavers.  

    Dan

  • Cody, 

    I was able to get some numbers today.  The counts from the low-speed timer are the same every time with the qualprd on or off.  The counts from the high-speed 25MHz timer is what fluctuates.

    The larger the qualification period the more the counts bounce.  At Qualprd = 150, the counts 37724 to 37800, for example. It is exactly 37765 with the qualprd off.

    The smaller the qualprd, set to 8 for example, the change is much more subtle, at +- 10 at 37755 / 37775 instead of 37765.  

    Vr, Dan

  • Sorry, meant to add the input frequency is set to close to 5300 hz, 

  • Sorry. meant to say 662 Hz, not 5300.

  • Daniel,

    this issue is very weird, it appears as though this might be some kind of software configuration issue.

    Please check your input signal with an oscilloscope and verify that it is consistently the width that you expect over the test. I know since only one capture module is affected that it should be OK, but its a good sanity check.

    Also check the input qualifier settings, some of these are EALLOW protected, so you may not be writing the value that you think. The best way to do this is to read it back with the memory browser.

    Have you tried any other frequency inputs other than 25MHz? Do other frequencies show the same issue?

    Finally, it might be worth while to try and use a XINT signal to count the pulses using a GPIO. You could then add input qualification to it if you want. This will rule out clock dependent factors.

    Regards,
    Cody 

  • Daniel,

    are you still having issues with this? If not I'll close this thread.

    Thanks,
    Cody 

  • Cody, 

     I haven't had an opportunity to try some of your suggestions.  I'm trying to head over to the lab later this week to test.

    If you could keep it open a little longer, i would appreciate it.


    Thanks, Dan

  • Cody, 

    Going through your list:

    Daniel,

    Please check your input signal with an oscilloscope and verify that it is consistently the width that you expect over the test. I know since only one capture module is affected that it should be OK, but its a good sanity check. Using function generator.  Checked with Scope.  Input signal is perfect.  

    Also check the input qualifier settings, some of these are EALLOW protected, so you may not be writing the value that you think. The best way to do this is to read it back with the memory browser. Done inside ELLOW in initialization block.  Checked the value later on in debug and set correctly.

    Have you tried any other frequency inputs other than 25MHz? Do other frequencies show the same issue? Yes, tried 150, 75, and 12.5Mhz. same behavior but to lesser extent the higher the frequency.

    Finally, it might be worth while to try and use a XINT signal to count the pulses using a GPIO. You could then add input qualification to it if you want. This will rule out clock dependent factors.   Need to do this still

    Regards,
    Cody 

  • Are you still struggling with this? Have you seen if XINT exhibits the same issue?

    Thanks,
    Cody 

  • Cody, 

    You can close the issues. I'm no longer working the program, but, before I left, they decided to address the filter through hardware.

    Thanks for your support.

    Vr, Dan