• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Microcontrollers » Hercules™ Safety Microcontrollers » Hercules™ Safety Microcontrollers Forum » ~1 MHz input signal timing`
Share
Hercules™ Safety Microcontrollers
  • Forum
  • E2E Wiki
Options
  • Subscribe via RSS

Forums

~1 MHz input signal timing`

This question is answered
Charles Miles
Posted by Charles Miles
on Jun 26 2012 10:39 AM
Prodigy245 points

I want to measure a signal of about 1 MHz. using the TMS470 MF06607 

I have tried using the PCNT algorithm on the HET, but unfortunately the algorithm has given results that are inconsistent around this frequency, sometimes varying from the true periods by 50% or more.

So I have been looking into using ECNT to count external pulses.  I could then interrupt the ECNT counting with some kind of Real Time Counter.  

Is the best (or only) way to do this involve the RTI peripheral? (the RTI peripheral would wait for x cycles before interrupting the HET)

Thanks in Advance,

Charlie

HET RTI external signal capture
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Kevin Lavery
    Posted by Kevin Lavery
    on Jun 26 2012 13:35 PM
    Intellectual1460 points

    Charlie,

    Can you check the loop resolution of the HET? ( HR Prescale Divide rate X Loop Resolution Prescale Divide rate X T(VCLK2))  The loop resolution period may be to large to sample the 1MHz clock.

    Regards,

    Forum Support

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Charles Miles
    Posted by Charles Miles
    on Jun 26 2012 14:39 PM
    Prodigy245 points

    The HR Prescale Divide rate is 0.

    The LRPD rate is 32.

    Does this not grant maximum resolution?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Kevin Lavery
    Posted by Kevin Lavery
    on Jun 26 2012 15:08 PM
    Intellectual1460 points

    Charlie,

    You'll have something like 32 VCLK2 periods per loop. What is the VCLK2 frequency?

    Regards,

    Forum Support

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Charles Miles
    Posted by Charles Miles
    on Jun 26 2012 15:42 PM
    Prodigy245 points

    80 MHz

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Kevin Lavery
    Posted by Kevin Lavery
    on Jun 26 2012 16:05 PM
    Intellectual1460 points

    Charlie,

    Just to clarify:

    GCLK and HCLK are running at 80MHz and the VCLK2 prescale is 0 (in CLKCNTRL register at 0xFFFF_FFD0). Can you confirm?

    Regards,

    Forum Support

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Charles Miles
    Posted by Charles Miles
    on Jun 26 2012 16:28 PM
    Prodigy245 points

    VCLK2, which is inside the HET is divided down by the HR and LR prescalers.

    These prescalers are controlled by the HETPFR which is set to 0x0000 0500

    I don't know what the CLKCNTRL register is.

    Charlie

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Kevin Lavery
    Posted by Kevin Lavery
    on Jun 26 2012 17:23 PM
    Intellectual1460 points

    Charlie,

    Obviously the line of debug I am taking is that the input clock frequency might be grossly mis-sampled if the sampling frequency was not fast enough.  Given an 80MHz operation and a HET prescaler of 32, you have a loop resolution of 400ns (80MHz/32 = 2.5MHz) with finer resolution possible using the HR features. If, however, the VCLK2 frequency were prescaled from HCLK, you would be at 40MHz/32 (or slower).

    The PLL synthesizes 80MHz from your oscillator. This frequency is supplied to GCLK (clocking CPU) and HCLK (clocking the System). The peripherals run off of VCLK which is a divided-down version of HCLK (could be /1). The only peripheral not clocked by VCLK is HET which is clocked by VCLK2 (again, a divided-down version of HCLK in which the prescale may be /1). This scheme is summarized in a graphical way on page 42 of the datasheet (SPNS157C  http://www.ti.com/lit/gpn/tms470mf06607).

    From a high-level, VCLK2 is supplied to the HET, and you are completely correct to say that HETPFR controls the prescalers within the HET.

    Assuming that the PLL really is synthesizing 80MHz and that the PLL is chosen as the clock source for the GCLK and HCLK domains, then all you need to do is check the VCLK2 prescaler in CLKCNTRL register. Can you interrogate the following registers:

    GHVCLKSRC at 0xFFFF_FF48 -- you expect the lest significant byte to be 1 (indicating that the PLL is clocking GCLK and HCLK)  -- see Section 4.2.19 of spnu495a http://www.ti.com/litv/pdf/spnu495a

    CLKCNTRL at 0xFFFF_FFD0 -- you expect the most significant byte to be 0 (indicating VCLK2 = HCLK/1) see Section 4.2.48 of spnu495a http://www.ti.com/litv/pdf/spnu495a

    You might also want to check the PLL configuration register to make sure it is really configured to give you 80MHz... see Section 6.4.1.1 and 6.4.1.2 also in spnu495a.

    Can you attach a project?

    Regards,

    Forum Support

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Charles Miles
    Posted by Charles Miles
    on Jun 27 2012 08:50 AM
    Prodigy245 points

    First of all, it should be noted that the PCNT function is relatively accurate at a 500kHz or lower input frequency.

     I'm using HALCOGEN, so GHVCLKSRC and CLKCNTRL were set automatically..

    Here is the stuff you asked for:

    1. a view of the memory locations 0xFFFF_FF48  and  0xFFFF_FFD0 from Code Composer Studio (in hex):


    2. My project:   

    2438.CharlieTiming2.zip

    NOTE: the first three sets of P,C,D words in het.c are the only relevant ones.  The instructions are CNT, ECNT, and BR respectively (BR branches to CNT). 

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Charles Miles
    Posted by Charles Miles
    on Jun 27 2012 08:55 AM
    Verified Answer
    Verified by Charles Miles
    Prodigy245 points

    Assuming the PCNT algorithm simply won't cut it, I have devised another plan.

    I can use CNT and ECNT in parallel (clock count, event count).  When CNT overflows - 2^20 ticks of 80 MHz clock have occured - I can simply check the value of ECNT. 

    What do you think?

    P.S. I'm having trouble understanding how I, the programmer am to implement a routine given an interrupt from the CNT algorithm.

    Thanks in advance,

    Charlie

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jean-Marc Mifsud
    Posted by Jean-Marc Mifsud
    on Jul 02 2012 23:45 PM
    Expert8985 points

    Charles,

    On NHET, each instruction can generate an interrupt. There is a bit in the control field to do so.

    The NHET can generate up to 32 interrupt based on instruction execution.
    Interrupt 0 correspond to the first instruction in your NHET code.
    Interrupt 1 correspond to the second instruction in your NHET code.
    ......
    Interrupt 31 correspond to the 32nd instruction in your NHET code.

    If you have more than 32 instructions in your NHET program, 2 instruction will be mapped to the same request.

    Interrupt 0 correspond to the 33nd instruction in your NHET code.
    Interrupt 1 correspond to the 34 instruction in your NHET code.
    ......

    Interrupt 31 correspond to the 64 instruction in your NHET code.

    Regards,

    Jean-Marc

    Best regards,

    Jean-Marc

    Application Engineer


    If my reply answers your question please click on the green button "Verify Answer".

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jean-Marc Mifsud
    Posted by Jean-Marc Mifsud
    on Jul 16 2012 21:51 PM
    Expert8985 points

    Charles,

    Did my answer clarified your question concerning interrupts on NHET?

    If yes, can you please mark this answer has "Verified Answer" so we can close this thread.

    Thanks and Regards,

    Jean-Marc

    Best regards,

    Jean-Marc

    Application Engineer


    If my reply answers your question please click on the green button "Verify Answer".

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use