Is it possible to toggle a gpio @300MHz in a teensy 4 @600MHz ?

Status
Not open for further replies.

jorge

New member
Hello,

What a wonderful thing is the teensy 4! This the first time ever I've put my hands on a 1GHz µC!! Love it.

I was reading the datasheet and saw this: "Tightly coupled GPIOs, operating at the same frequency as Arm" => immediately thought: really? Can I toggle a gpio @600MHz? Let's try that!

Code:
#define PIN 13

void setup () { pinMode(PIN, OUTPUT); }

void loop () {
  while (1) {
    CORE_PIN13_PORTSET = CORE_PIN13_BITMASK;
    CORE_PIN13_PORTCLEAR = CORE_PIN13_BITMASK;
  }
}

But I'm "only" getting 1/4 the cpu clock: 150MHz. That's plenty for sure, but I was hoping to see ~ 300MHz. Am I doing it wrong? Is there something, somewhere, I can do to make it flip the gpio "at the same frequency as Arm" as the pdf says?
 
AFAIK you need two cycles to read/write a register. That makes 4 cycles per period which gives you 1/4 F_CPU. (plus the time for the loop)
 
It might be running the I/O on rate of F_BUS_ACTUAL { which is 150 MHz at 600 MHz I saw noted past day(s) } - it did on T_3.6 AFAIK - but T4 clocks are unique …

Note also said F_BUS_ACTUAL goes to 200 MHz at CPU speed of 800 MHz?

Also there is a TOGGLE interface - though it isn't brought out the same and would need to be coded like PORTSET and CLEAR are from what I saw in CORES. Not likely any faster - but might be more symmetric in the while() jump timing?

With good ambient temp and free air 816 MHz should be safe - but going over 900 Requires heatsink and/or cooling fan air to avoid chip damage - and YMMV that may not be enough.
 
Also maybe not exactly what is asked here.

There are settings for the different IO pins on how fast that pin should be run, how strong of a signal...
Example look at the document at: IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_01(page 558)

There is a 2 bit speed field:
Code:
Speed Field
Select one out of next values for pad: GPIO_EMC_01
00 SPEED_0_low_50MHz — low(50MHz)
01 SPEED_1_medium_100MHz — medium(100MHz)
10 SPEED_2_medium_100MHz — medium(100MHz)
11 SPEED_3_max_200MHz — max(200MHz)
Which sort of implies max speed of 200mhz...
 
Status
Not open for further replies.
Back
Top