Skip to content

[F1] Duty cycle / frequence measurement not working for AF pin #1036

Closed
@treitmayr

Description

@treitmayr

Description
When trying to run the Frequency_Dutycycle_measurement example on an STM32F103C8 (bluepill) with input pin B4, the code is not able to capture any rising/falling edges.

The important piece of information here is that B4 is not the default pin for this timer but an alternate function pin. While for default pins, capturing edges with the HardwareTimer was fixed for the F1 family with PR #824, the AF bits of the pin function must still be retained and configured for non-default pins to be usable.

I have a working version commited here (ready for a PR): treitmayr@4f134ae

Expected behavior
Rising and falling edges are detected and frequency and duty cycle are reported on serial port.

Desktop (please complete the following information):

  • OS: Linux
  • Arduino IDE version: 1.8.12
  • STM32 core version: latest git a8b0838

Board:

  • Name: STM32F103C8 (bluepill)

Metadata

Metadata

Assignees

Labels

bug 🐛Something isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions