2018-12-17 11:44 AM
Hi.
We use a STM32F431 in a project and need to add/include a MCU-port to generate a fixed 200kHz output signal to our target-HW. Many pins on our LQFP64 are already used, so I hope I can use PB6 (TIM16_CH1N) for that purpose.
Q1: How can I set up a (preferably TIM16-) timer to acheive this simple 200kHz pulse?
Q2: Is TIM16 best suited for such a job?
Q3: Where can I find example codes for such TIM-features?
Best regards
Terje Bøhler
2018-12-17 11:53 AM
Try this, or the other F4 examples as a basis, I know you said 431, they are all much the same
STM32Cube_FW_F4_V1.23.0\Projects\STM32F413ZH-Nucleo\Examples\TIM\TIM_PWMOutput\Src\main.c
Perhaps use PMW2 mode, inverts the pulse polarity sense.
You'd configure PB6, AF mode associating with TIM16
Divide down the APB clock for TIM to get to 200 KHz, use Prescaler and Period to factor.
Assume a TIMCLK of 84 MHz,
Prescaler = 0; // DIV1
Period = (84000000 / 200000) - 1;
For 50/50 duty Pulse = (Period+1) /2;
2018-12-17 11:56 AM
Shows configuring N (Complementary) pins
STM32Cube_FW_F4_V1.23.0\Projects\STM324xG_EVAL\Examples\TIM\TIM_6Steps\Src\main.c
2018-12-17 12:00 PM
Thanks Clive, but where do I find the file/path you are referring to?
BR Terje
2018-12-17 12:51 PM
The CubeMX F4 installed repositories, or unpack CubeF4 archive
https://www.st.com/en/embedded-software/stm32cubef4.html
2018-12-17 01:33 PM
STM32F431?
JW
2018-12-17 01:37 PM
Sorry, STM32L431
2018-12-17 01:44 PM
CubeL4 then https://www.st.com/en/embedded-software/stm32cubel4.html
STM32Cube_FW_L4_V1.13.0\Projects\NUCLEO-L432KC\Examples\TIM\TIM_PWMOutput\Src\main.c
2018-12-17 01:57 PM
Thanks, I now did:
1) Downloaded "STM32CubeF4 ".
2) Selected "Open" (I guess) …
3) Extracted the RAR/ZIP-file to default path ("Extract To …")
4) Clicked on the "Release_Notes.html" …
5) The "extraction process" then started: "... extracting from en.stm32cubel4.zip …
So, what now ?
No STM32Cub3L4 icon appears …
Is there an .exe-file to be run?
BR Terje
2018-12-17 01:59 PM
I very much appreciate further guidance to install/run this STM32CubeL4 …
BR Terje Bøhler