Hi Sandeep Mittal,
If you want to use the ADC with a sample frequency, you need to set up a timer with this frequency. In the SDK example the trigger is using the function: ADC_DoSoftwareTrigger. For you're aplication you will need to change it for a timer trigger.
You can use the adc interrupt driver example in the SDK and change the source of the trigger, in this case I'm using the CTIMER3_OUT2:
You'll need to set up this timer, so I suggest to you to check the ctimer simple match driver example. For the 400Hz frequency, you'll need to change the match value, the following configuration should do it:
Hope it helps,
Alexis Andalon
Hi Sandeep Mittal,
If you want to use the ADC with a sample frequency, you need to set up a timer with this frequency. In the SDK example the trigger is using the function: ADC_DoSoftwareTrigger. For you're aplication you will need to change it for a timer trigger.
You can use the adc interrupt driver example in the SDK and change the source of the trigger, in this case I'm using the CTIMER3_OUT2:
You'll need to set up this timer, so I suggest to you to check the ctimer simple match driver example. For the 400Hz frequency, you'll need to change the match value, the following configuration should do it:
Hope it helps,
Alexis Andalon
Hi Sandeep Mittal,
In this case I didn't enable the interrupt for the CTimer, only the ADC one. The ADC trigger is configured in the structure and this is enough to link the ADC with the CTimer. In case you want to call the CTimer Callback you should change that register.
BUS_CLK_FREQ is the APB bus clock = 16MHz
Best Regards,
Alexis Andalon
Hi Sandeep Mittal,
Have in count that the matchValue is the value where the counter is gonna trigger the interruption. Doesn't really matter what is your Bus Clock, if you divide it by the desired frequency that should work.
Best Regards,
Alexis Andalon