Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Teensy 4.0 SPI pins

  1. #1

    Teensy 4.0 SPI pins

    The pinout diagram for the Teensy 4.0 seems to be missing the MISO1 pin. There are pins for MOSI1, and SCK1. (CS1 is also missing, but in most cases ANY pin can be assigned for that).
    There are pins for MISO2, MOSI2, SCK2, and CS2, though they seem to be dedicated to the built in SD card interface.

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,711
    The initial Card that shipped with T4 is missing the marking for this. They are on Pins 0 and 1:

    Here is a quick and dirty paste from my own Spreadsheet showing the different pins:

    Code:
    Pin	Name	GPIO	Serial	I2C	SPI	PWM	CAN	Audio	XBAR	FlexIO	Analog	SD
     0	AD_B0_03	1.3	Serial1(6) RX		SPI1(3) CS0	PWM1_X1	2_RX		IO-17			
     1	AD_B0_02	1.2	Serial1(6) TX		SPI1(3) MISO	PWM1_X0	2_TX		IO-16			
     2	EMC_04	4.4				PWM4_A2		2:TX_DATA	IO-06	1:4		
     3	EMC_05	4.5				PWM4_B2		2:TX_SYNC	IO-07	1:5		
     4	EMC_06	4.6				PWM2_A0		2:TX_BCLK	IO-08	1:6		
    5	EMC_08	4.8				PWM2_A1		2:RX_DATA	IO-17	1:8		
    6	B0_10	2.10				PWM2_A2	QT4_1	1:TX3_RX1		2:10		
    7	B1_01	2.17	Serial2(4) RX			PWM1_B3		1:TX_DATA	IO-15	2:17, 3:17		
    8	B1_00	2.16	Serial2(4) TX			PWM1_A3		1:RX_DATA	IO-14	2:16, 3:16		
     9	B0_11	2.11				PWM2_B2	QT4_2	1:TX2_RX2		2:11		
    10	B0_00	2.0			SPI(4) CS0	QT1_0		MQS_RIGHT		2:0     		
    11	B0_02	2.2			SPI(4) MOSI	QT1_2	1_TX			2:2		
    12	B0_01	2.1			SPI(4) MISO	QT1_1		MQS_LEFT		2:1     		
    13	B0_03	2.3			SPI(4) SCK	QT2_0	1_RX			2:3		
    14/A0	AD_B1_02	1.18	Serial3(2) TX			QT3_2		SPDIF_OUT		3:2	A1:7, A2:7	
    15/A1	AD_B1_03	1.19	Serial3(2) RX			QT3_3		SPDIF_IN		3:3	A1:8, A2:8	
    16/A2	AD_B1_07	1.23	Serial4(3) RX	Wire1(3) SCL				SPDIF_EXTCLK		3:7	A1:12, A2:12	
    17/A3	AD_B1_06	1.22	Serial4(3) TX	Wire1(3) SDA				SPDIF_LOCK		3:6	A1:11, A2:11	
    18/A4	AD_B1_01	1.17	Serial3(2) CTS	Wire(1) SDA		QT3_1				3:1	A1:6, A2:6	
    19/A5	AD_B1_00	1.16		Wire(1) SCL		QT3_0				3:0	A1:5, A2:5	
    20/A6	AD_B1_10	1.26	Serial5(8) TX					1:RX_SYNC		3:10	A1:15, A2:15	
    21/A7	AD_B1_11	1.27	Serial5(8) RX					1:RX_BCLK		3:11	A1:0, A2:0	
    22/A8	AD_B1_08	1.24				PWM4_A0	1_TX			3:8	A1:13, A2:13	
    23/A9	AD_B1_09	1.25				PWM4_A1	1_RX	1:MCLK		3:9	A1:14, A2:14	
    ---	----	----	------	---	---	---	---	----	----	-----	------	
    24/A10	AD_B0_12	1.12	Serial6(1) TX	Wire2(4) SCL		PWM1_X2					A1:1  	
    25/A11	AD_B0_13	1.13	Serial6(1) RX	Wire2(4) SDA		PWM1_X3	GPT1_CLK				A1:2	
    26/A12	AD_B1_14	1.30			SPI1(3) MOSI			1:TX_BCLK		3:14	A2:3  	
    27/A13	AD_B1_15	1.31			SPI1(3) SCK			1:TX_SYNC		3:15	A2:4  	
    28	EMC_32	3.18	Serial7(7) RX			PWM3_B1						
    29	EMC_31	4.31	Serial7(7) TX		SPI2(1) CS1	PWM3_A1						
    30	EMC_37	3.23				GPT1_3 	3_RX	3:MCLK	IO-23			
    31	EMC_36	3.22				GPT1_2	3_TX	3:TX_DATA	IO-22			
    32	B0_12	2.12						1:TX1_RX3	IO-10	2:12		
    33	EMC_07	4.7				PWM2_B0		2:MCLK	IO-09	1:7		
    												
    34	SD_B0_03	2.15	Serial5(8) RTS		SPI2(1) MISO	PWM1_B1			IO-07			DATA1
    35	SD_B0_02	3.14	Serial5(8) CTS		SPI2(1) MOSI	PWM1_A1			IO-06			DATA0
    36	SD_B0_01	3.13		Wire1(3) SDA	SPI2(1) CS0	PWM1_B0			IO-05			CLK
    37	SD_B0_00	3.12		Wire1(3) SCL	SPI2(1) SCK	PWM1_A0			IO-04			CMD
    38	SD_B0_05	3.17	Serial5(8) RX		SPI2(1) B_DQS	PWM1_B2			IO-09			DATA3
    39	SD_B0_04	3.16	Serial5(8) TX		SPI2(1) B_SSO_B	PWM1_A2			IO-08			DATA2
    I marked the SPI1 ones that are on 0 and 1...

  3. #3
    What do the numbers in () (IE: Serial1(4) mean? (Guess I might need the CPU datasheet to figure that out)
    Can you post the spreadsheet file?
    Thanks!

  4. #4
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,711
    Again Sorry, the stuff in my spreadsheet has more information in it than you may actually need/want.

    Example when it says Serial1(6), it is telling me that in Arduino code this is the Serial1 object, but the underlaying USART is USART 6...

    And in particular to your first question. About SPI1 pins. Where I show is that SPI1(3) this is saying (to me) is that this is the SPI1 object, which internally is made up using the I2C3 object...

    But unless you are someone (like me) who works on some of the internals, you for the most part don't need to know this...

  5. #5
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,363
    An alternative spreadsheet is my spreadsheet where I attempt to keep track of the Teensy LC, 3.0, 3.1, 3.2, 3.5, 3.6, and 4.0 pin assignments:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •