Teensy 3.1

Teensy 3.1
Click here for larger image
Pinout

Features

  • Processor: MK20DX256VLH7
  • Core: Cortex-M4
  • Rated Speed: 72MHz
  • Overclockable: 96MHz
  • Flash Memory: 256Mb
  • Bandwidth: 192
  • Cache: 256
  • RAM: 64
  • EEPROM: 2
  • Direct Memory Access: 16
  • Digital I/O: 34
  • Voltage Input: 5V Tolerant
  • Voltage Output: 3.3V

Documentation

Quick Start with Teensy 3.1

This tutorial will walk through using the command line to setting up your own “Makefile”. A makefile turns a C file into a “.hex” file that can then be loaded onto the Teensy.

*Note: If you are looking for information on an IDE for ARM processors, this tutorial will not go into detail about how you write C for the ARM processor, instead we will focus on what to do with it after it has been written.

Tools:

  • Male header
  • Teensy 3.1
  • USB to USB-micro
  • Arduino studio
  • Teensy loader

*Note: If you do not have Arduino Studio or the Teensy Loader you will need to install them prior to starting this tutorial.

Steps

  1. Solder male header pins onto the module.
  2. P1020954.JPG
  3. Wiring:
  4. wiring wiring example
  5. Download the “Teensy 31” folder. This folder contains all the files needed to compile a .hex program.


  6. Open the “Teensy 31” folder and navigate to the makefile. You will need to use a text editor like notepad++ to open the file.


  7. Once you open the makefile you will see that the first section of code is labeled “EDIT THIS SECTION”. You will need to edit the code that references file paths for the following: Arduino tools path and compiler path to match your computers file paths.
    Example: “arm-none-eabi-gcc.exe” is one of the tools file paths in the makefile that needs to be edited.


  8. File Path Example

  9. On your computer open up the file locator to the location of your Arduino install.
  10. ex1

  11. Copy and paste the name of the file that you need to find the file path for into the search window. (arm-none-eabi-gcc.exe, arm-none-eabi-g++.exe, arm-none-eabi-objcopy.exe, arm-none-eabi-size.exe)
  12. ex1_1

  13. After the search finished you can “right” click the file you are looking for to see the file path.
  14. ex1_2

  15. Now compare that file path to the one in the makefile. If the file path on your computer is different than the one in the makefile, edit the makefile path to match your computers file path. Example:
    G:\Arduino\hardware\tools\arm\bin\


  16. When you are finished editing all the file paths save and exit the makefile.


  17. Open the command prompt. Change your directory so that you are in the “Teensy31” folder. Then enter “make” into the command prompt. The make command will compile the makefile and create the .hex program.
  18. CMD

  19. To load the example code main.hex or the .hex you created onto the teensy using the Teensy bootloader. Open the bootloader and clicking “file”. Then navigating into the “Teensy31 folder and select the .hex program. Finally load the program onto the teensy by pushing the button as shown and load your file and clicking the load button.
    *Note: The example main.cpp file is a simple “blinky” program.
  20. loader
Congratulations! You have now successfully compiled a .hex file for your C code on your Teensy 3.1 and loaded it onto the Teensy.