cancel
Showing results for 
Search instead for 
Did you mean: 

TIMER OC output using LL

MTros.1
Associate II

I ran timer OC mode on PA8 (TIM1_CH1) on STM32f407VGT6 using HAL and it works fine. Then I decided to set up it by means of LL and there is not any output on PA8. I checked my code with Example_LL projects of STM32F411RE-Nucleo in ST F4 repository. It seems that I have done any thing it needs! My project files are attached. Now please I have two questions:

  1. Why does not my code work?
  2. Are the Example_LL projects reliable?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
TIM2 doesn’t have an MOE bit. Only advanced timers do.
If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

6 REPLIES 6

Read out and check/post content of TIM and relevant GPIO registers.

JW

TDK
Guru

Is the MOE bit set?

If you feel a post has answered your question, please click "Accept as Solution".

Your answer was to the point. I employed this LL service to do it.

LL_TIM_EnableAllOutputs(TIM1);

can you please tell me from where I can find the step by step procedure to set up a peripheral in STM32F4? until now I have considered HAL Examples as a guider to find a step by step recipe to set up a peripheral by HAL. Yet it seems to me that LL Examples are not reliable! please guide me.

There are some LL examples available in the CubeMX repository. If you're dead set on using LL, I'd look at those. If you're not dead set on using LL, use direct register access and use the reference manual for how to set up peripherals.

Which example are you saying doesn't work? The only relevant example I see is "TIM_PWMOutput" which uses TIM2, not TIM1, so that can't be it..

If you feel a post has answered your question, please click "Accept as Solution".
MTros.1
Associate II

Actually I had to migrate from HAL to LL since HAL has considerable overhead (sometimes 1us(=HAL) vs 100ns(=Direct register access)!!!). Therefore I decided to give LL a shot and get rid of overhead time.

I used "TIM_OutputCompare". Yes TIM2 is employed and PA5 as output waveform pin. I did not download this example into any MCU. I only considered it as a guider

and did anything it did. However I reckon that MOE bit is not set anywhere!!! Is it???

TIM2 doesn’t have an MOE bit. Only advanced timers do.
If you feel a post has answered your question, please click "Accept as Solution".