Skip to content

How to Use TIM1_CH1N using stm32duino core? #2287

Closed Answered by fpistm
China-Mr-Hou asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @China-Mr-Hou
I've tested with a Nucleo G474RE and the frequency is correct:

Same using the Generic target.

Don't know which board you use with a STM32G474RE, you probably use the generic G474RE variant and I guess you redefine the clock config? This can explain your issue as depending of your clock config the precision can be high or not.
By default the generic or the Nucleo variants are configured to the max freq 170MHz.

About having TIM1_CH1 and TIM1_CH1N together, this is not supported by the current HT implementation. I will provide a PR to allow this.
Here a workaround to be able to have it:

#include <HardwareTimer.h>
HardwareTimer *tim1 = new HardwareTimer(TIM1);

void setup() …

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@China-Mr-Hou
Comment options

@fpistm
Comment options

Answer selected by China-Mr-Hou
@China-Mr-Hou
Comment options

@fpistm
Comment options

@China-Mr-Hou
Comment options

@fpistm
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants