This will take about 30 microseconds to execute:
int samp = adc1_get_raw((adc1_channel_t)channel2);
So for a hundred microsecond delay do:
for(int loop = 0; loop < 3; loop++)
{
int samp = adc1_get_raw((adc1_channel_t)channel2);
}
It goes without saying that this a workaround for a systematic solution; This delay is jittery, as the higher priority processes will interfere. However, this is a good trick to waste time while waiting for an event to happen. Remember to initialize the A2D (ADC) subsystem.
Need API support to provide micro seconds delay
Re: Need API support to provide micro seconds delay
Hello,
Sorry we can not share as it is for company related product and proprietary as well.
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: Need API support to provide micro seconds delay
Yes. I agree that it will work for microseconds delay but again you need to enable ADC for that in which ADC is not actually used as per product requirement.peterglen wrote: ↑Tue Oct 06, 2020 7:46 pmThis will take about 30 microseconds to execute:
int samp = adc1_get_raw((adc1_channel_t)channel2);
So for a hundred microsecond delay do:
for(int loop = 0; loop < 3; loop++)
{
int samp = adc1_get_raw((adc1_channel_t)channel2);
}
It goes without saying that this a workaround for a systematic solution; This delay is jittery, as the higher priority processes will interfere. However, this is a good trick to waste time while waiting for an event to happen. Remember to initialize the A2D (ADC) subsystem.
But We can use it if really works with all priorities related tasks without any issue.
Regards,
Ritesh Prajapati
Ritesh Prajapati
Who is online
Users browsing this forum: No registered users and 131 guests