Issues reading PMC Digital Programmables

We are attempting to use the Portenta Machine Control for an industrial control solution but are having issues utilizing its full functionality. One particular pain point involves manipulating the programmable digital IO channels.

There are several discrepancies compared to expected behavior:

  1. Running the example sketch provided in https://docs.arduino.cc/tutorials/portenta-machine-control/user-manual/#programmable-digital-io,
    MachineControl_DigitalProgrammables.readAll() reports channel status as expected, but MachineControl_DigitalProgrammables.read() returns 0, regardless of actual channel status. Further testing replicates this behavior for all PDIO channels.

  2. Expanding on the provided example code, some pin definitions appear to be incorrect. When setting output status of the PDIO channels one by one, MachineControl_DigitalProgrammables.set() works as expected, but when using MachineControl_DigitalProgrammables.readAll(), the status of IO_READ_CH_PIN_04 through IO_READ_CH_PIN_07 are reported in reverse order.

Adding to the intrigue, neither of these pin definition schemes match the official schematic available at https://content.arduino.cc/assets/AKX00032-schematics.pdf. ArduinoIOExpander.h defines IO_READ_CH_PIN_04 - IO_READ_CH_PIN_07 as pins 19 - 16. The observed output suggests that they should actually be pins 16-19. And the schematic appears to show them connected to pins 20-17, unless I'm reading it incorrectly.

Does anyone have experience navigating this functionality on the PMC, and did you get different results?

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