Skip to content

Commit f63c678

Browse files
committed
GPIO information update
1 parent c5ee461 commit f63c678

File tree

1 file changed

+72
-48
lines changed
  • content/hardware/04.pro/carriers/portenta-hat-carrier/tutorials/user-manual

1 file changed

+72
-48
lines changed

content/hardware/04.pro/carriers/portenta-hat-carrier/tutorials/user-manual/content.md

Lines changed: 72 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2358,7 +2358,7 @@ Within the 40-pin connector, certain GPIOs are specifically related to different
23582358

23592359
For more information regarding the DTB layer, please refer to the [Device Tree Blob (DTB) Overlays](#understanding-device-tree-blobs-dtb-overlays) section.
23602360

2361-
The __Portenta.GPIO__ library, officially supported and compatible with the Portenta Hat Carrier and Portenta X8, can be found [here](https://pypi.org/project/Portenta.GPIO/).
2361+
The __Portenta.GPIO__ library, officially supported and compatible with the Portenta Hat Carrier and Portenta X8, can be found [here](https://github.com/SuMere/portenta-gpio).
23622362

23632363
The GPIO configuration register for the STM32 microcontroller is structured with various fields that control different aspects of GPIO functionality:
23642364

@@ -2460,53 +2460,77 @@ Each pin is identified by its port and a unique port number. The following table
24602460
#### GPIO Global Map
24612461
<br></br>
24622462

2463-
For ease of access to all available GPIOs within the Portenta family board and Portenta Hat Carrier, the following table enlists every designations that can be used to access directly each individual GPIO.
2464-
2465-
The __Port Number__ defines the number designation of the corresponding connector. The __Function__ tells the role of the designated pin number. For example, the pin number `7` of the `40-Pin connector` is characterized as __`PWM0`__. Thus, on the Portenta X8, it can be handled by using `183` within the ADB shell, `7` within the Python® script, or `PC_7` within the Arduino IDE. The GPIOs mentioned in the following are controllable, while each pin may have its characteristical function.
2466-
2467-
| **Connector** | **Pin Number** | **Function** | **Portenta X8 (Linux/Arduino)** | **Portenta H7** | **Portenta C33** |
2468-
|:------------------:|:--------------:|:-----------------------------:|:-------------------------------:|:------------------:|:----------------:|
2469-
| _40-Pin Connector_ | | | | | |
2470-
| | 7 | PWM0 | 183 / PC_7 (39) | PA_8 (8) | 0 |
2471-
| | 8 | SERIAL3 TX | 157 | PL_8 (152) | 53 |
2472-
| | 10 | SERIAL3 RX | 156 | PJ_9 (153) | 54 |
2473-
| | 11 | GPIO2 | 162 / PF_3 (83) | PD_4 (52) | 29 |
2474-
| | 12 | I2S CK | 87 | PD_3 (51) | 63 |
2475-
| | 13 | GPIO6 | 166 / PE_11 (75) | PG_10 (106) | 33 |
2476-
| | 15 | SAI D0 **(OUTPUT ONLY)** | 108 | PI_6 (134) | 80 |
2477-
| | 16 | SAI CK **(OUTPUT ONLY)** | 107 | PI_5 (133) | 78 |
2478-
| | 18 | SAI FS **(OUTPUT ONLY)** | 106 | PI_7 (135) | 79 |
2479-
| | 19 | SPI1 COPI **(DTB Activated)** | 139 | PC_3 (35) | 46 |
2480-
| | 21 | SPI1 CIPO **(DTB Activated)** | 140 | PC_2 (34) | 45 |
2481-
| | 22 | PWM1 | 184 / PA_9 (9) | PC_6 (38) | 1 |
2482-
| | 23 | SPI1 SCK **(DTB Activated)** | 138 | PI_0 (128) | 47 |
2483-
| | 24 | SPI1 CE **(DTB Activated)** | 141 | PI_1 (129) | 48 |
2484-
| | 26 | PWM2 | 185 / PA_10 (10) | PC_7 (39) | 2 |
2485-
| | 29 | SERIAL1 RX | 127 | PA_10 (10) | 13 |
2486-
| | 31 | PWM3 | 186 / PB_10 (26) | PG_7 (103) | 3 |
2487-
| | 32 | SERIAL1 TX | 128 | PA_9 (9) | 14 |
2488-
| | 33 | PWM4 | 187 / PA_11 (11) | PJ_11 (155) | 4 |
2489-
| | 35 | I2S WS | 128* | PB_9 (25) | 64 |
2490-
| | 36 | PWM5 | 188 / PD_15 (63) | PK_1 (161) | 5 |
2491-
| | 37 | PWM6 | 189 / PA_8 (8) | PH_15 (127) | 6 |
2492-
| | 38 | I2S SDI | 85 | PI_2 (130) | 65 |
2493-
| | 40 | I2S SDO | 88 | PI_3 (131) | 66 |
2494-
| _16-Pin Connector_ | | | | | |
2495-
| | 1 | A0 | 167 / A0 | PA_0_C (2048) / A0 | 15 |
2496-
| | 2 | A1 | 168 / A1 | PA_1_C (2049) / A1 | 16 |
2497-
| | 3 | A2 | 169 / A2 | PC_2_C (2082) / A2 | 17 |
2498-
| | 4 | A3 | 170 / A3 | PC_3_C (2083) / A3 | 18 |
2499-
| | 5 | A4 | 171 / A4 | PC_2 (34) / A4 | 19 |
2500-
| | 6 | A5 | 172 / A5 | PC_3 (35) / A5 | 20 |
2501-
| | 7 | A6 | 173 / A6 | PA_4 (4) / A6 | 21 |
2502-
| | 8 | A7 | 174 / A7 | PA_6 (6) / A7 | 22 |
2503-
| | 9 | PWM7 | 190 / PC_6 (38) | PJ_7 (151) | 7 |
2504-
| | 10 | PWM8 | 191 / PA_12 (12) | PJ_10 (154) | 8 |
2505-
| | 12 | PWM4 | 187* / PA_11 (11) | PJ_11 (155) | 4 |
2506-
| | 14 | SERIAL2 TX | 155 | PG_14 (110) | 49 |
2507-
| | 16 | SERIAL2 RX | 154 | PG_9 (105) | 50 |
2508-
2509-
In Linux, pins can be controlled using the system's functions via the ADB shell or via the official Python® library.
2463+
For easy access to the available GPIOs on the Portenta Hat Carrier, the table below lists each designation that allows direct access to each GPIO when using a board from the Portenta family.
2464+
2465+
The __Connector__ column shows the position of each GPIO pin within the Portenta Hat Carrier. The [carrier topology](#carrier-topology) section can help in identifying the connectors' locations. The __Pin Number__ column identifies the position of each GPIO pin on its respective connector. The __Function__ column describes the role of each pin. For instance, pin `7` on the _40-pin connector_ is characterized as `PWM0`. The access methods for each Portenta board are as follows:
2466+
2467+
- _Portenta X8_: Accessible using `183` in the ADB shell and `4` in Python® scripts using the [official __Portenta.GPIO__ library](https://github.com/SuMere/portenta-gpio) in BCM mode or `PC_7` in the Arduino IDE.
2468+
- _Portenta H7 / H7 Lite / H7 Lite Connected_: Controllable by calling `PA_8` in the Arduino IDE.
2469+
- _Portenta C33_: Accessible using `0` in the Arduino IDE
2470+
2471+
This logic applies to all listed GPIOs. The GPIOs in the table are controllable, and each pin may have its specific function.
2472+
2473+
| **Connector** | **Pin number** | **Function** | **Portenta X8<br>(Linux / Python® [BCM Mode])** | **Portenta X8<br>(Arduino*)** | **Portenta H7** | **Portenta C33** |
2474+
|:-------------------------:|:--------------:|:---------------------------:|:-----------------------------------------------:|:-----------------------------:|:---------------:|:----------------:|
2475+
| _40-Pin Connector (J5)_ | | | | | | |
2476+
| | 3 | I2C2 SDA | 149 / 2 | | PH_12 | 39 |
2477+
| | 5 | I2C2 SCL | 148 / 3 | | PH_11 | 40 |
2478+
| | 7 | PWM0 | 183 / 4 | PC_7 | PA_8 | 0 |
2479+
| | 8 | SERIAL3 TX | 157 / 14 | | PL_8 | 53 |
2480+
| | 10 | SERIAL3 RX | 156 / 15 | | PJ_9 | 54 |
2481+
| | 11 | GPIO2 | 162 / 17 | PF_3 | PD_4 | 29 |
2482+
| | 12 | I2S CK | 87 / 18 | | PD_3 | 63 |
2483+
| | 13 | GPIO6 | 166 / 27 | PE_11 | PG_10 | 33 |
2484+
| | 15 | SAI D0 _(OUTPUT ONLY)_ | 108 / 22 | | PI_6 | 80 |
2485+
| | 16 | SAI CK _(OUTPUT ONLY)_ | 107 / 23 | | PI_5 | 78 |
2486+
| | 18 | SAI FS _(OUTPUT ONLY)_ | 106 / 24 | | PI_7 | 79 |
2487+
| | 19 | SPI1 COPI _(DTB Activated)_ | 135 / 10 | | PC_3 | 46 |
2488+
| | 21 | SPI1 CIPO _(DTB Activated)_ | 136 / 9 | | PC_2 | 45 |
2489+
| | 22 | PWM1 | 184 / 25 | PA_9 | PC_6 | 1 |
2490+
| | 23 | SPI1 SCK _(DTB Activated)_ | 134 / 11 | | PI_0 | 47 |
2491+
| | 24 | SPI1 CE _(DTB Activated)_ | 137 / 8 | | PI_1 | 48 |
2492+
| | 26 | PWM2 | 185 / 7 | PA_10 | PC_7 | 2 |
2493+
| | 29 | SERIAL1 RX | 127 / 5 | | PA_10 | 13 |
2494+
| | 31 | PWM3 | 186 / 6 | PB_10 | PG_7 | 3 |
2495+
| | 32 | SERIAL1 TX | 128 / 12 | | PA_9 | 14 |
2496+
| | 33 | PWM4 | 187 / 13 | PA_11 | PJ_11 | 4 |
2497+
| | 35 | I2S WS | 86 / 19 | | PB_9 | 64 |
2498+
| | 36 | PWM5 | 188 / 16 | PD_15 | PK_1 | 5 |
2499+
| | 37 | PWM6 | 189 / 26 | PA_8 | PH_15 | 6 |
2500+
| | 38 | I2S SDI | 85 / 20 | | PI_2 | 65 |
2501+
| | 40 | I2S SDO | 88 / 21 | | PI_3 | 66 |
2502+
| _16-Pin Connector (J6)_ | | | | | | |
2503+
| | 1 | Analog 0 - A0 | 167 | A0 | PA_0C / A0 | 15 |
2504+
| | 2 | Analog 1 - A1 | 168 | A1 | PA_1C / A1 | 16 |
2505+
| | 3 | Analog 2 - A2 | 169 | A2 | PC_2C / A2 | 17 |
2506+
| | 4 | Analog 3 - A3 | 170 | A3 | PC_3C / A3 | 18 |
2507+
| | 5 | Analog 4 - A4 | 171 | A4 | PC_2 / A4 | 19 |
2508+
| | 6 | Analog 5 - A5 | 172 | A5 | PC_3 / A5 | 20 |
2509+
| | 7 | Analog 6 - A6 | 173 | A6 | PA_4 / A6 | 21 |
2510+
| | 8 | Analog 7 - A7 | 174 | A7 | PA_6 / A7 | 22 |
2511+
| | 9 | PWM7 | 190 | PC_6 | PJ_7 | 7 |
2512+
| | 10 | PWM8 | 191 | PA_12 | PJ_10 | 8 |
2513+
| | 12 | PWM4 | 187 | PA_11 | PJ_11 | 4 |
2514+
| | 14 | SERIAL2 TX | 155 | | PG_14 | 49 |
2515+
| | 16 | SERIAL2 RX | 154 | | PG_9 | 50 |
2516+
| _PWM Fan Connector (J11)_ | | | | | | |
2517+
| | 1 | PWM9 | 192 | PC_8 | PH_6 | 25 |
2518+
| _On-Board Element_ | | | | | | |
2519+
| | - | GPIO3 (User LED) | 163 | PF_4 | PD_5 | 30 |
2520+
2521+
To effectively understand and use the GPIO (General Purpose Input/Output) designations of the table above, which are specific to combinations of the Portenta family board and the Portenta Hat Carrier, it is important to consider the following details:
2522+
2523+
- The __Linux__ GPIO designations for the Portenta X8 are applicable in the ADB shell. These designations can also be used in Python® scripts by constructing a path to the GPIO pin in the system's file system.
2524+
2525+
For more information, please refer to the [Hello World Using Linux](#hello-world-using-linux) section in this present user manual.
2526+
2527+
- The __Python®__ GPIO designations for the Portenta X8 are available through the [official __Portenta.GPIO__ library](https://github.com/SuMere/portenta-gpio), using BroadCom SoC GPIO numbers in BCM mode. This applies to the 40-pin Connector (J5) pins compatible with Raspberry Pi® HATs on the Portenta Hat Carrier.
2528+
2529+
To learn about the practical implementation of these designations, please refer to the `gpio.py` example in the [GPIO Pins](#gpio-pins) section of this user manual.
2530+
2531+
- The __Arduino__ GPIO designations for the Portenta X8 are applicable if desired in the Arduino IDE. The GPIO definitions for the Portenta H7, including its H7 Lite and H7 Lite Connected variants and the C33, are directly usable in the Arduino IDE.
2532+
2533+
For more information, refer to this user manual's [Hello World Using Arduino](#hello-world-using-arduino) section.
25102534

25112535
#### Using Linux With Shell
25122536
<br></br>

0 commit comments

Comments
 (0)