STM32F334 and High Speed PWM

An area to discuss ARM specific problems and examples

Moderator: Benj

Post Reply
User avatar
STibor
Posts: 263
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 116 times
Been thanked: 113 times
Contact:

STM32F334 and High Speed PWM

Post by STibor »

Hello!

Is it possible to implement the STM32F334 HRTIM PWM library?
How do I call the HAL library?
Linked Document Chapter 2.1, A Single PWM Generation Example.

HRTIM cookbook:http://www.st.com/resource/en/applicati ... 121475.pdf

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: STM32F334 and High Speed PWM

Post by LeighM »

Hi,
The stm32f3xx_hal_hrtim.h header file is linked into the Flowcode build, so you should be able to call the HAL functions from a C icon

User avatar
STibor
Posts: 263
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 116 times
Been thanked: 113 times
Contact:

Re: STM32F334 and High Speed PWM

Post by STibor »

Can you help me with an example?
Thanks!

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: STM32F334 and High Speed PWM

Post by LeighM »

Here I just did a copy'n'paste from the HRTIM cookbook, not that I'm confirming that it works, I've never tried it, but the C code is valid ...
hrtim.jpg
hrtim.jpg (132.99 KiB) Viewed 8800 times

User avatar
STibor
Posts: 263
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 116 times
Been thanked: 113 times
Contact:

Re: STM32F334 and High Speed PWM

Post by STibor »

The empty project is also bad.
Attachments
empty_stm32f334_nucleo.msg.txt
(57.19 KiB) Downloaded 292 times
empty_stm32f334_nucleo.fcfx
(6.37 KiB) Downloaded 271 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: STM32F334 and High Speed PWM

Post by LeighM »

Attached update to go into your Flowcode installation FCD\ARM\ directory.
Attachments
32F334Nucleo64.fcdx
(28.91 KiB) Downloaded 264 times

User avatar
STibor
Posts: 263
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 116 times
Been thanked: 113 times
Contact:

Re: STM32F334 and High Speed PWM

Post by STibor »

Hello,

I've created a demo program for HRTIM PWM.
There may be a terrible part of the code. (spaghetti code): D
I do not really understand C programming.
https://youtu.be/b0M7hRunN7Y
Attachments
stm32f334_nucleo_hrtim_demo_DM00121475.fcfx
(23.29 KiB) Downloaded 317 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: STM32F334 and High Speed PWM

Post by LeighM »

Thanks for sharing :D

chad
Posts: 198
Joined: Sun Nov 04, 2018 7:13 pm
Has thanked: 27 times
Been thanked: 33 times
Contact:

Re: STM32F334 and High Speed PWM

Post by chad »

Hi thanks for digging into this. I am going to be playing with pwm on the 446re chip. This is a big help.

Chad

Post Reply