You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/hardware/04.pro/carriers/portenta-hat-carrier/tutorials/user-manual/content.md
+59-33Lines changed: 59 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -189,17 +189,21 @@ The Portenta Hat Carrier can be powered according to one of the following method
189
189
190
190
For clarity on the connection points, please refer to the [board pinout section](#pinout) of the user manual. Ensure the supplied current meets the specification for all components, as shown in the operating conditions table reported later on.
191
191
192
-
- Using an external __5 V power supply__ to the _5V_ pin located on the 40-pin male header connectors pins or available on the screw terminal of the board, you can effectively power the Portenta Hat Carrier, the SOM, and any connected hat.
192
+
- Using an external __5 V power supply__ to:
193
+
* The _5V_ pin located on the 40-pin male header connectors pins
194
+
* The _5V_ pin located on the screw terminal of the board
195
+
196
+
You can effectively power the Portenta Hat Carrier, the SOM, and any connected hat.
193
197
194
198
For more details on this connection, kindly consult the [board pinout section](#pinout) of the user manual. Again, ensure that the power supply's maximum current respects all components' specifications.
195
199
196
-
- Using a USB-C® cable (not included) connected to the Portenta core board of your choice powers not only the selected core board, like the Portenta X8, H7, or C33, but also the Portenta Hat Carrier, the SOM, and any connected hat which does not require a dedicated external power supply.
200
+
- Using a USB-C® cable (not included) connected to the Portenta core board of your choice powers not only the selected core board, like the Portenta X8, H7, or C33, but also the Portenta Hat Carrier, and any connected hat that does not require a dedicated external power supply.
197
201
198
202
***The Portenta Hat Carrier can deliver a __maximum__ of 1.5 A.***
199
203
200
204

201
205
202
-
The image below magnifies the location of the terminal block for 7 - 32 V and 5 V power source of the Portenta Hat Carrier:
206
+
The image below magnifies the location of the terminal block for the 7 - 32 V and 5 V power source of the Portenta Hat Carrier:
203
207
204
208

205
209
@@ -211,32 +215,32 @@ Subsequently, you can check how the Portenta Hat Carrier distributes power resou
211
215
212
216
To ensure the safety and longevity of the board, it is essential to understand the carrier's operating conditions. The table below provides the recommended operating conditions for the carrier:
|VIN from onboard screw terminal* of the Carrier | 7.0 |-|32.0 |V|
221
+
|USB-C® input from the connected Portenta family board | - | 5.0 |-|V|
222
+
|+5 VDC from the 40-pin header connector on the carrier | - | 5.0 |-|V|
223
+
| +5 VDC from the carrier's onboard screw terminal| - | 5.0| -|V|
224
+
| Current supplied by the carrier |- |- |1.5 |A|
225
+
|Ambient operating temperature|-40 |-| 85|°C|
222
226
223
227
***The onboard screw terminal powers both the carrier and any connected Portenta board. Additionally, this terminal connector includes reverse polarity protection for enhanced safety.***
224
228
225
229
### Carrier Characteristics Highlight
226
230
227
231
The Portenta Hat Carrier provides different functionalities based on the connected Portenta family board, as shown in the table below:
***The Portenta X8 is the specific Portenta family board that offers compatibility with Raspberry Pi® Hats on the 40-pin Header.***
242
246
@@ -260,7 +264,7 @@ To use the Portenta Hat Carrier with the Portenta X8, you will have to align the
260
264
#### Hello World With Portenta X8 Shell
261
265
<br></br>
262
266
263
-
A series of _Hello World_ examples will be used to ensure the Portenta Hat Carrier is correctly operating with the paired Portenta X8. These examples, using Linux commands, Python® scripts, Docker, and the Arduino IDE, aim to trigger the user-programmable LED connected to GPIO3 leveraging different methods and platforms.
267
+
A series of _Hello World_ examples will be used to ensure the Portenta Hat Carrier is correctly operating with the paired Portenta X8. These examples, using Linux commands, Python® scripts, and the Arduino IDE, aim to trigger the user-programmable LED connected to GPIO3 leveraging different methods and platforms.
264
268
265
269
We will begin with a _Hello World_ example using Linux commands. The user programmable LED can be controlled using commands within the Portenta X8's shell. Learn how to connect with Portenta X8 shell [here](https://docs.arduino.cc/tutorials/portenta-x8/user-manual#first-use-of-your-portenta-x8).
266
270
@@ -273,7 +277,11 @@ adb shell
273
277
sudo su -
274
278
```
275
279
276
-
When you execute the _sudo su -_ command, you will be prompted for a password. The default password is `fio`. This command grants you access as the root user, loading the root user's environment settings such as `$HOME` and `$PATH`.
280
+
When you execute the _sudo su -_ command, you will be prompted for a password:
281
+
282
+
***The default password is `fio`***
283
+
284
+
This command grants you access as the root user, loading the root user's environment settings such as `$HOME` and `$PATH`.
277
285
278
286
The aforementioned commands allow you to access the Portenta X8's shell with elevated privileges. This allows you to modify system configurations that require administrative permissions.
279
287
@@ -301,7 +309,7 @@ The GPIO can now be configured verifying that GPIO3 elements were successfully e
301
309
echo <I/O> >/sys/class/gpio/gpio163/direction
302
310
```
303
311
304
-
For this example, we will replace the `I/O` field with `out` value within the following command.
312
+
For this example, we will replace the `<I/O>` field with `out` value within the following command:
The GPIO is now set as an output, thus it can now be controlled by setting its state.
317
325
318
-
To set the pin High, you need to assign the value `1`, or `0` to set the pin Low. The command will require the `value` at the end to ensure the pin's state is controlled.
326
+
To set the pin High, you need to assign the value `1`, or `0` to set the pin `HIGH` or `LOW`. The command will require the `value` at the end to ensure the pin's state is controlled.
327
+
319
328
329
+
To set the pin to `HIGH`:
320
330
```
321
331
echo 1 >/sys/class/gpio/gpio163/value
322
332
echo 0 >/sys/class/gpio/gpio163/value
323
333
```
324
334
335
+
To set the pin to `LOW`:
336
+
```
337
+
echo 0 >/sys/class/gpio/gpio163/value
338
+
```
339
+
325
340
If you have finished controlling the GPIO, you can use the following command to _unexport_ it, ensuring it no longer appears in the userspace:
326
341
327
342
```
@@ -336,7 +351,7 @@ ls /sys/class/gpio
336
351
337
352
This step helps you to prevent unintentional modifications to the element configuration.
338
353
339
-
#### Hello World Using Linux and Python® Script
354
+
#### Hello World Using Linux and Python® Scripts
340
355
<br></br>
341
356
342
357
Previously, we manually toggled the LED linked to _GPIO3_ on the Portenta X8 via the command-line. However, to automate this process and potentially extend our control logic, we can employ a Python® script for this purpose.
@@ -390,28 +405,39 @@ def main():
390
405
gpio.set_direction("out")
391
406
if gpio.read_direction() =="out":
392
407
print("GPIO set as output.")
408
+
print("User LED Blinking 20 times")
409
+
393
410
394
411
# Turn on (set to 1) and then off (set to 0)
395
-
whileTrue:
412
+
for i inrange(1,20,1):
396
413
gpio.set_value(1)
397
414
time.sleep(1)
398
415
gpio.set_value(0)
399
416
time.sleep(1)
400
-
401
-
# Unexport (if you want to unexport at some point, you can uncomment this)
402
-
# gpio.unexport()
417
+
418
+
419
+
print("GPIO Unexport")
420
+
gpio.unexport()
421
+
print("End of the program")
422
+
exit()
403
423
404
424
if__name__=="__main__":
405
425
main()
406
426
```
407
427
408
-
The script can be named as `hello_world_python.py` for example. It can then be pushed to Portenta X8 using the following command on computer terminal:
428
+
The script can be named as `hello_world_python.py` for example. It can then be pushed to Portenta X8 using the following command on a computer terminal:
409
429
410
430
```bash
411
431
adb push hello_world_python.py /home/fio
412
432
```
413
433
414
-
The file is uploaded to `/home/fio` directory. Navigate to the directory using ADB shell and use the following command to run the script:
434
+
The file is uploaded to `/home/fio` directory. Navigate to the directory using ADB shell:
0 commit comments