I am using LPC845 and for reference purpose I am running The lpc_adc_basic example and I want to know how to change sampling rate in given example.
Thank you.
Hi,
As you have seen that the lpc_adc_basic example uses software triggering mode. As you know that the ADC module of LPC845 supports hardware ADC triggering mode, the following screenshot is the ADC triggering sources, so you can use SCT or CTimer module to generate periodic signal to trigger ADC by hardware, the period is totally dependent on the Timer, but the period of the timer must be less than ADC conversion time.
If you want to control the ADC sampling rate, you just need to set up the Timer period. For your case, if you do not need precise sampling rate, you can use Timer to generate constant time interrupt, in the ISR, you can use software trigger mode.
This is a simple code to set up the ADC hardware triggering mode, hope it can help you
Hope it can help you