Skip to content

Pin alternate function #8

@patricklaf

Description

@patricklaf

Hello,
I try to use timer input capture with a Nucleo-L476RG, TIM3, channel 1.
The channel input pin is PA6. I linked PA6 to PA0 while PA0 is running a PWM output signal.
Timer is counting, but there is no edge detection.
What is the function to set up PA6 so it will act as timer capture input?
pinMode function doesn't accept alternate as mode parameter.
I tried this but without success:

// PA6
pinMode(PA6, INPUT);
pin_function(digitalPinToPinName(PA6), STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0));

pinMode call is to setup pin as configured, pin_function call is to set alternate configuration.
Thanks for your help,
Patrick

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions