teensy 4 pinout names?

Status
Not open for further replies.

keithiopian

New member
Looking to get a keyboard firmware up using teensy 4, running into an issue finding the A-F/1-7 canonical pinout names (i.e. what was common for teensy 2.0). For the life of me i can't find the GPIO port names anywhere. Thanks in advance

K
 
For the life of me i can't find the GPIO port names anywhere.

I'm not sure, but if you are just looking for the relation of GPIO port/bit and the Teensy pin numbers you can print them out with the code described here: https://github.com/TeensyUser/doc/wiki/GPIO#low-level-access
This is what it prints out for a T4.


Code:
PIN   GPIOn-BITm  |  GPIOn-BITm    PIN
------------------|-------------------
00  -> GPIO6-03   |   GIPO6-02  ->  01
01  -> GPIO6-02   |   GIPO6-03  ->  00
02  -> GPIO9-04   |   GIPO6-12  ->  24
03  -> GPIO9-05   |   GIPO6-13  ->  25
04  -> GPIO9-06   |   GIPO6-16  ->  19
05  -> GPIO9-08   |   GIPO6-17  ->  18
06  -> GPIO7-10   |   GIPO6-18  ->  14
07  -> GPIO7-17   |   GIPO6-19  ->  15
08  -> GPIO7-16   |   GIPO6-22  ->  17
09  -> GPIO7-11   |   GIPO6-23  ->  16
10  -> GPIO7-00   |   GIPO6-24  ->  22
11  -> GPIO7-02   |   GIPO6-25  ->  23
12  -> GPIO7-01   |   GIPO6-26  ->  20
13  -> GPIO7-03   |   GIPO6-27  ->  21
14  -> GPIO6-18   |   GIPO6-30  ->  26
15  -> GPIO6-19   |   GIPO6-31  ->  27
16  -> GPIO6-23   |   GIPO7-00  ->  10
17  -> GPIO6-22   |   GIPO7-01  ->  12
18  -> GPIO6-17   |   GIPO7-02  ->  11
19  -> GPIO6-16   |   GIPO7-03  ->  13
20  -> GPIO6-26   |   GIPO7-10  ->  06
21  -> GPIO6-27   |   GIPO7-11  ->  09
22  -> GPIO6-24   |   GIPO7-12  ->  32
23  -> GPIO6-25   |   GIPO7-16  ->  08
24  -> GPIO6-12   |   GIPO7-17  ->  07
25  -> GPIO6-13   |   GIPO8-12  ->  37
26  -> GPIO6-30   |   GIPO8-13  ->  36
27  -> GPIO6-31   |   GIPO8-14  ->  35
28  -> GPIO8-18   |   GIPO8-15  ->  34
29  -> GPIO9-31   |   GIPO8-16  ->  39
30  -> GPIO8-23   |   GIPO8-17  ->  38
31  -> GPIO8-22   |   GIPO8-18  ->  28
32  -> GPIO7-12   |   GIPO8-22  ->  31
33  -> GPIO9-07   |   GIPO8-23  ->  30
34  -> GPIO8-15   |   GIPO9-04  ->  02
35  -> GPIO8-14   |   GIPO9-05  ->  03
36  -> GPIO8-13   |   GIPO9-06  ->  04
37  -> GPIO8-12   |   GIPO9-07  ->  33
38  -> GPIO8-17   |   GIPO9-08  ->  05
39  -> GPIO8-16   |   GIPO9-31  ->  29
 
Thank you for the reply, this is helpful. However the issue I suppose lies in the firmware building tool I hope to use, which only allows for A0,A1... F0,F1 style pin addressing. Previously the teensy had corresponding pin labelling, as here : https://www.pjrc.com/teensy/pinout2a.png

essentially i'm looking for the mapping for T4 similar to what is shown here -

https://forum.pjrc.com/threads/1753...-GPIO_PDIR-_PDOR?p=21228&viewfull=1#post21228

I'm not sure, but if you are just looking for the relation of GPIO port/bit and the Teensy pin numbers you can print them out with the code described here: https://github.com/TeensyUser/doc/wiki/GPIO#low-level-access
This is what it prints out for a T4.


Code:
PIN   GPIOn-BITm  |  GPIOn-BITm    PIN
------------------|-------------------
00  -> GPIO6-03   |   GIPO6-02  ->  01
01  -> GPIO6-02   |   GIPO6-03  ->  00
02  -> GPIO9-04   |   GIPO6-12  ->  24
03  -> GPIO9-05   |   GIPO6-13  ->  25
04  -> GPIO9-06   |   GIPO6-16  ->  19
05  -> GPIO9-08   |   GIPO6-17  ->  18
06  -> GPIO7-10   |   GIPO6-18  ->  14
07  -> GPIO7-17   |   GIPO6-19  ->  15
08  -> GPIO7-16   |   GIPO6-22  ->  17
09  -> GPIO7-11   |   GIPO6-23  ->  16
10  -> GPIO7-00   |   GIPO6-24  ->  22
11  -> GPIO7-02   |   GIPO6-25  ->  23
12  -> GPIO7-01   |   GIPO6-26  ->  20
13  -> GPIO7-03   |   GIPO6-27  ->  21
14  -> GPIO6-18   |   GIPO6-30  ->  26
15  -> GPIO6-19   |   GIPO6-31  ->  27
16  -> GPIO6-23   |   GIPO7-00  ->  10
17  -> GPIO6-22   |   GIPO7-01  ->  12
18  -> GPIO6-17   |   GIPO7-02  ->  11
19  -> GPIO6-16   |   GIPO7-03  ->  13
20  -> GPIO6-26   |   GIPO7-10  ->  06
21  -> GPIO6-27   |   GIPO7-11  ->  09
22  -> GPIO6-24   |   GIPO7-12  ->  32
23  -> GPIO6-25   |   GIPO7-16  ->  08
24  -> GPIO6-12   |   GIPO7-17  ->  07
25  -> GPIO6-13   |   GIPO8-12  ->  37
26  -> GPIO6-30   |   GIPO8-13  ->  36
27  -> GPIO6-31   |   GIPO8-14  ->  35
28  -> GPIO8-18   |   GIPO8-15  ->  34
29  -> GPIO9-31   |   GIPO8-16  ->  39
30  -> GPIO8-23   |   GIPO8-17  ->  38
31  -> GPIO8-22   |   GIPO8-18  ->  28
32  -> GPIO7-12   |   GIPO8-22  ->  31
33  -> GPIO9-07   |   GIPO8-23  ->  30
34  -> GPIO8-15   |   GIPO9-04  ->  02
35  -> GPIO8-14   |   GIPO9-05  ->  03
36  -> GPIO8-13   |   GIPO9-06  ->  04
37  -> GPIO8-12   |   GIPO9-07  ->  33
38  -> GPIO8-17   |   GIPO9-08  ->  05
39  -> GPIO8-16   |   GIPO9-31  ->  29
 
Teensy 4 is not an 8-bit AVR, it is a 32-bit ARM. Are you sure your firmware building tool will work for Teensy 4?

Teensy 4 does not have 8-bit ports (PORT A..F bit 0..7), it has 32-bit GPIO ports. The table luni posted is the mapping (if one corrects GIPO to GPIO). The pins on Teensy 4 use GPIO banks 6, 7, 8, and 9. Each bank has 32 bits. So, for example,
Code:
15 -> GPIO6-19 | GPIO6-19 -> 15
means that Teensy 4 pin 15, is bit 19 in GPIO bank 6. (The only thing that is missing is that the manual calls it pin AD_B1_03; and these are shown in the schematic.)
 
You might look at the file arv\cores\teensy4\avr_emulation.h and see if it has what you need/want...

It looks like it has some quick and dirty defines for some of the things like PORTD, PIND, ... From this you should be able to map out which pin does what...
Like it looks like PORTD is mapped to pins 0-7...
 
Status
Not open for further replies.
Back
Top