Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: GPT1 / GPT2: Count from external pin @300MHz?

  1. #1
    Junior Member
    Join Date
    Oct 2021
    Posts
    18

    GPT1 / GPT2: Count from external pin @300MHz?

    Hello,

    I found this example:
    https://github.com/manitou48/teensy4.../gpt_count.ino
    https://github.com/manitou48/teensy4...gpt2_count.ino

    It counts external pulses from the pin 14. Since I don't have a teensy 4.1 board, I have a question. Up to which frequency can the pin count? With a cpu clock rate of 600MHz, 300 MHz @pin 14 should be possible? Has anyone ever tried something like this in this direction?

    Thanks!

  2. #2
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,655
    reference manual (52.3.1) says "To ensure proper operations of GPT, the external clock input frequency should be less than 1/4 of frequency of the peripheral clock (ipg_clk)", so max is 150mhz/4 = 37.5 MHz. Though in practice, I think i've got GPT to count correctly up to 75 MHz (68 MHz for externally generated signal). Here is post on Teensy 3 counting up to 132 MHz using LPTMR and short jumpers.
    Last edited by manitou; 10-03-2021 at 03:59 PM.

  3. #3
    Senior Member
    Join Date
    Jul 2020
    Posts
    1,235
    The internal clock speed of a processor is often higher than the speed the GPIO pads are clocked, since those aren't in the
    low voltage core of the chip which has the fastest speed. This is why LVDS signalling is used for really fast interfacing to a chip
    as it can go straight to the core and is a transmission line (tuning out the pesky BW-limiting capacitance).

    This is basically just like the old days when ECL divide-by-ten chips were used to prescale in counters to a speed compatible
    with TTL. There were divide-by-10/11 chips for use in PLLs to allow more flexible divide ratios by guile and cunning.

    Another thing to consider is that up at speeds like 300MHz you need to use transmission lines, either 50, 75ohm coax or 110
    ohm twisted pair - which means that unless you use low-voltage signalling the power consumption is very high. This means
    it typically requires a comparator or line-receiver to detect the low voltage signals used (which might be 1mW or so, meaning a few 100mV).

  4. #4
    Junior Member
    Join Date
    Oct 2021
    Posts
    18
    Quote Originally Posted by MarkT View Post

    Another thing to consider is that up at speeds like 300MHz you need to use transmission lines, either 50, 75ohm coax or 110
    ohm twisted pair - which means that unless you use low-voltage signalling the power consumption is very high. This means
    it typically requires a comparator or line-receiver to detect the low voltage signals used (which might be 1mW or so, meaning a few 100mV).
    Right. For that topic there are SN65LVDS1 and SN65LVDS2.

  5. #5
    Junior Member
    Join Date
    Oct 2021
    Posts
    18
    Quote Originally Posted by ;290068
    reference manual (52.3.1) says "To ensure proper operations of GPT, the external clock input frequency should be less than 1/4 of frequency of the peripheral clock (ipg_clk)", so max is 150mhz/4 = 37.5 MHz. Though in practice, I think i've got GPT to count correctly up to 75 MHz (68 MHz for externally generated signal). Here is post on Teensy 3 counting up to 132 MHz

    The 60-70 MHz are disappointing. Also because it's the fastest MCU on the market.

    How does he manage to measure 132 MHz? Is the measurement reliable?
    https://forum.pjrc.com/threads/54711...l=1#post212014.
    Last edited by 0xABCD; 10-03-2021 at 12:45 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •