Maker.io main logo

MicroMod Teensy Processor Hookup Guide

2021-12-16 | By SparkFun Electronics

License: See Original Project

Courtesy of SparkFun

Guide by EL DUDERINO

Introduction

The SparkFun MicroMod Teensy Processor leverages the awesome computing power of the NXP iMXRT1062 chip and pairs it with the M.2 MicroMod connector to allow you to plug it into your choice of compatible MicroMod Carrier Board. The computing power of the ARM Cortex-M7 processer operates at clock speeds up to 600MHz with 16MB of Flash memory and 1024K RAM.

SparkFun MicroMod Teensy Processor

 

 

On top of excellent processing power and speed, the Teensy Processor offers a plethora of interface options including seven serial UART ports as well as four I2C buses and two SPI ports. Along with these standard interfaces, the Teensy Processor Board also features USB Host and Device capability up to 480Mbit/s, a CAN-Bus and a digital audio interface.

Teensy is a registered trademark of PJRC. The MicroMod Teensy is a collaboration between PJRC and SparkFun.

Required Materials

Along with your MicroMod Teensy Processor, you'll need a Carrier Board to plug your Processor into. SparkFun offers a variety of MicroMod Carrier Boards to fit your project's needs:

You'll also need a USB-C cable to connect the Carrier to your computer and if you want to add some Qwiic breakouts to your MicroMod project you'll want at least one Qwiic cable. Below are some options for both of those cables:

Depending on which Carrier Board you choose, you may need a few extra peripherals to take full advantage of them. Refer to the Carrier Boards' respective Hookup Guides for specific recommendations.

Suggested Reading

The SparkFun MicroMod ecosystem offers a unique way to allow users to customize their project to their needs. Do you want to send your weather data via a wireless signal (e.g. Bluetooth or Wi-Fi)? There's a MicroMod Processor for that. Looking to instead maximize efficiency and processing power? You guessed it, there's a MicroMod Processor for that. If you are not familiar with the MicroMod ecosystem, take a look here:

If you aren't familiar with the MicroMod ecosystem, we recommend reading here for an overview:

Micro_1

MicroMod Ecosystem

We also recommend reading through the following tutorials if you are not familiar with the concepts covered in them:

  • Serial Communication: Asynchronous serial communication concepts: packets, signal levels, baud rates, UARTs and more!

  • Serial Peripheral Interface (SPI): SPI is commonly used to connect microcontrollers to peripherals such as sensors, shift registers, and SD cards.

  • Installing Arduino IDE: A step-by-step guide to installing and testing the Arduino software on Windows, Mac, and Linux.

  • Logic Levels: Learn the difference between 3.3V and 5V devices and logic levels.

  • I2C: An introduction to I2C, one of the main embedded communications protocols in use today.

  • Getting Started with the Teensy: Basic intro to the Teensy line of products, with soldering and programming suggestions.

  • Getting Started with MicroMod: Dive into the world of MicroMod - a compact interface to connect a microcontroller to various peripherals via the M.2 Connector!

Hardware Overview

We'll cover the hardware and components included on the MicroMod Teensy Processor Board in this section and highlight some of their unique features.

M.2 Connector

All of our MicroMod Processor come equipped with the M.2 MicroMod Connector, which leverages the M.2 standard and specification to allow you to install your MicroMod Processor on your choice of Carrier Board.

Connector_2

M.2 Connector from the Front

 Connector_2a

M.2 Connector from the Back

The M.2 MicroMod connector is keyed (in tandem with the set screw notch) to prevent the Processor from being inserted and secured improperly.

NXP iMXRT1062 Processor

The brain of the MicroMod Teensy Processor is the NXP iMXRT1062 from NXP Semiconductors. This Arm Cortex-M7 core processor is one of the most powerful microprocessors available today. The MicroMod Teensy Processor board takes advantage of the following properties:

  • ARM Cortex-M7 at 600MHz

  • Seven Serial Ports

  • 2 SPI ports (One dedicated SPI available by default on most Carrier Boards[1]. Dedicated Hardware SDIO for SD.)

  • 4 I2C Bus (One I2C bus available by default on most Carrier Boards[1])

  • USB Host Capability up to 480Mbit/sec making it capable of interfacing with USB flash drives, mice, keyboards and more

  • USB Device Capability up to 480Mbit/sec making it capable of interfacing with USB keyboard/mouse/joystick, MIDI, audio, and more

  • 1 CAN Bus Interface

  • I2S Digital Audio and S/PDIF

  • 12 Dedicated GPIO

  • 14 Analog pins (2 dedicated, 10 share signals.)

  • 3.3V-tolerant I/O pins

  • 16MB Flash Memory (256K reserved for recover & EEPROM emulation)

  • 1024K RAM Memory (512K is tightly coupled)

Chip_3

Note: We recommend advanced users looking to take full advantage of all of the features of the Teensy Processor use it with the MicroMod ATP (All the Pins) Carrier Board or their own custom Carrier Board. Many of the pins with extra functionality may be tied to a specific use on other Carrier Boards and therefore essentially unavailable for things like extra UARTs, SPI/I2C or Analog In/PWM.

Flash IC

The MicroMod Teensy Processor uses the W25Q128JV-DTR serial flash memory IC from Windbond Electronics. The flash IC features 128mb of memory. For a detailed overview of the IC, refer to the datasheet.

IC_4

LEDs

There are two LEDs on the Teensy Processor. The PROG LED indicates when the HalfKay bootloader is enabled and the programming IC is powered. We'll cover how to enter the bootloader in the Software Setup and Arduino Example sections. The STAT LED is tied to SCK/13 and can be used as a status LED or as a built-in LED. Control it directly by writing to LED_BUILTIN.

LED_5

Measure Jumper

The Measure (MEAS) Jumper can be opened to measure how much current the Teensy Processor is pulling from V_USB. It's is CLOSED by default and ties the USB_VBUS pins to V_USB. Open it by severing the trace and then using a digital multimeter to measure the current draw.

Jumper_6

Teensy Processor Pin Functions

The Teensy Processor is similar to the Teensy 4.0 and 4.1 with a few notable differences. In order to maintain easy interoperability with MicroMod Carrier Boards, not all of the alternate pin functions are defined for the MicroMod Teensy board variant but we have done our best to make the Teensy Processor as versatile as possible with the right Carrier Board. The sections below outline the various signal protocols available on the MicroMod Teensy.

I2C

As you may have guessed from our extensive Qwiic System, we love communicating with devices using I2C! The Teensy Processor features four I2C buses. The main I2C bus has dedicated pins connected to MiroMod pads 12 (SDA) and 14 (SCL) (Teensy pins 18 and 19), along with a dedicated interrupt pin connected to MicroMod pad 16 (Teensy pin 29). The primary I2C Bus will almost always be connected to a Qwiic connector on your Carrier Board.

If you need a second I2C bus, the Teensy has SDA1 and SCL1 on MicroMod pads 53 and 51 (Teensy pins 25 and 24). To use this second bus, initialize it by calling Wire1.begin();.

UART

The Teensy Processor is capable of having seven UARTs available. The primary UART is tied to USB_D± (MicroMod pads 3 and 5) for serial communication over USB. This is used for your standard serial upload as well as serial prints in Arduino. The secondary UART is a hardware UART tied to MicroMod pads 19 (RX1) and 17 (TX1) (Teensy pins 0 and 1). The tertiary UART is another hardware UART tied to MicroMod pads 20 (RX2) and 22 (TX2) (Teensy pins 17 and 16). In Arduino, the three UARTs are called as listed below:

  • Serial - Communication over USB

  • Serial1 - Communication over RX1/TX1

  • Serial2 - Communication over RX2/TX2

SPI

You may not recognize the COPI/CIPO labels for SPI pins. SparkFun is working to move away from using MISO/MOSI to describe signals between the controller and the peripheral. Check out this page for more on our reasoning behind this change.

The Teensy Processor has two SPI ports. The primary SPI connects to the following pins:

  • SDI/CIPO - Serial data input (Controller In/Peripheral Out). MicroMod pad 61. Teensy pin 12.

  • SDO/COPI - Serial data output (Controller Out/Peripheral In). MicroMod pad 59. Teensy pin 11.

  • SCK - SPI Clock. MicroMod pad 57. Teensy pin 13.

  • CS - Chip select. MicroMod pad 55. Teensy pin 10.

Due to hardware limitations on most MicroMod Carrier Boards, SPI1 is only available for hardware SDIO communication with an SD card. Use the ATP Carrier to directly interact with SPI1.

CAN-Bus

One of the unique features of the Teensy is its ability to communicate with CAN devices. The Teensy MicroMod can receive CAN messages but in order to send them properly you will need a separate CAN transceiver. CAN-RX is tied to MicroMod pad 41 (Teensy pin 30) and CAN-TX is tied to MicroMod pad 43 (Teensy pin 31).

AUDIO

The Teensy Processor supports audio using the I2S standard. The pins used are:

  • AUD_OUT - GPIO pin 7, pad 56 on the MicroMod, this is the digital audio output

  • AUD_IN - GPIO pin 8, pad 54 on the MicroMod, this is the digital audio input

  • AUD_LRCLK - GPIO pin 20, pad 52 on the MicroMod. Officially called "word select", and also known as "frame sync"

  • AUD_BCLK - GPIO pin 21, pad 50 on the MicroMod. Offically called "continuous serial clock, and also known as the "bit clock"

GPIO/BUS

The MicroMod Teensy has all 12 general purpose IO pins available on top of 6 dedicated pins for digital, analog and PWM signals. The dedicated pins are just that, and are not shared with any other pin, unlike the general-purpose pins which may be shared with other pins. Take note that not all GPIO pins are broken out or in use on every carrier board. Refer to your Carrier Board's Hookup Guide for more information on pin use.

Dedicated Pins

  • A0 - Teensy pin 14, MicroMod pad 34

  • A1 - Teensy pin 15, MicroMod pad pad 38

  • D0 - Teensy pin 4, MicroMod pad pad 10

  • D1 - Teensy pin 5, MicroMod pad pad 18

  • PWM0 - Teensy pin 3, MicroMod pad pad 32

  • PWM1 - Teensy pin 2, MicroMod pad pad 47

General Purpose IO pins

  • G0 - GPIO pin 15, pad 40 on the MicroMod

  • G1 - GPIO pin 25, pad 42 on the MicroMod

  • G2 - GPIO pin 26, pad 44 on the MicroMod

  • G3 - GPIO pin 17, pad 46 on the MicroMod

  • G4 - GPIO pin 16, pad 48 on the MicroMod

  • G5 - GPIO pin 32, pad 73 on the MicroMod

  • G6 - GPIO pin 33, pad 71 on the MicroMod

Extra Teensy Functionality

As experienced users may know, the pins on Teensy development boards are very versatile and can be used for a multitude of purposes. As we noted above, in order to maintain compatibility with the rest of the MicroMod system, not all of these alternate functions are available on the MicroMod Teensy, but some pins can be configured for things like Analog Inputs or Pulse Width Modulation. As mentioned before, the best way to interact with these pins is with the ATP Carrier Board.

The list below shows all 14 pins on the Teensy Processor available for use as Analog Inputs.

  • A0 - Teensy pin 14, dedicated on MM pad 34. PWM-Capable

  • A1 - Teensy pin 15, dedicated on MM pad 38. PWM-Capable

  • A2 - Teensy pin 16, shared with RX2 (MMpad 20). Input Only

  • A3 - Teensy pin 17, shared with TX2 (MM pad 22). Input Only

  • A4 - Teensy pin 18, shared with I2C_SDA (MM pad 12). PWM-Capable

  • A5 - Teensy pin 19, shared with I2C_SCL (MM pad 14). PWM-Capable

  • A6 - Teensy pin 20, shared with AUD_LRCLK (MM pad 52). Input Only

  • A7 - Teensy pin 21, shared with AUD_BCLK (MM pad 50). Input Only

  • A8 - Teensy pin 22, shared with BATT_VIN/3 (MM pad 49). Input Only

  • A9 - Teensy pin 23, shared with AUD_MCLK (MM pad 58). PWM-Capable

  • A10 - Teensy pin 24, shared with I2C_SCL1 (MM pad 53). PWM-Capable

  • A11 - Teensy pin 25, shared with I2C_SDA1 (MM pad 51). PWM-Capable

  • A12 - Teensy pin 26, shared with G8 (MM pad 67). Input Only

  • A13 - Teensy pin 27, shared with G11 (MM pad 8). Input Only.

The default MicroMod Teensy Processor board definition is limited to these extra functionalities along with a few other pins that can technically be used for PWM signals when not in use for other signal protocols. Keep reading to the next section, MicroMod Pinout, for specific information on these pins.

MicroMod Pinout

Refer to the datasheet and user manual for a full overview of the iMXRT1062's capabilities. The complete pin map can be found in the table below or you can refer to the schematic. PJRC has a wealth of knowledge on their forums with regard to the beta testing of the MicroMod Teensy. Here is a specific post that goes into detail about the pin map.

Heads up! The pin table below and schematic both include the Teensy pin associated with each MicroMod pin and this correlation can be used to identify alternate uses for pins on the Teensy Processor but not all of the alternate Teensy functionalities are available for use with the SparkFun Teensy MicroMod board definition. For many of the General Purpose I/O pins and other pins with multiple signal options, refer to your Carrier Board's Hookup Guide for information on how those pins are configured what they are used for. Not all pins are used on every Carrier Board.

TEENSY PROCESSOR PINOUT TABLE

 Table_7

MICROMOD GENERAL PINOUT TABLE

Table_8

MICROMOD GENERAL PIN DESCRIPTIONS

Table_9

Board Dimensions

MicroMod Processors all measure in at 22mm x 22mm, with 15mm to the top notch and 12mm to the E key. For more information regarding the processor board physical standards, head on over to the Getting Started with MicroMod and Designing With MicroMod tutorials.

Board_8

Hardware Assembly

Now that we are familiar with the components on the Teensy Processor, it's time to assemble it with your chosen MicroMod Carrier Board and connect it to your computer.

Inserting the Processor Board

With the M.2 MicroMod connector, connecting your Processor is a breeze. Simply match up the key on your Processor's beveled edge connector to the key on the M.2 connector. At a 45° angle, insert the processor board to the M.2 connector. The Processor Board will stick up at an angle as shown here:

Hardware_9

Once the board is in the socket, gently press the Processor down, grab the set screw and tighten it with a Phillip's head screwdriver:

Socket_10

Once the Processor is secure, your assembled MicroMod system should look similar to the image below.

Secure_11

Note: There is technically no way to insert the processor backward since the key prevents it from mating with the M.2 connector when inserted incorrectly. As an extra safeguard to prevent inserting a processor improperly or with a poor connection, the mounting screw will not match up if the Processor Board is not plugged in entirely.

Connecting Everything Up

Depending on which Carrier Board you are using with your Teensy Processor, plug in any other devices (Qwiic breakouts, UART devices, SD cards, I/O devices, etc.) prior to plugging in your Carrier Board to USB. Refer to your Carrier Board's Hookup Guide for specific instructions for Hardware Assembly.

With your Teensy Processor Board inserted and secured and your other devices connected properly it's time to connect your MicroMod Carrier Board to your computer using the USB-C connector. On first power-up, the STAT LED on your Teensy Processor should be blinking on and off every second.

Software Setup

To start working with the Teensy Processor (or any Teensy really), all you need to do is plug in your USB cable to your computer and your Carrier Board. There are two options for programming the Teensy boards - the Arduino IDE or your favorite C compiler. This tutorial will demonstrate how to use Arduino with the Teensy Processor so if you prefer to not use Arduino, download and install the Teensy Loader application.

Arduino IDE Installation

If this is your first time using Arduino, please review our tutorial on installing the Arduino IDE. If you have not previously installed an Arduino library, please check out our installation guide. With Arduino installed, move on to installing the Teensyduino add-on.

Teensyduino Installation

With Arduino installed, download and install the Teensyduino add-on before uploading code to the Teensy Processor. You can find the Teensyduino download for Windows, Mac OS X and Linux from PJRC here.

