Page 1 of 1

STM32F334 and High Speed PWM

Posted: Mon May 21, 2018 7:48 am
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

Re: STM32F334 and High Speed PWM

Posted: Mon May 21, 2018 11:21 am
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

Re: STM32F334 and High Speed PWM

Posted: Mon May 21, 2018 3:44 pm
by STibor
Can you help me with an example?
Thanks!

Re: STM32F334 and High Speed PWM

Posted: Mon May 21, 2018 4:00 pm
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 9138 times

Re: STM32F334 and High Speed PWM

Posted: Mon May 21, 2018 4:20 pm
by STibor
The empty project is also bad.

Re: STM32F334 and High Speed PWM

Posted: Tue May 22, 2018 8:19 am
by LeighM
Attached update to go into your Flowcode installation FCD\ARM\ directory.

Re: STM32F334 and High Speed PWM

Posted: Wed May 30, 2018 9:52 pm
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

Re: STM32F334 and High Speed PWM

Posted: Thu May 31, 2018 7:58 am
by LeighM
Thanks for sharing :D

Re: STM32F334 and High Speed PWM

Posted: Sun Feb 17, 2019 2:21 am
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