1.. _teensy40:
2
3PJRC TEENSY 4
4#############
5
6Overview
7********
8The Teensy is a complete USB-based microcontroller development system, in a
9very small footprint, capable of implementing many types of projects. All
10programming is done via the USB port.
11
12
13.. figure:: teensy40.jpg
14   :align: center
15   :alt: TEENSY40
16
17   TEENSY40 (Credit: https://www.pjrc.com)
18
19.. figure:: teensy41.jpg
20   :align: center
21   :alt: TEENSY41
22
23   TEENSY41 (Credit: https://www.pjrc.com)
24
25Hardware
26********
27
28Teensy 4.0:
29
30- MIMXRT1062DVL6A MCU (600 MHz, 1024 KB on-chip memory)
31- 16 Mbit QSPI Flash
32- LED
33- USB 2.0 host connector
34
35Teensy 4.1:
36
37- MIMXRT1062DVJ6A MCU (600 MHz, 1024 KB on-chip memory)
38- 64 Mbit QSPI Flash
39- LED
40- USB 2.0 host connector
41- USB 2.0 OTG connector
42- 10/100 Mbit/s Ethernet PHY
43- TF socket for SD card
44
45See the `Teensy 4.0 Website`_ for a complete hardware description.
46
47Supported Features
48==================
49
50The teensy40 board configuration supports the following hardware
51features:
52
53+-----------+------------+-------------------------------------+
54| Interface | Controller | Driver/Component                    |
55+===========+============+=====================================+
56| NVIC      | on-chip    | nested vector interrupt controller  |
57+-----------+------------+-------------------------------------+
58| SYSTICK   | on-chip    | systick                             |
59+-----------+------------+-------------------------------------+
60| GPIO      | on-chip    | gpio                                |
61+-----------+------------+-------------------------------------+
62| I2C       | on-chip    | i2c                                 |
63+-----------+------------+-------------------------------------+
64| UART      | on-chip    | serial port-polling;                |
65|           |            | serial port-interrupt               |
66+-----------+------------+-------------------------------------+
67| USB       | on-chip    | USB device                          |
68+-----------+------------+-------------------------------------+
69
70The default configuration can be found in
71:zephyr_file:`boards/pjrc/teensy4/teensy40_defconfig`
72
73The teensy41 board configuration supports additional hardware
74features:
75
76+-----------+------------+-------------------------------------+
77| Interface | Controller | Driver/Component                    |
78+===========+============+=====================================+
79| SDHC      | on-chip    | disk access                         |
80+-----------+------------+-------------------------------------+
81| ENET      | on-chip    | ethernet                            |
82+-----------+------------+-------------------------------------+
83
84The default configuration can be found in
85:zephyr_file:`boards/pjrc/teensy4/teensy41_defconfig`
86
87Other hardware features are not currently supported by the port.
88
89Connections and IOs
90===================
91
92Pin mappings from Teensy to MIMXRT1062 SoC.
93
94+-----+------------+-------------------------------------+
95| Pin | Pad ID     | Usage                               |
96+=====+============+=====================================+
97|  0  | AD_B0_03   | GPIO1_3 / UART6_RX / CAN2_RX        |
98+-----+------------+-------------------------------------+
99|  1  | AD_B0_02   | GPIO1_2 / UART6_TX / CAN2_TX        |
100+-----+------------+-------------------------------------+
101|  2  | EMC_04     | GPIO4_4                             |
102+-----+------------+-------------------------------------+
103|  3  | EMC_05     | GPIO4_5                             |
104+-----+------------+-------------------------------------+
105|  4  | EMC_06     | GPIO4_6                             |
106+-----+------------+-------------------------------------+
107|  5  | EMC_08     | GPIO4_8                             |
108+-----+------------+-------------------------------------+
109|  6  | B0_10      | GPIO2_10                            |
110+-----+------------+-------------------------------------+
111|  7  | B1_01      | GPIO2_17 / UART4_RX                 |
112+-----+------------+-------------------------------------+
113|  8  | B1_00      | GPIO2_16 / UART4_TX                 |
114+-----+------------+-------------------------------------+
115|  9  | B0_11      | GPIO2_11                            |
116+-----+------------+-------------------------------------+
117| 10  | B0_00      | GPIO2_0                             |
118+-----+------------+-------------------------------------+
119| 11  | B0_02      | GPIO2_2                             |
120+-----+------------+-------------------------------------+
121| 12  | B0_01      | GPIO2_1                             |
122+-----+------------+-------------------------------------+
123| 13  | B0_03      | GPIO2_3 / LED                       |
124+-----+------------+-------------------------------------+
125| 14  | AD_B1_02   | GPIO1_18 / UART2_TX                 |
126+-----+------------+-------------------------------------+
127| 15  | AD_B1_03   | GPIO1_19 / UART2_RX                 |
128+-----+------------+-------------------------------------+
129| 16  | AD_B1_07   | GPIO1_23 / UART3_RX / I2C3_SCL      |
130+-----+------------+-------------------------------------+
131| 17  | AD_B1_06   | GPIO1_22 / UART3_TX / I2C3_SDA      |
132+-----+------------+-------------------------------------+
133| 18  | AD_B1_01   | GPIO1_17 / I2C1_SDA                 |
134+-----+------------+-------------------------------------+
135| 19  | AD_B1_00   | GPIO1_16 / I2C1_SCL                 |
136+-----+------------+-------------------------------------+
137| 20  | AD_B1_10   | GPIO1_26 / UART8_TX                 |
138+-----+------------+-------------------------------------+
139| 21  | AD_B1_11   | GPIO1_27 / UART8_RX                 |
140+-----+------------+-------------------------------------+
141| 22  | AD_B1_08   | GPIO1_24 / CAN1_TX                  |
142+-----+------------+-------------------------------------+
143| 23  | AD_B1_09   | GPIO1_25 / CAN1_RX                  |
144+-----+------------+-------------------------------------+
145| 24  | AD_B0_12   | GPIO1_12 / UART1_TX / I2C4_SCL      |
146+-----+------------+-------------------------------------+
147| 25  | AD_B0_13   | GPIO1_13 / UART1_RX / I2C4_SDA      |
148+-----+------------+-------------------------------------+
149| 26  | AD_B1_14   | GPIO1_30 / SPI3_MOSI                |
150+-----+------------+-------------------------------------+
151| 27  | AD_B1_15   | GPIO1_31 / SPI3_SCK                 |
152+-----+------------+-------------------------------------+
153| 28  | EMC_32     | GPIO3_18 / UART7_RX                 |
154+-----+------------+-------------------------------------+
155| 29  | EMC_31     | GPIO4_31 / UART7_TX                 |
156+-----+------------+-------------------------------------+
157| 30  | EMC_37     | GPIO3_23 / CAN3_RX                  |
158+-----+------------+-------------------------------------+
159| 31  | EMC_36     | GPIO3_22 / CAN3_TX                  |
160+-----+------------+-------------------------------------+
161| 32  | B0_12      | GPIO2_12                            |
162+-----+------------+-------------------------------------+
163| 33  | EMC_07     | GPIO4_7                             |
164+-----+------------+-------------------------------------+
165
166Only Teensy 4.0:
167
168+-----+------------+-------------------------------------+
169| 34  | SD_B0_03   | GPIO3_15                            |
170+-----+------------+-------------------------------------+
171| 35  | SD_B0_02   | GPIO3_14                            |
172+-----+------------+-------------------------------------+
173| 36  | SD_B0_01   | GPIO3_13                            |
174+-----+------------+-------------------------------------+
175| 37  | SD_B0_00   | GPIO3_12                            |
176+-----+------------+-------------------------------------+
177| 38  | SD_B0_05   | GPIO3_17                            |
178+-----+------------+-------------------------------------+
179| 39  | SD_B0_04   | GPIO3_16                            |
180+-----+------------+-------------------------------------+
181
182Only Teensy 4.1:
183
184+-----+------------+-------------------------------------+
185| 34  | B1_13      | GPIO2_29 / UART5_RX                 |
186+-----+------------+-------------------------------------+
187| 35  | B1_12      | GPIO2_28 / UART5_TX                 |
188+-----+------------+-------------------------------------+
189| 36  | B1_02      | GPIO2_18                            |
190+-----+------------+-------------------------------------+
191| 37  | B1_03      | GPIO2_19                            |
192+-----+------------+-------------------------------------+
193| 38  | AD_B1_12   | GPIO1_28 / SPI3_CS                  |
194+-----+------------+-------------------------------------+
195| 39  | AD_B1_13   | GPIO1_29 / SPI3_MISO                |
196+-----+------------+-------------------------------------+
197| 40  | AD_B1_04   | GPIO1_20                            |
198+-----+------------+-------------------------------------+
199| 41  | AD_B1_05   | GPIO1_21                            |
200+-----+------------+-------------------------------------+
201
202Programming and Debugging
203*************************
204
205Flashing
206========
207Build applications as usual (see :ref:`build_an_application` for more details).
208
209Flash hex-file with the documented tools:
210
211.. _Teensy flash tools:
212   https://www.pjrc.com/teensy/loader.html
213
214Debugging
215=========
216Console output is mapped to teensy pins 0 (RX1) and 1 (TX1). Connect a usb-to-serial adapter
217to use this serial console. Use the following settings with your serial terminal of choice (minicom, putty,
218etc.):
219
220- Speed: 115200
221- Data: 8 bits
222- Parity: None
223- Stop bits: 1
224
225References
226**********
227
228.. target-notes::
229
230.. _Teensy 4.0 Website:
231   https://www.pjrc.com/store/teensy40.html
232
233.. _Teensy Schematics:
234   https://www.pjrc.com/teensy/schematic.html
235
236.. _i.MX RT1060 Website:
237   https://www.nxp.com/products/processors-and-microcontrollers/arm-based-processors-and-mcus/i.mx-applications-processors/i.mx-rt-series/i.mx-rt1060-crossover-processor-with-arm-cortex-m7-core:i.MX-RT1060
238
239.. _i.MX RT1060 Datasheet:
240   https://www.nxp.com/docs/en/nxp/data-sheets/IMXRT1060CEC.pdf
241
242.. _i.MX RT1060 Reference Manual:
243   https://www.nxp.com/webapp/Download?colCode=IMXRT1060RM
244