jiris97

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: Strange optimization problem TIM4 #12212
    jiris97
    Participant

    Thank you, you are right, everything works well now.

    The problem was I did not set all needed members of TIM_OC_InitTypeDef:

    TIM_OC_InitTypeDef ocChannel;
    ocChannel.OCMode = TIM_OCMODE_PWM1;
    ocChannel.OCPolarity = TIM_OCPOLARITY_HIGH;
    ocChannel.OCFastMode = TIM_OCFAST_DISABLE; //this one was missing
    ocChannel.Pulse = 0;

     

    As I found, it is masked to the CCMR register which had wrong value before: htim->Instance->CCMR1 |= sConfig->OCFastMode;

     

    Thank you again for your help and time, Jiri

Viewing 1 post (of 1 total)