Dear All ,
I am trying to generate two different PWM signals one for clock and the other one for generating a Single pulse to trigger an output for that i need to generate two different periods i am using PWM module 0 and PWM module 1
here is the code for the same
GPIOPinTypePWM(GPIO_PORTE_BASE, GPIO_PIN_5);
GPIOPinConfigure(GPIO_PE5_M1PWM3);
PWMGenConfigure(PWM1_BASE, PWM_GEN_0,PWM_GEN_MODE_DOWN|PWM_GEN_MODE_NO_SYNC );
PWMGenConfigure(PWM1_BASE, PWM_GEN_1,PWM_GEN_MODE_DOWN|PWM_GEN_MODE_NO_SYNC);
PWMGenPeriodSet(PWM1_BASE, PWM_GEN_0, 60);
PWMGenPeriodSet(PWM1_BASE, PWM_GEN_1, 60);
PWMPulseWidthSet(PWM1_BASE, PWM_OUT_0, 30);
PWMPulseWidthSet(PWM1_BASE, PWM_OUT_1, 57);
PWMOutputState(PWM1_BASE, PWM_OUT_0_BIT|PWM_OUT_1_BIT, true);
PWMOutputInvert(PWM1_BASE, PWM_OUT_1_BIT, true);
PWMGenEnable(PWM1_BASE, PWM_GEN_0);
PWMGenEnable(PWM1_BASE, PWM_GEN_1);
PWMIntEnable(PWM1_BASE, PWM_INT_GEN_1);
PWMGenIntTrigEnable(PWM1_BASE, PWM_GEN_1,PWM_INT_CNT_LOAD);
PWMGenConfigure(PWM0_BASE, PWM_GEN_0,PWM_GEN_MODE_DOWN|PWM_GEN_MODE_NO_SYNC );
PWMGenConfigure(PWM0_BASE, PWM_GEN_1,PWM_GEN_MODE_DOWN|PWM_GEN_MODE_NO_SYNC );
PWMGenPeriodSet(PWM0_BASE, PWM_GEN_0, 7000);
PWMGenPeriodSet(PWM0_BASE, PWM_GEN_1, 7000);
PWMPulseWidthSet(PWM0_BASE, PWM_OUT_0, 30);
PWMPulseWidthSet(PWM0_BASE, PWM_OUT_1, 57);
PWMOutputState(PWM0_BASE, PWM_OUT_0_BIT|PWM_OUT_1_BIT, true);
PWMOutputInvert(PWM0_BASE, PWM_OUT_1_BIT, true);
PWMGenEnable(PWM0_BASE, PWM_GEN_0);
PWMGenEnable(PWM0_BASE, PWM_GEN_1);
the out that i am getting the same period for both the PWM module the out put pins are
GPIOPinTypePWM(GPIO_PORTD_BASE, GPIO_PIN_0);
GPIOPinConfigure(GPIO_PD0_M1PWM0);
GPIOPinTypePWM(GPIO_PORTD_BASE, GPIO_PIN_1);
GPIOPinConfigure(GPIO_PD1_M1PWM1);
GPIOPinTypePWM(GPIO_PORTB_BASE, GPIO_PIN_6);
GPIOPinConfigure(GPIO_PB6_M0PWM0);
pls help me i am struck with thie problem
with regards
Vijay