Skip to content

Fix #18 PWM frequency #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 8, 2017
Merged

Fix #18 PWM frequency #19

merged 2 commits into from
Jun 8, 2017

Conversation

fpistm
Copy link
Member

@fpistm fpistm commented Jun 7, 2017

Get the correct timer freq depending on timer clock source.

When TIMPRE bit of the RCC_DCKCFGR register is reset,

  • if APBx prescaler is 1, then TIMxCLK = PCLKx,
  • otherwise TIMxCLK = 2x PCLKx.

When TIMPRE bit in the RCC_DCKCFGR register is set,

  • if APBx prescaler is 1,2 or 4, then TIMxCLK =HCLK,
  • otherwise TIMxCLK = 4x PCLKx

@fpistm fpistm requested a review from a user June 7, 2017 16:29
@fpistm fpistm self-assigned this Jun 7, 2017
Get the correct timer freq depending on timer clock source.

Signed-off-by: Frederic.Pillon <[email protected]>
@fpistm
Copy link
Member Author

fpistm commented Jun 8, 2017

Tests Fading/tone/Servo done on F0/F3/F4/F7/L4 -->ok

@ghost
Copy link

ghost commented Jun 8, 2017

PWM pins tested on L0/L4/F0/F3/F4 -> OK

I found another issue on F0 & F3: some PWM pins are not configured in PeripheralPins.c.

  • F0: D3=PB3 & D6=PB10 not set
  • F3: D6=PB10 not set

@fpistm can you confirm me that is a mistake? If yes I will push the patch.

@fpistm
Copy link
Member Author

fpistm commented Jun 8, 2017

Hi,
this is not really a mistake.
This only means by default PWM is not enabled on those pins but they could be added.
In fact, I have took as example mbed PeripheralPins.c for those boards that's why it is commented.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is OK for me.

@fpistm fpistm merged commit dadfba3 into master Jun 8, 2017
@fpistm fpistm mentioned this pull request Jun 11, 2017
@fpistm fpistm deleted the issue_18 branch August 7, 2017 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant