PJRC Teensy 4.0 – Cortex-M7
The Teensy 4.0 features an ARM Cortex-M7 processor clocked at 600MHz combined with an NXP iMXRT1062 chip. This is the fastest microcontroller available today (at the time of writing). Teensy 4.0 is the same size and shape as Teensy 3.2 and mostly retains compatibility with the pin functions on the much loved Teensy 3.2.
When running at 600 MHz, Teensy 4.0 consumes approximately 100mA current. It provides support for dynamic clock scaling and unlike traditional microcontrollers, where changing the clock speed causes wrong baud rates and other issues, the Teensy 4.0 hardware and Teensyduino’s software support for Arduino timing functions are designed to allow dynamically speed changes. Serial baud rates, audio streaming sample rates, and Arduino functions like delay() and millis(), and Teensyduino’s extensions like IntervalTimer and elapsedMillis, continue to work properly while the CPU changes speed. Teensy 4.0 also provides a power shut off feature. By connecting a pushbutton to the On/Off pin, the 3.3V power supply can be completely disabled by holding the button for 5 seconds, and turned back on by a brief button press. If a coin cell is connected to VBAT, Teensy 4.0’s RTC also continues to keep track of date & time while the power is off. Teensy 4.0 also can also be overclocked, well beyond 600MHz!
The ARM Cortex-M7 brings many powerful CPU features to a true real-time microcontroller platform. Cortex-M7 is a dual-issue superscaler processor, meaning the M7 can execute two instructions per clock cycle, at 600MHz! Of course, executing two simultaneously depends upon the compiler ordering instructions and registers. Initial benchmarks have shown C++ code compiled by Arduino tends to achieve two instructions about 40% to 50% of the time while performing numerically intensive work using integers and pointers.
The Cortex-M7 is the first ARM microcontroller to use branch prediction.
Tightly Coupled Memory is a special feature that allows Cortex-M7 fast single-cycle access to memory using a pair of 64 bit wide buses. The ITCM bus provides a 64-bit path to fetch instructions. The DTCM bus is actually a pair of 32-bit paths, allowing M7 to perform up to two separate memory accesses in the same cycle. These extremely high-speed buses are separate from M7’s main AXI bus, which accesses other memory and peripherals. 512K of memory can be accessed as tightly coupled memory. Teensyduino automatically allocates your Arduino sketch code into ITCM and all non-malloc memory use to the fast DTCM unless you add extra keywords to override the optimized default. Memory not accessed on the tightly coupled buses is optimized for DMA access by peripherals. Because the bulk of M7’s memory access is done on the two tightly coupled buses, powerful DMA-based peripherals have excellent access to the non-TCM memory for highly efficient I/O.
Teensy 4.0’s Cortex-M7 processor includes a floating-point unit (FPU) that supports both 64-bit “double” and 32-bit “float”. With M4’s FPU on Teensy 3.5 & 3.6, and also Atmel SAMD51 chips, the only 32-bit float is hardware accelerated. Any use of double, double functions like log(), sin(), cos() means slow software implemented math. Teensy 4.0 executes all of these with FPU hardware!
What’s new in Teensy 4.0?:
- Superfast ARM Cortex-M7 processor clocking in at 600 MHz, with an NXP iMXRT1062 chip in the Teensy 1.4 by 0.7-inch form factor
- Can be programmed using the Arduino IDE with Teensyduino add-on
- It’s the same size and shape as Teensy 3.2 and retains compatibility with most of the pin functions on Teensy 3.2
- Teensy 4.0 consumes approximately 100 mA current when running at 600MHz
- Can also be overclocked, well beyond 600 MHz!
- ARM Cortex-M7 at 600MHz (did we mention this already)???
- 1024K RAM (512K is tightly coupled)
- 2048K Flash (64K reserved for recovery & EEPROM emulation)
- 2 USB ports, both 480MBit/sec
- 3 CAN-Bus (1 with CAN FD)
- 2 I2S Digital Audio
- 1 S/PDIF Digital Audio
- 1 SDIO (4 bit) native SD
- 3 SPI, all with 16 word FIFO
- 3 I2C, all with 4 byte FIFO
- 7 Serial, all with 4 byte FIFO
- 32 general-purpose DMA channels
- 31 PWM pins
- 40 digital pins, all interrupt capable
- 14 analog pins, 2 ADCs on chip
- Cryptographic Acceleration
- Random Number Generator
- RTC for date/time
- Programmable FlexIO
- Pixel Processing Pipeline
- Peripheral cross triggering
- Power On/Off management
Teensy 4.0 Board and Pin Layout Top Side:
Teensy 4.0 Board and Pin Layout Bottom Side: