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

imxrt_flexpwm independent output B support added #8788

Merged
merged 1 commit into from
Mar 21, 2023

Conversation

jturnsek
Copy link
Contributor

@jturnsek jturnsek commented Mar 10, 2023

Summary

i.MXRT FlexPWM has two outputs per PWM submodule, called A and B, respectively. Output B can be set to be complementary output for Output A or independent. Later is increasing the number of channels per FlexPWM module from 4 to 8 if CONFIG_PWM_MULTICHAN is used. This PR is supporting this independent mode. If complementary mode is used, channel number of Output A must be used.

Impact

CONFIG_PWM_NCHANNELS must be set to 8 (maximum) and numbering of channels must be according, i.e. 1 to 8. Even if submodules are excluded with configuration. THis means if only MOD3 is used in FlexPWM1, usable channels are 5 and 6.

Testing

Tested with rgbled example on EdgePro1, where FlexPWM2 MOD3 Out B is used for Red and FlexPWM1 MOD4 Out A and Out B is used for Green and Blue.

@acassis
Copy link
Contributor

acassis commented Mar 10, 2023

@jturnsek does that complementary PWM has dead time support to H-Bridge usage like Michal submitted to SAM MCU?
More info: https://community.element14.com/technologies/fpga-group/b/blog/posts/vhdl-pwm-generator-with-dead-time-the-design

arch/arm/src/imxrt/imxrt_flexpwm.c Outdated Show resolved Hide resolved
arch/arm/src/imxrt/imxrt_flexpwm.c Outdated Show resolved Hide resolved
@jturnsek
Copy link
Contributor Author

does that complementary PWM has dead time support to H-Bridge usage like Michal submitted to SAM MCU? More info: https://community.element14.com/technologies/fpga-group/b/blog/posts/vhdl-pwm-generator-with-dead-time-the-design

FlexPWM actually has a dead time support, but I think it is not used here. That is something to be considered in future improvements.

@michallenc
Copy link
Contributor

@acassis I think this can be merged if you agree.

@pkarashchenko pkarashchenko merged commit 1d7383d into apache:master Mar 21, 2023
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

Successfully merging this pull request may close these issues.

4 participants