Hi again, @HARINI_T!
I see your while look is constantly polling for the status of the three GPIO inputs, and updating the PWMs accordingly. When you mention:
“Without the code inside the while loop, the output is obtained as per the table”, where would you place the trigger, if at all? Do you mean you would only do a single trigger, the output would be reflected, and then no update would be done and the PWM configurations would be soft-locked into a single state?
I believe the polling might be being done a little bit too often, not giving the trigger enough time to properly update all of the registers and ending up with unexpected results like the ones you mention.
The better solution would be to update the PWMs and generate a trigger, only when a GPIO changes (interrupt based solution) instead of constantly polling the GPIOs and creating triggers to fast (current implementation). This way, you ensure that the register buffers get enough time to refresh their values and set them properly on the FTM module without mistake.
BR,
Edwin.