Closed hpssjellis closed 2 years ago
Hi @hpssjellis .
the problem here, IMO, is the "single source of truth" principle.
In fact, since the Portenta has no pin number printed on the silkscreen, also "MKR" pin numbers are arbitrary.
If we take the schematics as source of truth your proposal makes a lot of sense but the HD page also reports pin names (Px_y) right now, so when you search the schematics to find where is J1-34
you would also find its "real name".
Still not sure which would be the best way to tackle this. Any proposal is appreciated btw :slightly_smiling_face:
Thanks for the reply @facchinm it does seem a bit confusing and then when we include OpenMV and the Vision Shield using Python it gets even more confusing. I made an Excel chart and CSV output here to try to understand it but I think I need more information, perhaps the "True Names"
@facchinm Quick, possibly silly question. The high density connector pins are hardwired aren't they? There isn't a software method to change the pins configuration is there?
@hpssjellis yes, they are hardwired to the corresponding ball of the processor (Pxy) or the the output pins of some ICs (in case of Ethernet, USB HS and DSI)
I would send a PR of the J1_0 to J2_80 #defines needed if I could get some clear data. This page looks useful for defining the PA_1 to PK_7 pins patches.
I presently have the Portenta Breakout board and it is possible a few of the pins are not accurate defined, such as GPIO 0 - 6 and PWM 3, 7, 8, 9, a spreadsheet of checked pins would be very useful. I will try to make it as the full pinout diagrams are fairly clear and list both types of pins. The issues I am having with the GPIO's and PWM must be something else.
.
.
I am putting my spreadsheet in CSV format here
https://github.com/hpssjellis/my-examples-for-the-arduino-portentaH7/blob/master/PINS/Portenta-pins-working-copy.csv
While testing the PWM and GPIO pins which do not work with the new information above. I did find something interesting.
Interesting: PWM 1 works fine using pin 1 (Digital 1 or D1) as the pin, but if I use PA_5 which is the same PIN and has the same saved number "1" my PWM code works, but I lose the USB connection.
This PR seems relevant https://github.com/arduino/ArduinoCore-mbed/pull/163
I sent in this PR as a starting point for updating the Digital Pin defines to match how the Nano 33 BLE does Digital pins. This is for both cores of the PortentaH7 Match Portenta to Nano 33 BLE Digital Pins format 165
I am working on defines for the J1 and J2 connectors.
Still curious if there is any plans to include pin names like PWM_1, or J1_02 as they are on the Portenta pin out diagram at the Arduino Store here --> documents
@hpssjellis the PWM attached to HRTIm now work (in master
) due to https://github.com/arduino/ArduinoCore-mbed/commit/2e8c0ecc2445b56133d05288aaa673f92c54ae39.
We also published the library for the Portenta Breakout Carrier that can be used "standalone" to reference the pins by their "logical" names https://github.com/arduino-libraries/Arduino_PortentaBreakout
Without clear pin numbering a lot of arduino library doesn't work, they cannot use it the pins "logical" names, only the uint8_t format.
@wolfmanus
Without clear pin numbering a lot of arduino library doesn't work, they cannot use it the pins "logical" names, only the uint8_t format.
I tried to make a conversion list of logical pin names to uint8_t pin names and also HD connector J1-0 to J2-80 pin names but it was too confusing. Does anyone have a list of all three formats, since that would be very useful?
Hi @wolfmanus and @hpssjellis , there's a way to obtain the "uint8_t" pin number from the "logical" pin name but it's a bit hidden inside the core (for a purpose, I'll explain it later).
The function is PinNameToIndex()
and you can expose it by including #include "pinDefinitions.h"
The reason why it's hidden is that it brings in the whole mbed environment, making the compilation much slower (unbearably slow on Windows)
Hi @hpssjellis, Thank you and respect for your work. Hi @facchinm, Thanks for the new info, i will try it soon.
I tried to use from @hpssjellis 's table two GPIO pin arduino number, but it worked uncertainly (the code works well with MKR ZERO). The slow translation it appeared me too on Windows, but I have a strong machine.
@wolfmanus Thanks for the kind words. The pin names and interactions are getting more important as I build larger machine learning models. Presently have a 98% M7 core full model, with servos and DC motors and LoRa and getting very strange results when using pins D0 through D6. After pinNames I will try to figure out the multiple uses of the Open Portenta Pins.
Thanks @facchinm as always your suggestions are great
"The function is PinNameToIndex() and you can expose it by including #include "pinDefinitions.h"
I don't supposse there is the more useful indexToPinName
or indexToHDPinName
that way we could irrirate through it and get all the information needed.
@hpssjellis there is :wink: digitalPinToPinName()
in fact does what you need, but of course the return is not "stringified" -> if you call
digitalPinToPinName(0)
on a Portenta you'll get 127, which is PH_15
-> ( 16 * ( 'H' - 'A' ) + 15 )
So you can get the string version via something like:
String pinName = "P" + String(char('A' + (digitalPinToPinName(0) / 16))) + String(digitalPinToPinName(0) % 16);
So awesome @facchinm:
#include "pinDefinitions.h"
String myPinNameFunction(int thePin){
return "P" + String(char('A' + (digitalPinToPinName(thePin) / 16))) +"_" + String(digitalPinToPinName(thePin) % 16);
}
void setup() {
Serial.begin(115200);
while (!Serial) {} // wait for Serial
// This tests each pinName converts to pin index
// Serial.println("Pin PH_15: " + String(PinNameToIndex(PH_15)) );
// This shows all index's as pin names
for (int myLoop=0; myLoop<=195; myLoop++){
String myName = myPinNameFunction(myLoop);
PinName myIn = digitalPinToPinName(myLoop);
int myIndex = PinNameToIndex(myIn);
Serial.println("Pin Index " + String(myLoop) + ": " + myName + ", Back to pin index: " + String(myIndex) );
}
Serial.println("-----------------------------");
}
void loop() {
}
outputs:
Pin Index 0: PH_15, Back to pin index: 0
Pin Index 1: PK_1, Back to pin index: 1
Pin Index 2: PJ_11, Back to pin index: 2
Pin Index 3: PG_7, Back to pin index: 3
Pin Index 4: PC_7, Back to pin index: 4
Pin Index 5: PC_6, Back to pin index: 5
Pin Index 6: PA_8, Back to pin index: 6
Pin Index 7: PI_0, Back to pin index: 7
Pin Index 8: PC_3, Back to pin index: 8
Pin Index 9: PI_1, Back to pin index: 9
Pin Index 10: PC_2, Back to pin index: 10
Pin Index 11: PH_8, Back to pin index: 11
Pin Index 12: PH_7, Back to pin index: 12
Pin Index 13: PA_10, Back to pin index: 13
Pin Index 14: PA_9, Back to pin index: 14
Pin Index 15: P1_0, Back to pin index: 15
Pin Index 16: P1_1, Back to pin index: 16
Pin Index 17: P3_2, Back to pin index: 17
Pin Index 18: P3_3, Back to pin index: 18
Pin Index 19: PS_2, Back to pin index: 19
Pin Index 20: PS_3, Back to pin index: 20
Pin Index 21: PA_4, Back to pin index: 21
Pin Index 22: PA_6, Back to pin index: 22
Pin Index 23: PK_5, Back to pin index: 23
Pin Index 24: PK_6, Back to pin index: 24
Pin Index 25: PK_7, Back to pin index: 25
Pin Index 26: PA_0, Back to pin index: 26
Pin Index 27: PA_1, Back to pin index: 27
Pin Index 28: PA_2, Back to pin index: 28
Pin Index 29: PA_3, Back to pin index: 29
Pin Index 30: PA_4, Back to pin index: 21
Pin Index 31: PA_5, Back to pin index: 31
Pin Index 32: PA_6, Back to pin index: 22
Pin Index 33: PA_7, Back to pin index: 33
Pin Index 34: PA_8, Back to pin index: 6
Pin Index 35: PA_9, Back to pin index: 14
Pin Index 36: PA_10, Back to pin index: 13
Pin Index 37: PA_11, Back to pin index: 37
Pin Index 38: PA_12, Back to pin index: 38
Pin Index 39: PA_13, Back to pin index: 39
Pin Index 40: PA_14, Back to pin index: 40
Pin Index 41: PA_15, Back to pin index: 41
Pin Index 42: PB_0, Back to pin index: 42
Pin Index 43: PB_1, Back to pin index: 43
Pin Index 44: PB_2, Back to pin index: 44
Pin Index 45: PB_3, Back to pin index: 45
Pin Index 46: PB_4, Back to pin index: 46
Pin Index 47: PB_5, Back to pin index: 47
Pin Index 48: PB_6, Back to pin index: 48
Pin Index 49: PB_7, Back to pin index: 49
Pin Index 50: PB_8, Back to pin index: 50
Pin Index 51: PB_9, Back to pin index: 51
Pin Index 52: PB_10, Back to pin index: 52
Pin Index 53: PB_11, Back to pin index: 53
Pin Index 54: PB_12, Back to pin index: 54
Pin Index 55: PB_13, Back to pin index: 55
Pin Index 56: PB_14, Back to pin index: 56
Pin Index 57: PB_15, Back to pin index: 57
Pin Index 58: PC_0, Back to pin index: 58
Pin Index 59: PC_1, Back to pin index: 59
Pin Index 60: PC_2, Back to pin index: 10
Pin Index 61: PC_3, Back to pin index: 8
Pin Index 62: PC_4, Back to pin index: 62
Pin Index 63: PC_5, Back to pin index: 63
Pin Index 64: PC_6, Back to pin index: 5
Pin Index 65: PC_7, Back to pin index: 4
Pin Index 66: PC_8, Back to pin index: 66
Pin Index 67: PC_9, Back to pin index: 67
Pin Index 68: PC_10, Back to pin index: 68
Pin Index 69: PC_11, Back to pin index: 69
Pin Index 70: PC_12, Back to pin index: 70
Pin Index 71: PC_13, Back to pin index: 71
Pin Index 72: PC_14, Back to pin index: 72
Pin Index 73: PC_15, Back to pin index: 73
Pin Index 74: PD_0, Back to pin index: 74
Pin Index 75: PD_1, Back to pin index: 75
Pin Index 76: PD_2, Back to pin index: 76
Pin Index 77: PD_3, Back to pin index: 77
Pin Index 78: PD_4, Back to pin index: 78
Pin Index 79: PD_5, Back to pin index: 79
Pin Index 80: PD_6, Back to pin index: 80
Pin Index 81: PD_7, Back to pin index: 81
Pin Index 82: PD_8, Back to pin index: 82
Pin Index 83: PD_9, Back to pin index: 83
Pin Index 84: PD_10, Back to pin index: 84
Pin Index 85: PD_11, Back to pin index: 85
Pin Index 86: PD_12, Back to pin index: 86
Pin Index 87: PD_13, Back to pin index: 87
Pin Index 88: PD_14, Back to pin index: 88
Pin Index 89: PD_15, Back to pin index: 89
Pin Index 90: PE_0, Back to pin index: 90
Pin Index 91: PE_1, Back to pin index: 91
Pin Index 92: PE_2, Back to pin index: 92
Pin Index 93: PE_3, Back to pin index: 93
Pin Index 94: PE_4, Back to pin index: 94
Pin Index 95: PE_5, Back to pin index: 95
Pin Index 96: PE_6, Back to pin index: 96
Pin Index 97: PE_7, Back to pin index: 97
Pin Index 98: PE_8, Back to pin index: 98
Pin Index 99: PE_9, Back to pin index: 99
Pin Index 100: PE_10, Back to pin index: 100
Pin Index 101: PE_11, Back to pin index: 101
Pin Index 102: PE_12, Back to pin index: 102
Pin Index 103: PE_13, Back to pin index: 103
Pin Index 104: PE_14, Back to pin index: 104
Pin Index 105: PE_15, Back to pin index: 105
Pin Index 106: PF_0, Back to pin index: 106
Pin Index 107: PF_1, Back to pin index: 107
Pin Index 108: PF_2, Back to pin index: 108
Pin Index 109: PF_3, Back to pin index: 109
Pin Index 110: PF_4, Back to pin index: 110
Pin Index 111: PF_5, Back to pin index: 111
Pin Index 112: PF_6, Back to pin index: 112
Pin Index 113: PF_7, Back to pin index: 113
Pin Index 114: PF_8, Back to pin index: 114
Pin Index 115: PF_9, Back to pin index: 115
Pin Index 116: PF_10, Back to pin index: 116
Pin Index 117: PF_11, Back to pin index: 117
Pin Index 118: PF_12, Back to pin index: 118
Pin Index 119: PF_13, Back to pin index: 119
Pin Index 120: PF_14, Back to pin index: 120
Pin Index 121: PF_15, Back to pin index: 121
Pin Index 122: PG_0, Back to pin index: 122
Pin Index 123: PG_1, Back to pin index: 123
Pin Index 124: PG_2, Back to pin index: 124
Pin Index 125: PG_3, Back to pin index: 125
Pin Index 126: PG_4, Back to pin index: 126
Pin Index 127: PG_5, Back to pin index: 127
Pin Index 128: PG_6, Back to pin index: 128
Pin Index 129: PG_7, Back to pin index: 3
Pin Index 130: PG_8, Back to pin index: 130
Pin Index 131: PG_9, Back to pin index: 131
Pin Index 132: PG_10, Back to pin index: 132
Pin Index 133: PG_11, Back to pin index: 133
Pin Index 134: PG_12, Back to pin index: 134
Pin Index 135: PG_13, Back to pin index: 135
Pin Index 136: PG_14, Back to pin index: 136
Pin Index 137: PG_15, Back to pin index: 137
Pin Index 138: PH_0, Back to pin index: 138
Pin Index 139: PH_1, Back to pin index: 139
Pin Index 140: PH_2, Back to pin index: 140
Pin Index 141: PH_3, Back to pin index: 141
Pin Index 142: PH_4, Back to pin index: 142
Pin Index 143: PH_5, Back to pin index: 143
Pin Index 144: PH_6, Back to pin index: 144
Pin Index 145: PH_7, Back to pin index: 12
Pin Index 146: PH_8, Back to pin index: 11
Pin Index 147: PH_9, Back to pin index: 147
Pin Index 148: PH_10, Back to pin index: 148
Pin Index 149: PH_11, Back to pin index: 149
Pin Index 150: PH_12, Back to pin index: 150
Pin Index 151: PH_13, Back to pin index: 151
Pin Index 152: PH_14, Back to pin index: 152
Pin Index 153: PH_15, Back to pin index: 0
Pin Index 154: PI_0, Back to pin index: 7
Pin Index 155: PI_1, Back to pin index: 9
Pin Index 156: PI_2, Back to pin index: 156
Pin Index 157: PI_3, Back to pin index: 157
Pin Index 158: PI_4, Back to pin index: 158
Pin Index 159: PI_5, Back to pin index: 159
Pin Index 160: PI_6, Back to pin index: 160
Pin Index 161: PI_7, Back to pin index: 161
Pin Index 162: PI_8, Back to pin index: 162
Pin Index 163: PI_9, Back to pin index: 163
Pin Index 164: PI_10, Back to pin index: 164
Pin Index 165: PI_11, Back to pin index: 165
Pin Index 166: PI_12, Back to pin index: 166
Pin Index 167: PI_13, Back to pin index: 167
Pin Index 168: PI_14, Back to pin index: 168
Pin Index 169: PI_15, Back to pin index: 169
Pin Index 170: PJ_0, Back to pin index: 170
Pin Index 171: PJ_1, Back to pin index: 171
Pin Index 172: PJ_2, Back to pin index: 172
Pin Index 173: PJ_3, Back to pin index: 173
Pin Index 174: PJ_4, Back to pin index: 174
Pin Index 175: PJ_5, Back to pin index: 175
Pin Index 176: PJ_6, Back to pin index: 176
Pin Index 177: PJ_7, Back to pin index: 177
Pin Index 178: PJ_8, Back to pin index: 178
Pin Index 179: PJ_9, Back to pin index: 179
Pin Index 180: PJ_10, Back to pin index: 180
Pin Index 181: PJ_11, Back to pin index: 2
Pin Index 182: PJ_12, Back to pin index: 182
Pin Index 183: PJ_13, Back to pin index: 183
Pin Index 184: PJ_14, Back to pin index: 184
Pin Index 185: PJ_15, Back to pin index: 185
Pin Index 186: PK_0, Back to pin index: 186
Pin Index 187: PK_1, Back to pin index: 1
Pin Index 188: PK_2, Back to pin index: 188
Pin Index 189: PK_3, Back to pin index: 189
Pin Index 190: PK_4, Back to pin index: 190
Pin Index 191: PK_5, Back to pin index: 23
Pin Index 192: PK_6, Back to pin index: 24
Pin Index 193: PK_7, Back to pin index: 25
Pin Index 194: PA_-1, Back to pin index: 255
Pin Index 195: PA_-1, Back to pin index: 255
-----------------------------
Check out the pins that correspond back to an earlier index. Very interesting!
@wolfmanus did you see the above list. Those pin names do not line up with any of the pin names I have collected from the data sheets. Do you understand any of it? I think the list above is the most important, my list below is probably totally wrong. I will make another one in the same folder.
Here is my old list of what I thought was the pin names https://github.com/hpssjellis/my-examples-for-the-arduino-portentaH7/blob/master/PINS/Portenta-pins-working-copy.csv
Most of my stuff is taken from the datasheets https://content.arduino.cc/assets/Pinout-PortentaH7_latest.pdf
Hi Jeremy,
the pins that don't make sense are either alternative pinmuxing or the special purpose _C
pins
To get a better list, a sample code would be like
String myPinNameFunction(int thePin){
int realPin = digitalPinToPinName(thePin) % ALT0;
if (realPin == NC) {
return "Not a pin";
}
String extra = "";
switch (digitalPinToPinName(thePin) & DUAL_PAD) {
case 0:
break;
case ALT0:
extra = "ALT0";
break;
case ALT1:
extra = "ALT1";
break;
case ALT2:
extra = "ALT2";
break;
case DUAL_PAD:
extra = "_C";
break;
}
return "P" + String(char('A' + (realPin / 16))) +"_" + String(realPin % 16) + extra;
}
Thanks @facchinm That prints a bit better. Is ALT1 and ALT2 for different boards. For the Portenta only C and ALT0 show up?
Pin Index 0: PH_15, Back to pin index: 0
Pin Index 1: PK_1, Back to pin index: 1
Pin Index 2: PJ_11, Back to pin index: 2
Pin Index 3: PG_7, Back to pin index: 3
Pin Index 4: PC_7, Back to pin index: 4
Pin Index 5: PC_6, Back to pin index: 5
Pin Index 6: PA_8, Back to pin index: 6
Pin Index 7: PI_0, Back to pin index: 7
Pin Index 8: PC_3, Back to pin index: 8
Pin Index 9: PI_1, Back to pin index: 9
Pin Index 10: PC_2, Back to pin index: 10
Pin Index 11: PH_8, Back to pin index: 11
Pin Index 12: PH_7, Back to pin index: 12
Pin Index 13: PA_10, Back to pin index: 13
Pin Index 14: PA_9, Back to pin index: 14
Pin Index 15: PA_0_C, Back to pin index: 15
Pin Index 16: PA_1_C, Back to pin index: 16
Pin Index 17: PC_2_C, Back to pin index: 17
Pin Index 18: PC_3_C, Back to pin index: 18
Pin Index 19: PC_2ALT0, Back to pin index: 19
Pin Index 20: PC_3ALT0, Back to pin index: 20
Pin Index 21: PA_4, Back to pin index: 21
Pin Index 22: PA_6, Back to pin index: 22
Pin Index 23: PK_5, Back to pin index: 23
Pin Index 24: PK_6, Back to pin index: 24
Pin Index 25: PK_7, Back to pin index: 25
Pin Index 26: PA_0, Back to pin index: 26
Pin Index 27: PA_1, Back to pin index: 27
Pin Index 28: PA_2, Back to pin index: 28
Pin Index 29: PA_3, Back to pin index: 29
Pin Index 30: PA_4, Back to pin index: 21
Pin Index 31: PA_5, Back to pin index: 31
Pin Index 32: PA_6, Back to pin index: 22
Pin Index 33: PA_7, Back to pin index: 33
Pin Index 34: PA_8, Back to pin index: 6
Pin Index 35: PA_9, Back to pin index: 14
Pin Index 36: PA_10, Back to pin index: 13
Pin Index 37: PA_11, Back to pin index: 37
Pin Index 38: PA_12, Back to pin index: 38
Pin Index 39: PA_13, Back to pin index: 39
Pin Index 40: PA_14, Back to pin index: 40
Pin Index 41: PA_15, Back to pin index: 41
Pin Index 42: PB_0, Back to pin index: 42
Pin Index 43: PB_1, Back to pin index: 43
Pin Index 44: PB_2, Back to pin index: 44
Pin Index 45: PB_3, Back to pin index: 45
Pin Index 46: PB_4, Back to pin index: 46
Pin Index 47: PB_5, Back to pin index: 47
Pin Index 48: PB_6, Back to pin index: 48
Pin Index 49: PB_7, Back to pin index: 49
Pin Index 50: PB_8, Back to pin index: 50
Pin Index 51: PB_9, Back to pin index: 51
Pin Index 52: PB_10, Back to pin index: 52
Pin Index 53: PB_11, Back to pin index: 53
Pin Index 54: PB_12, Back to pin index: 54
Pin Index 55: PB_13, Back to pin index: 55
Pin Index 56: PB_14, Back to pin index: 56
Pin Index 57: PB_15, Back to pin index: 57
Pin Index 58: PC_0, Back to pin index: 58
Pin Index 59: PC_1, Back to pin index: 59
Pin Index 60: PC_2, Back to pin index: 10
Pin Index 61: PC_3, Back to pin index: 8
Pin Index 62: PC_4, Back to pin index: 62
Pin Index 63: PC_5, Back to pin index: 63
Pin Index 64: PC_6, Back to pin index: 5
Pin Index 65: PC_7, Back to pin index: 4
Pin Index 66: PC_8, Back to pin index: 66
Pin Index 67: PC_9, Back to pin index: 67
Pin Index 68: PC_10, Back to pin index: 68
Pin Index 69: PC_11, Back to pin index: 69
Pin Index 70: PC_12, Back to pin index: 70
Pin Index 71: PC_13, Back to pin index: 71
Pin Index 72: PC_14, Back to pin index: 72
Pin Index 73: PC_15, Back to pin index: 73
Pin Index 74: PD_0, Back to pin index: 74
Pin Index 75: PD_1, Back to pin index: 75
Pin Index 76: PD_2, Back to pin index: 76
Pin Index 77: PD_3, Back to pin index: 77
Pin Index 78: PD_4, Back to pin index: 78
Pin Index 79: PD_5, Back to pin index: 79
Pin Index 80: PD_6, Back to pin index: 80
Pin Index 81: PD_7, Back to pin index: 81
Pin Index 82: PD_8, Back to pin index: 82
Pin Index 83: PD_9, Back to pin index: 83
Pin Index 84: PD_10, Back to pin index: 84
Pin Index 85: PD_11, Back to pin index: 85
Pin Index 86: PD_12, Back to pin index: 86
Pin Index 87: PD_13, Back to pin index: 87
Pin Index 88: PD_14, Back to pin index: 88
Pin Index 89: PD_15, Back to pin index: 89
Pin Index 90: PE_0, Back to pin index: 90
Pin Index 91: PE_1, Back to pin index: 91
Pin Index 92: PE_2, Back to pin index: 92
Pin Index 93: PE_3, Back to pin index: 93
Pin Index 94: PE_4, Back to pin index: 94
Pin Index 95: PE_5, Back to pin index: 95
Pin Index 96: PE_6, Back to pin index: 96
Pin Index 97: PE_7, Back to pin index: 97
Pin Index 98: PE_8, Back to pin index: 98
Pin Index 99: PE_9, Back to pin index: 99
Pin Index 100: PE_10, Back to pin index: 100
Pin Index 101: PE_11, Back to pin index: 101
Pin Index 102: PE_12, Back to pin index: 102
Pin Index 103: PE_13, Back to pin index: 103
Pin Index 104: PE_14, Back to pin index: 104
Pin Index 105: PE_15, Back to pin index: 105
Pin Index 106: PF_0, Back to pin index: 106
Pin Index 107: PF_1, Back to pin index: 107
Pin Index 108: PF_2, Back to pin index: 108
Pin Index 109: PF_3, Back to pin index: 109
Pin Index 110: PF_4, Back to pin index: 110
Pin Index 111: PF_5, Back to pin index: 111
Pin Index 112: PF_6, Back to pin index: 112
Pin Index 113: PF_7, Back to pin index: 113
Pin Index 114: PF_8, Back to pin index: 114
Pin Index 115: PF_9, Back to pin index: 115
Pin Index 116: PF_10, Back to pin index: 116
Pin Index 117: PF_11, Back to pin index: 117
Pin Index 118: PF_12, Back to pin index: 118
Pin Index 119: PF_13, Back to pin index: 119
Pin Index 120: PF_14, Back to pin index: 120
Pin Index 121: PF_15, Back to pin index: 121
Pin Index 122: PG_0, Back to pin index: 122
Pin Index 123: PG_1, Back to pin index: 123
Pin Index 124: PG_2, Back to pin index: 124
Pin Index 125: PG_3, Back to pin index: 125
Pin Index 126: PG_4, Back to pin index: 126
Pin Index 127: PG_5, Back to pin index: 127
Pin Index 128: PG_6, Back to pin index: 128
Pin Index 129: PG_7, Back to pin index: 3
Pin Index 130: PG_8, Back to pin index: 130
Pin Index 131: PG_9, Back to pin index: 131
Pin Index 132: PG_10, Back to pin index: 132
Pin Index 133: PG_11, Back to pin index: 133
Pin Index 134: PG_12, Back to pin index: 134
Pin Index 135: PG_13, Back to pin index: 135
Pin Index 136: PG_14, Back to pin index: 136
Pin Index 137: PG_15, Back to pin index: 137
Pin Index 138: PH_0, Back to pin index: 138
Pin Index 139: PH_1, Back to pin index: 139
Pin Index 140: PH_2, Back to pin index: 140
Pin Index 141: PH_3, Back to pin index: 141
Pin Index 142: PH_4, Back to pin index: 142
Pin Index 143: PH_5, Back to pin index: 143
Pin Index 144: PH_6, Back to pin index: 144
Pin Index 145: PH_7, Back to pin index: 12
Pin Index 146: PH_8, Back to pin index: 11
Pin Index 147: PH_9, Back to pin index: 147
Pin Index 148: PH_10, Back to pin index: 148
Pin Index 149: PH_11, Back to pin index: 149
Pin Index 150: PH_12, Back to pin index: 150
Pin Index 151: PH_13, Back to pin index: 151
Pin Index 152: PH_14, Back to pin index: 152
Pin Index 153: PH_15, Back to pin index: 0
Pin Index 154: PI_0, Back to pin index: 7
Pin Index 155: PI_1, Back to pin index: 9
Pin Index 156: PI_2, Back to pin index: 156
Pin Index 157: PI_3, Back to pin index: 157
Pin Index 158: PI_4, Back to pin index: 158
Pin Index 159: PI_5, Back to pin index: 159
Pin Index 160: PI_6, Back to pin index: 160
Pin Index 161: PI_7, Back to pin index: 161
Pin Index 162: PI_8, Back to pin index: 162
Pin Index 163: PI_9, Back to pin index: 163
Pin Index 164: PI_10, Back to pin index: 164
Pin Index 165: PI_11, Back to pin index: 165
Pin Index 166: PI_12, Back to pin index: 166
Pin Index 167: PI_13, Back to pin index: 167
Pin Index 168: PI_14, Back to pin index: 168
Pin Index 169: PI_15, Back to pin index: 169
Pin Index 170: PJ_0, Back to pin index: 170
Pin Index 171: PJ_1, Back to pin index: 171
Pin Index 172: PJ_2, Back to pin index: 172
Pin Index 173: PJ_3, Back to pin index: 173
Pin Index 174: PJ_4, Back to pin index: 174
Pin Index 175: PJ_5, Back to pin index: 175
Pin Index 176: PJ_6, Back to pin index: 176
Pin Index 177: PJ_7, Back to pin index: 177
Pin Index 178: PJ_8, Back to pin index: 178
Pin Index 179: PJ_9, Back to pin index: 179
Pin Index 180: PJ_10, Back to pin index: 180
Pin Index 181: PJ_11, Back to pin index: 2
Pin Index 182: PJ_12, Back to pin index: 182
Pin Index 183: PJ_13, Back to pin index: 183
Pin Index 184: PJ_14, Back to pin index: 184
Pin Index 185: PJ_15, Back to pin index: 185
Pin Index 186: PK_0, Back to pin index: 186
Pin Index 187: PK_1, Back to pin index: 1
Pin Index 188: PK_2, Back to pin index: 188
Pin Index 189: PK_3, Back to pin index: 189
Pin Index 190: PK_4, Back to pin index: 190
Pin Index 191: PK_5, Back to pin index: 23
Pin Index 192: PK_6, Back to pin index: 24
Pin Index 193: PK_7, Back to pin index: 25
Pin Index 194: Not a pin, Back to pin index: 255
Pin Index 195: Not a pin, Back to pin index: 255
The ALT*
pins mean that the default selected mux is different from GPIO (you can find an explanation here https://github.com/ARMmbed/mbed-os/blob/master/targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_PORTENTA_H7/PeripheralPins.c#L24-L27 ). On Portenta we only have some analog pins configured as ALT0 (https://github.com/bcmi-labs/ArduinoCore-mbed/blob/master/variants/PORTENTA_H7_M7/variant.cpp#L42-L43) .
@sebromero can we open this until we have a conversion list or set of #defines that converts HD pin names to regular pin names or numbers.
So I made a PCB to physically organize the HD connector pin names like they are presented on the Portenta. You can see it works since a Machine Learning program is showing on the OLED using the reverse side vision shield. The PCB traces are very long as they go from the HD connectors to the headers and then on the other side back to the other HD connector. I still want to be able to code just using the HD pin names. Does anyone have an HD pin name to regular pin name conversion list so I can make a list of #defines
@facchinm Strange bug, when the portenta is connected to my pcb, serial communication with the Arduino IDE dies. Both regular and bootloader communication. Any reason for this or suggestions for a fix?
Hi Jeremy, if the board keeps running the sketch and just the communication is not functional it's probably due to the long stubs on high density USB0 pins (J1 25-27, which are shared with the ones in the USB-C connector). Cutting the traces close to the HD connector looks like a no go in your PCB but maybe it's worth trying :upside_down_face:
Thanks @facchinm . Great idea, and easy to test. I build PCB's like I 3D Print (It takes me 8 trys to get anything correct). Easy next PCB just disconnect J1-25, 26, 27
@facchinm Thank you so much. At least one of those pins J1-(25->27) caused the issue. I now have bootloader and regular serial port Arduino IDE connection.
I have more PCB's I can test. I will have to check if the Vision Shield needs any of those USB0 pins and possibly check if only one of the 3 is the important one to disconnect.
Have a great day Martino!
@facchinm @sbhklr
With other ~30 pin Arduinos I understand pin names relate to ports, for example::
PA14, PB3, PC1, PD10
, but on the PortentaH7 we have potentially 160 Pins. That many pins must be confusing for the engineers but is basically ridiculous for any users. Any chance we could define all 160 pins by the logical names:
J1-1 J1-2 J1-3
J2-1 J2-2 etc, etc
So that users could actually write code that makes sense, like this for D6:
digitalWrite( J2-59 , LOW);
I don't think #defines take up any programming space in memory so I can't think of a reason not to simplify the naming on the Portenta pins.