Arduino Portenta H7: Hardware timers and digital pins

Hallo, I am programming an arduino portenta h7.
Implementations:

  1. To use the hardware timer and send/receive messages using a Vector CAN case.
  2. To set the digital output pin to high/low.

The command
digital_outputs.set(3, HIGH);
is shown as error when hardware timer is used along with a digital pin.

Though the digitalWrite was working fine but I cannot set the digital pins of portenta h7 with this command.

I checked the example codes but the working code of hardware timer working along with digital pins was not found.

Have anyone implemented something similar. How should the syntax be looking like?

Using GPIOs - how I do (think);

  • I do not know what .set(3, ...) means: I use it as:
    digitalWrite(LEDG, OFF);

  • When you want to see a GPIO output - you have to configure as output (default is input):
    pinMode(LEDG, OUTPUT); // Set green LED as output

  • I am not familiar with this pin numbering (my LEDG is 166 as a value, how?). I use often directly the HAL code where the pins is specified as GPIO_PIN_x and GPIOy

I would guess, you have not configured as an output (?)

Attached my GPIO_usr files for using GPIOs directly via STM HAL functions:
GPIO_usr.h (1.0 KB)
GPIO_usr.cpp (3.2 KB)

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