RT1064DVJ6B and PWMX signal issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RT1064DVJ6B and PWMX signal issue

Jump to solution
1,339 Views
frankk
Contributor II

Hello,

we would like to use PWMX_03 (GPIO_AD_B0_13) signal of PWM1 and submodule 0. The problem is that we can only enable PWMX_0 (GPIO_AD_B0_02).

The next wierd thing is that it doesnt matter what pin is configured in pin_mux.c. I tried:

IOMUXC_GPIO_AD_B0_02_FLEXPWM1_PWMX00
IOMUXC_GPIO_AD_B0_03_FLEXPWM1_PWMX01
IOMUXC_GPIO_AD_B0_12_FLEXPWM1_PWMX02
IOMUXC_GPIO_AD_B0_13_FLEXPWM1_PWMX03
I tried it on rt1064 evalboard. Our board is already designed and we need PWMX03 (fix 50% duty cycle is ok)

Here is the whole picture:

rt1064dvj6b_pwmx_issue.png

I attached the picture for download in case you cannot read it.

Labels (1)
Tags (2)
0 Kudos
1 Solution
1,230 Views
frankk
Contributor II

I solved it by myself. Attached you will find the code.

What I figured out: PWMX00 belongs to submodule0, PWMX01 belongs to submodule1 and PWMX03 belongs to submodule3. I assumed that FlexPWM1 corresponds to submodule0 and FlexPWM4 corresponds to submodule3. Obviously this is not the case. I think each FlexPWM module has four submodules. This is not mentioned in datasheet.

And by the way, I have never seen such bad datasheet. With this µC datasheet it is always the same, spending a lot of time to get such simple functions to work. Actually it needs one sentence or one better block diagram in datasheet.

Regards,

Frank

View solution in original post

Tags (1)
0 Kudos
4 Replies
1,231 Views
frankk
Contributor II

I solved it by myself. Attached you will find the code.

What I figured out: PWMX00 belongs to submodule0, PWMX01 belongs to submodule1 and PWMX03 belongs to submodule3. I assumed that FlexPWM1 corresponds to submodule0 and FlexPWM4 corresponds to submodule3. Obviously this is not the case. I think each FlexPWM module has four submodules. This is not mentioned in datasheet.

And by the way, I have never seen such bad datasheet. With this µC datasheet it is always the same, spending a lot of time to get such simple functions to work. Actually it needs one sentence or one better block diagram in datasheet.

Regards,

Frank

Tags (1)
0 Kudos
1,312 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @frankk,

As you mention, the SDK’s PWM_SetupPwm API doesn’t include this channel by default. You would have to modify it manually to include PWM_OUTEN_PWMX_EN_SHIFT.

Keep in mind that the GPIO_AD_B0_13 is by default used for LPUART. If you want to use this pin, you must also first change its functionality. Let me know if this helps.

 

BR,

Edwin.

0 Kudos
1,235 Views
frankk
Contributor II

Hello,

Im still unable to get a pwm signal out of GPIO_AD_B0_13 (PWMX03). Attached you will find the picture and the pwm example code (minimal example).

PWMX_Issue.PNG

I must correct my answer where I wrote that no matter pinmux setting is configured there is always a pwm signal at GPIO_AD_B0_02 (PWMX00). For instance: If I set PWMX00 in pinmux I can measure a pwm signal. When I change PWMX00 to PWMX01 I could still measure a pwm signal at PWMX00 pin. Changing the GPIO pin in pinmux without doing a power cycle this bahaviour occurs.

Nevertheless, only PWMX00 works properly. There is no PWM signal at GPIO_AD_B0_03 (PWMX01), GPIO_AD_B0_12 (PWMX02) or GPIO_AD_B0_13 (PWMX03).

I think there is no pwm signal routed to these pins chip internally.

Can anybody try the attached code and confirm it? 

Thank you in advance.

Regards,

Frank

 

Edit:

to be sure that this is really the pin (GPIO_AD_B0_13), I configured it to normal gpio and tried the following:

IOMUXC_SetPinMux(
IOMUXC_GPIO_AD_B0_13_GPIO1_IO13,
0U);

IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_13_GPIO1_IO13,
0x10B0u);

GPIO_PinInit(GPIO1, 13, &gpio_config_high);

GPIO_WritePinOutput(GPIO1, 13, 1);

GPIO_WritePinOutput(GPIO1, 13, 0);

GPIO_WritePinOutput(GPIO1, 13, 1);

GPIO is working properly, I can measure the signal goes high and low at J45 jumper.

0 Kudos
1,309 Views
frankk
Contributor II

Hi @EdwinHz ,

thank you for you reply. LPUART1 is disabled in my code.

This is my pinmux setting for pwmx03:

IOMUXC_SetPinMux(
IOMUXC_GPIO_AD_B0_13_FLEXPWM1_PWMX03, 0U);

IOMUXC_SetPinConfig(
IOMUXC_GPIO_AD_B0_13_FLEXPWM1_PWMX03, 0x10B0u);

And here the code line to enable pwmx output:

base->OUTEN |= ((uint16_t)1U << ((uint16_t)PWM_OUTEN_PWMX_EN_SHIFT + (uint16_t)kPWM_Module_0)); */A

Again there is really no pwm signal. As I mentioned before, to measure the pwm signal I disconnected LPUART1 RXD jumper on evalboard and connected the probe to this pinheader (I tried pin1 and pin2).

Only at GPIO_AD_B0_02 I can measure a pwm signal. And by the way no matter what signal is configured in pinmux. For instance if I set GPIO_AD_B0_13 or ..B0_12 or ..B0_02, immediately after enablling by */A there is only a pwm signal at GPIO_AD_B0_02. This is very strange behavior.

Do you have another idea for me please?

0 Kudos