Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HardwareTimer.cpp line 297 #81

Open
atsushi1 opened this issue Feb 11, 2021 · 0 comments
Open

HardwareTimer.cpp line 297 #81

atsushi1 opened this issue Feb 11, 2021 · 0 comments

Comments

@atsushi1
Copy link

This is great work. I am trying to generate a three phase motor drive using PWM with three complementary half bridges... I suspect there may be a typo at line 297. I think the OCMode should be set to TIM_OCMODE_INACTIVE instead of TIM_OCMODE_ACTIVE. I think this is needed for the active LOW channel of the PWM...

Full disclosure: I am a newbie with STM32 coding so I may be wrong so I hope you can check this...

The file is in HardwareTimer.cpp at line 297.

    case TIMER_OUTPUT_COMPARE_ACTIVE:
        channelOC[channel - 1].OCMode = TIM_OCMODE_ACTIVE;
        pinMode = GPIO_MODE_AF_PP;
        break;

    case TIMER_OUTPUT_COMPARE_INACTIVE:
        **channelOC[channel - 1].OCMode = TIM_OCMODE_ACTIVE;    // Should this be TIM_OCMODE_INACTIVE ?**
        pinMode = GPIO_MODE_AF_PP;
        break;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant