MIMXRT1180 how to output a pwm signal on the pin M16 - GPIO_AD_27 Hi guys, I have a MIMXRT1189CVM8C. I am not able to output a simple PWM signal from the pin M16 - GPIO_AD_27. I have attached the screenshots of the MCUXpresso Config Tool which I set. Can someone help me, please? Re: MIMXRT1180 how to output a pwm signal on the pin M16 - GPIO_AD_27 Hi @silvio-vallorani ,
Thank you so much for your interest in our products and for using our community.
I suggest you can refer to SDK demo "evkmimxrt1180_pwm_cm33".
1: Pin Configuration :
In MCUXpresso Config Tools, set pin M16 (GPIO_AD_27) to function as PWM2_B (submodule 1).
2: Add PWM Initialization Code
Follow the SDK demo for PWM setup. The demo project uses PWM1 submodule 0, submodule 1, and submodule 2 to generate waveforms. You can adapt the same method for PWM2 Submodule 1.
Best Regards
MayLiu Re: MIMXRT1180 how to output a pwm signal on the pin M16 - GPIO_AD_27 My new related question is about a function I need to implement, but I can't figure out how to do it cleanly and possibly totally in hardware. I have a periodic square signal generated by my application. I need to generate a new periodic square signal that is 8 time more fast and that perfectly sync with the signal above, every it's rise edge. In the Reference Manual I saw this block diagram: However, going into more detail about the behavior of PWM_EXT_SYNC I found this block diagram: It seems that the PWM peripheral is unable to simultaneously generate the PWM signal and synchronize with the external signal, is this true? Can you help me to find a good solution for my needs? Thank you very much, Silvio Re: MIMXRT1180 how to output a pwm signal on the pin M16 - GPIO_AD_27 Thank you @mayliu1 for your reply. I found the problem, it was related to the "fault disable" signals. I tryed to disable the beahviour that involve faults, using the "MCUX Config Tool" is not possible: if I uncheck all the "fault disable" signals, the generated code totally remove the PWM_SetupFaultDisableMap() call and the "fault disable map" register stay to it's all enabled by default. I think this is a buggy beahviour of the tool, beacouse if I uncheck all the "fault disable" signals from the tool and then I manually add the PWM_SetupFaultDisableMap() call with "0" as the mask, I obtain the expected behaviour. Anyway, on my code I finally leave enabled all the "fault disable" signals and I added XBAR signals to route "InputLogicHigh" on "Flexpwm2Faultx" signals and that's works fine. Now I have a new question, but I ask it as a separate message below. Re: MIMXRT1180 how to output a pwm signal on the pin M16 - GPIO_AD_27 Hi @silvio-vallorani ,
Thanks for your updated information.
Q: It seems that the PWM peripheral is unable to simultaneously generate the PWM signal and synchronize with the external signal, is this true?
A: The FlexPWM module on i.MX RT1180 can simultaneously generate PWM outputs and synchronize its counter to an external signal.
For more detailed information, I suggest you can refer to this Application Note : AN14196: Flex Pulse Width Modulator (FlexPWM) Usage on MCX N Series | NXP Semiconductors,
especially Section 3.2.2 “Counter Synchronization”, which describes how the FlexPWM counter can be synchronized across modules or via external sources.
Best Regards
MayLiu
記事全体を表示