Hello everyone,
I’m running using an Apalis IMX8QM mounted on a V1.2 Ixora board and would like to try and generate some different PWM outputs, I have tried the following:
using the TPM module to generate a PWM signal, which is mostly working but doesn’t work when I set the frequency at 10Hz in this function TPM_SetupPwm(BOARD_TPM, &tpmParam2, 1U, kTPM_EdgeAlignedPwm, 200U, TPM_SOURCE_CLOCK); // change 200U to 10U and it doesn't work
Second problem is that if I try to generate two PWM signals on both the TPM channels, the channels are driven with the highest frequency, so for example:
TPM_SetupPwm(BOARD_TPM, &tpmParam, 1U, kTPM_EdgeAlignedPwm, 100U, TPM_SOURCE_CLOCK);
TPM_SetupPwm(BOARD_TPM, &tpmParam2, 1U, kTPM_EdgeAlignedPwm, 200U, TPM_SOURCE_CLOCK);
// both set at duty cycle 10%
will output the following signal:
where the frequency of both signals are now at 200Hz, and 100Hz signal duty cycle is doubled. you can find the source code here:
tpm_timer.c (5.3 KB)
I would need both signals to have their own periods/frequencies. I think the 10Hz signal is not working due to some clock issue, I’m discovering the imx8 so maybe I am configuring things wrong.
Anyways, the main question here is that I wanted to test the PWM module instead of the TPM and see what happens, but there is no pwm driver in the SDK 2.9 from NXP, I have seen this two-year old Generate PWM from M4 Apalis iMX8 thread but the files that the user uploaded only contains the PWM_Setup function and non of the rest in this API, and I thought to ask as maybe there are some new driver that I can’t find
Using the PWM module will be my main choice even if it has the same implementation of the TPM modules as the Ixora board has 4xPWM channels/pins and only 2xTPM channels/pins
I’m not sure if this question lies within the scope of Toradex support, I also posted on the NXP forums but they are very slow to respond, let me know if this is out of scope and close the thread.
Thank you