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/05.pro-solutions/solutions-and-kits/portenta-machine-control/datasheet/datasheet.md
+7
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,8 @@ Industry 4.0, system integrators
41
41
-**4x Analog output channels**
42
42
- DC Voltage output software configurable: 0-10V DC
43
43
- Max 20mA per channel
44
+
- Analog Out Channel 2 with maximum period of ~1.3 ms (Recommended for high-frequency PWM signals)
45
+
- Analog Out Channels 0, 1, 3 with standard timers
44
46
-**12x Digital programmable channels**
45
47
- Non-galvanic isolated 24V power input
46
48
- 12x High-side switches with current limit and inductive load kick-back protection
@@ -191,6 +193,10 @@ The output signal is a DC whose amplitude is a function of the PWM duty cycle.
191
193
192
194
The maximum output current is 20mA per channel.
193
195
196
+
Analog Out Channel 2 (AO2) is connected to pin PG7 on the Portenta H7 and features an HRTIM (High-Resolution Timer) function. The HRTIM configuration includes a frequency of 200 MHz (tick time = 5 ns), a clock prescaler of 4, and a maximum period of 65533 ticks (1.31 ms). This results in a maximum period of ~1.3 ms, making AO2 suitable mainly for high-frequency PWM signals.
197
+
198
+
For applications requiring periods longer than 1.3 ms, consider using Analog Out Channels 0, 1, or 3, which use standard timers.
199
+
194
200
### Temperature Measurements
195
201
Three independent temperature measurement channels are available.
196
202
@@ -561,6 +567,7 @@ Hereby, Arduino S.r.l. declares that this product is in compliance with essentia
Copy file name to clipboardExpand all lines: content/hardware/05.pro-solutions/solutions-and-kits/portenta-machine-control/tutorials/pmc-arduino-library/content.md
+2
Original file line number
Diff line number
Diff line change
@@ -169,6 +169,8 @@ In the new approach, the `begin()` function is explicitly called to initialize t
169
169
170
170
This update enhances the user experience by making the code more intuitive and aligned with the familiar Arduino programming style.
171
171
172
+
***When using the Analog Output channels, please consider following detail: The High-Resolution Timer (HRTIM) function on PG7 allows for high-frequency PWM signals with precise control over short periods. However, it is limited to a maximum period of __approximately 1.3 ms__. This constraint makes __Analog Out Channel 2__ optimal for high-frequency PWM applications but unsuitable for periods exceeding 1.3 ms. For longer periods, alternative __Analog Out channels (AO0, AO1, AO3)__ with standard timers are recommended. Please refer to the [Portenta Machine Control User Manual: Analog Outputs secion](https://docs.arduino.cc/tutorials/portenta-machine-control/user-manual/#analog-outputs) for more details.***
173
+
172
174
### Encoders
173
175
174
176
The handling of encoders has been updated in the `Arduino_PortentaMachineControl` Library for a more streamlined and intuitive approach. One key new feature is the **removal of array object access**. In the previous library version, encoder objects were accessed using array notation (`[]`). The latest version has simplified this approach, enhancing code readability and reducing potential errors.
Copy file name to clipboardExpand all lines: content/hardware/05.pro-solutions/solutions-and-kits/portenta-machine-control/tutorials/user-manual/content.md
+38
Original file line number
Diff line number
Diff line change
@@ -372,6 +372,44 @@ The expected result of the generated sine wave measured with an oscilloscope in
372
372
373
373

374
374
375
+
### Working With Analog Output Channel 2 (AO2)
376
+
377
+
**Analog output channel 2 (AO2)** of the Portenta Machine Control is connected to pin *PG7* on the Portenta H7, which features an **HRTIM (High-Resolution TIMer)** function. It is the only Analog Out pin on the Portenta Machine Control with an **HRTIM (High-Resolution Timer)** function.
378
+
379
+
The *HRTIM* on *PG7* is mainly applicable for high-frequency PWM signals, which have constraints on the maximum period that can be achieved. With the availability of the *HRTIM_EEV2* function, which serves as an external event input, its configuration allows **AO2** to support high-resolution PWM signals with very short periods but also results in a constraint.
380
+
381
+
The *HRTIM* is configured with a frequency of **200 MHz** (tick time = **5 ns**), a clock prescaler set to **4**, and a maximum period of **0xFFFD** ticks (**65533 * 5 ns * 4 = 1.31 ms**). This configuration results in a maximum allowed period of **1.31 ms** for *AO2*.
382
+
383
+
Knowing that the maximum allowable period for *AO2* is approximately **1.3 ms**, it makes it suitable only for high-frequency PWM signals. For applications requiring periods longer than *1.3 ms*, we recommend using other analog output channels, such as **Analog output channel 0 (AO0)**, **1 (AO1)**, or **3 (AO3)**, which can use standard timers. Please consider this characteristic when selecting the appropriate output channel for the development application.
384
+
385
+
The following code shows the setup of the *Analog Out* channels, including *AO2*. Please be aware that attempting to set a period longer than *1.3 ms* for *AO2* is not recommended.
386
+
387
+
```cpp
388
+
#include<Arduino_PortentaMachineControl.h>
389
+
390
+
#definePERIOD_MS_AO2 1 /* 1 ms for AO2 */
391
+
#define PERIOD_MS 4 /* 4 ms - 250Hz for other channels */
392
+
393
+
voidsetup() {
394
+
Serial.begin(9600);
395
+
396
+
MachineControl_AnalogOut.begin();
397
+
398
+
MachineControl_AnalogOut.setPeriod(0, PERIOD_MS);
399
+
MachineControl_AnalogOut.setPeriod(1, PERIOD_MS);
400
+
MachineControl_AnalogOut.setPeriod(2, PERIOD_MS_AO2); // AO2 - Adjusted period to fit limitation
401
+
MachineControl_AnalogOut.setPeriod(3, PERIOD_MS);
402
+
403
+
MachineControl_AnalogOut.write(0, 5);
404
+
MachineControl_AnalogOut.write(1, 5);
405
+
MachineControl_AnalogOut.write(2, 5);
406
+
MachineControl_AnalogOut.write(3, 5);
407
+
}
408
+
409
+
voidloop() {
410
+
}
411
+
```
412
+
375
413
## Digital Inputs
376
414
377
415
The Portenta Machine Control has up to eight digital input channels, as shown in the image below. Each channel incorporates a voltage divider comprising a 680 kΩ and a 100 kΩ resistor, which scales an input from 0 to 24 VDC down to 0 to 3 VDC.
0 commit comments