PJRC: TENSYDUINO ADD-ON

Teensyduino includes all Teensy board definitions as well as an optional installation of a selection of Arduino libraries to work with Teensy boards. Please follow their installation instructions for the most up-to-date version of the Teensyduino for your operating system. During installation, select which Teensy-compatible libraries you'd like to install. If you aren't sure which libraries you will want, you can skip this step and download and install them later from their curated list.

Programming the Teensy

Open up the Arduino IDE, select the Teensy MicroMod board from the Board menu and select the Port your Processor Board enumerated on. With everything selected properly, press the BOOT button on your Carrier Board to manually enter the bootloader. You should see this window:

Programming_12

Teensy Loader Window

Once the Teensy is in the bootloader, upload the code to your board as usual through Arduino. Press the BOOT button on the Carrier Board once Arduino has compiled the code to complete the upload if prompted. You should only need to do this the first time you upload code on every power cycle.

Note: Most Arduino libraries work on Teensy. However, modifications to the libraries may be needed to make it cross-platform compatible. There are a few libraries curated on PJRC's website with modifications and special instructions specific to Teensy. Check out a few of the libraries below to take advantage of a Teensy's features like its Real Time Clock (RTC) or capacitive touch pins.

PJRC: ARDUINO LIBRARIES FOR TEENSY

Arduino Example: Blink

With the MicroMod Teensy Processor Board Definitions installed, let's do a quick code upload to make sure everything went correctly during the Arduino Software Setup.

Selecting and Loading Blink

We'll start off with a basic Blink example to turn the STAT LED on and off just to make sure everything is working properly, and your Processor can accept code.

Open up the Arduino IDE and select the "Blink" example by navigating to "File > Examples > 01.Basics > Blink" or copy the code below into a blank sketch:

Copy Code
// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

With the example opened, select your Board (SparkFun MicroMod Teensy Processor Board) and Port using the Tools > Board and Tools > Port menus and click the "Upload" button. Barring any issues during compilation and upload, the STAT LED on your Teensy Processor should blink on and off every second.

Note, if this is the first time uploading click the Verify button, the Teensy Loader Program will open (if it is not already open) and prompt you to push the Pushbutton (the BOOT button on your Carrier Board). After that, you can upload to the Teensy Processor just like any other Arduino by clicking the Upload button.

Troubleshooting

Need help?

If your product is not working as you expected or you need technical assistance or information, head on over to the SparkFun Technical Assistance page for some initial troubleshooting.

SPARKFUN TECHNICAL ASSISTANCE PAGE

If you don't find what you need there, the SparkFun Forums are a great place to find and ask for help. If this is your first visit, you'll need to create a Forum Account to search product forums and post questions.

CREATE NEW FORUM ACCOUNT             LOG INTO SPARKFUN FORUMS

Resources and Going Further

Now that you've gotten your MicroMod Teensy Processor up and running with your chosen Carrier Board, it's time to start your MicroMod project! Take a look at the following resources for more information about MicroMod and Teensy.

The links below offer more information about the Teensy Processor:

For more information on the MicroMod ecosystem, check out these resources:

For more information about Teensy, take a look at the following pages:

制造商零件编号 DEV-16402
MICROMOD TEENSY PROCESSOR
SparkFun Electronics
制造商零件编号 DEV-16885
MICROMOD ATP CARRIER BOARD
SparkFun Electronics
制造商零件编号 DEV-16829
MICROMOD DATA LOGGING CARRIER
SparkFun Electronics
制造商零件编号 SEN-16794
SPARKFUN MICROMOD WEATHER CARRIE
SparkFun Electronics
制造商零件编号 DEV-16985
MICROMOD INPUT/DISPLAY CARRIER
SparkFun Electronics
制造商零件编号 KIT-15081
QWIIC CABLE KIT
SparkFun Electronics
制造商零件编号 CAB-15424
CBL USB2.0 A PLUG TO C PLG 6.56'
SparkFun Electronics
Add all DigiKey Parts to Cart
TechForum

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.

Visit TechForum