Hi, @Er_AK ,
First of all, I apologize for the delayed response. You could find attached a possible solution for your application, which I will describe below:
1. PWM channel 0 configuration
- configured based on instance eMIOS 0 channel 9;
- has a default period set to 64000 ticks;

- based on the eMIOS instance, has assigned PwmEmiosChannels_9 configuration;
- flag generation is set to Both_Trailing_and_Leading_Edge, meaning that the Interrupt Callback Notification will be triggered at each edge (rising and falling edge);

- configured based on EmiosCommon_0, which uses a clock divider value of 125;
- uses EmiosMclMasterBus_0 (EMIOS_CH_23), with a default period of 64000;

2. PWM channel 8 configuration
- configured based on instance eMIOS 2 channel 7;
- has a default period set to 640 ticks;

- based on the eMIOS instance, has assigned PwmEmiosChannels_7 configuration;

- configured based on EmiosCommon_2, which uses a clock divider value of 125;
- uses EmiosMclMasterBus_0 (EMIOS_CH_23), with a default period of 640;

3. Simulink application

The Simulink application consists of:
3.1. Initialize subsystem where the notifications are enabled for the PWM channels:

3.2. Main application:
- the PWM Channel 0 generates the signal based on the above configuration;
- the edgeFlag variable is initially set to 0, and its purpose is to detect the edge of the generated PWM;
3.3. Hardware Interrupt Callback:

- the RGBLED0_BLUE is toggling at each interrupt callback trigger, and its purpose is to follow the PWM signal;
- when the edgeFlag is set to 1, a Rising Edge is detected on the PWM Channel 0, and the PWM Channel 8 starts to generate the signal based on the above configuration; the edgeFlag is set to 0;

- when the edgeFlag is 0, a FallingEdge was detected on the PWM Channel 0 and the PWM Channel 8 stops the generation of the signal; the edgeFlag is set to 1;

4. Connections
To be able to validate the results, you should connect the Logic Analyzer to the following pins:
- PTA1: PWM0 set to emios_0_ch_9_ch
- PTD26: PWM8 set to emios_2_ch_7_ch
- PTA31: RGBLED0_BLUE

5. Results
Based on the above configuration, the PWM signals will be defined as follows:



6. Conclusion
The PWM Channel 0 will generate a PWM signal with a 20 Hz frequency. At each PWM Channel 0 edge change, the RGBLED0_BLUE is toggling, and based on a flag initially set to 0, the PWM edge that triggered the interrupt callback is determined. When a rising edge is detected, PWM Channel 8 starts to generate a PWM signal with a 2 kHz frequency. When a falling edge is detected, PWM Channel 8 stops to generate the PWM signal.
I hope this application helps you achieve your goal.
Best regards,
Dragos