Trying to get SM0VAL4 trigger from PWM to ADC ETC and found no trigger is coming to ADC ETC. As troubleshooting I tried to read the counter register SM0SMCNT. please find attached image named SM0SMCNT.jpeg. Is this an expected counter response(a sudden jump in the middle from 6000 to 60000)?.Also, there is no duty cycle response in the FreeMaster .
In addition, I tried to run the pwm_center_aligned example from the model based design tool box and I couldn't get any response in the FreeMaster either. what could be wrong?
Hi @xiangjun_rong ,
I verified the value4 trigger is enabled in PWM2_submodule 0 trigger control register through Freemaster software. please refer the below screen capture on read back values of that register other config registers for PWM and ADC ETC. Also the trigger is mapped to ADC_ETC. Please refer the attached image named ADC_ETC. Its still not working
Hi,
Pls make sure that the sub-module of FlexPWM module is working, for example the PWM can output PWM signal.
You can copy the SDK PWM example to this project
BR
XiangJun Rong
Hi,
There is FlexPWM module example in SDK package in the driver_examples, I suppose that you can copy the driver and application code to the ADC-ETC example.
Hope it can help you
BR
XiangJun Rong
Hi,
I suppose that you can refer to the ADC example adc_etc_hardware_trigger_conv:
Pls just change the void XBARA_Configuration(void) so that the PWM triggering can trigger ADC
void XBARA_Configuration(void)
{
/* Init xbara module. */
XBARA_Init(DEMO_XBARA_BASE);
/* Configure the XBARA signal connections. */
//XBARA_SetSignalsConnection(DEMO_XBARA_BASE, DEMO_XBARA_INPUT_PITCH0, //DEMO_XBARA_OUTPUT_ADC_ETC);
XBARA_SetSignalsConnection(DEMO_XBARA_BASE, kXBARA1_InputFlexpwm1Pwm1OutTrig01, DEMO_XBARA_OUTPUT_ADC_ETC);
}
while you have to set the PWM trigger register so that the VALUE4 register of PWM can trigger ADC.
Hope it can help you
BR
XiangJun Rong