# Portenta Machine Control Analog Output 2 drives 10 V when writing 0

**URL:** <https://forum.arduino.cc/t/portenta-machine-control-analog-output-2-drives-10-v-when-writing-0/936365>\
**Category:** Portenta Machine Control\
**Created:** [December 16, 2021, 3:45am UTC](https://forum.arduino.cc/t/portenta-machine-control-analog-output-2-drives-10-v-when-writing-0/936365 "2021-12-16T03:45:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![njhetherington](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/njhetherington/32/675976_2.png) [@njhetherington](https://forum.arduino.cc/u/njhetherington)\
**Post date:** [December 16, 2021, 3:45am UTC](https://forum.arduino.cc/t/portenta-machine-control-analog-output-2-drives-10-v-when-writing-0/936365/1 "2021-12-16T03:45:01Z")

</div>

I am seeing strange behaviour on my Portenta Machine Control unit. When I write 0 to all analog outputs, 0,1, and 3 drive 0 V, but analog output 2 drives 10 V. Analog output 2 drives 0.1 V when I write 0.1 V to it. I have duplicated the behaviour on a second identical unit.

A minimal working example is below.

- Arduino CLI version 0.20.2
- MBED Portenta Core version 2.6.1
- Arduino Machine Control library version 1.0.2.
- I have not updated the library to 1.1.0 because there have been no material changes to the AnalogOut class.
- Uploading this for the M7 core.

```cpp
#include <Arduino_MachineControl.h>

using namespace machinecontrol;

void setup()
{
    Serial.begin(9600);

    while (!Serial)
        ;
    analog_out.period_ms(0, 4);
    analog_out.period_ms(1, 4);
    analog_out.period_ms(2, 4);
    analog_out.period_ms(3, 4);

    Serial.println("Analog out test");
}

void loop()
{
    for (int i = 0; i < 4; ++i)
    {
        analog_out.write(i, 0);
    }

    delay(100);
}

```

Has anyone experienced the same issue? Any suggestions? Thanks in advance!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [June 14, 2022, 3:45am UTC](https://forum.arduino.cc/t/portenta-machine-control-analog-output-2-drives-10-v-when-writing-0/936365/2 "2022-06-14T03:45:37Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
