I am trying to generate PWM using CTimer but there isn't any sample code provided by NXP. I am using RW6xx series MCU. Could you help me with this?
Hello,
Thank you in advance for contacting NXP support.
As this product has not been yet released t mass market the only information we have available is the one you can find in the product page or SDK release.
By any chance do you already have a board with you of the RW6xx?
Thank you for the response.
Yes, I do have the RW6xx EVKit with me.
Let me explain the scenario:
1. I flashed the zephyr blinky_pwm sample to the nRF5340 development kit. It works as expected since the logic analyzer output shows frequency being doubled after every 4 seconds.
2. I tried the same sample on NXP RW6xx EVKit. I added an overlay file where I used the SCTimer to generate the PWM. I used channel 9. But this output isn't the same as the Nordic board. After digging into the driver code, I got to know that the driver itself is designed such that it will generate 2 events for every frequency change. Since there are a total of 16 events, this causes the driver to throw an error since the events get used after frequency is changed 8 times. There is a fix in the zephyr repo https://github.com/zephyrproject-rtos/zephyr/pull/66301 but I am not sure why this wasn't included in the NXP release. If I modify the sctimer driver code as per the Zephyr PR, then the behavior is identical to the Nordic board. Due to the above issue, I thought of trying CTimer to generate the PWM.
Any guidance as per the above scenario would be helpful.
Hello,
I just send you a private message, can you please help me checking this.