Hi everybody,Can someone please tell me how much time does getadc(x) command(Basic language) take in microsecond? (8 Mhz oscillator Atmega8)
Thanks.
Thanks.
Put a 50 consecutive getAdc(X) commands together and then toggle an LED on then another 50 reads and then toggle off (100 total per flash). If you can see individual flashes, use an oscilloscope. Adjust the number of reads between toggles.Hi everybody,Can someone please tell me how much time does getadc(x) command(Basic language) take in microsecond? (8 Mhz oscillator Atmega8)
Thanks.
Ingenious idea!Thanks, But There is no oscilloscope!Maybe I can use Incr variable in The loop and toggle pin after for Example var equal to 30 and divide total toggle time to 30.Put a 50 consecutive getAdc(X) commands together and then toggle an LED on then another 50 reads and then toggle off (100 total per flash). If you can see individual flashes, use an oscilloscope. Adjust the number of reads between toggles.
There are lots of options, just develop one that works for you and the tools you have. Loops take a lot of time as well so make sure you account for the core (instruction set) level clock cycles needed for those as well.Ingenious idea!Thanks, But There is no oscilloscope!Maybe I can use Incr variable in The loop and toggle pin after for Example var equal to 30 and divide total toggle time to 30.
Thankks,I am calculating the getadc duration with following code,but I think " incr" takes time too! Green indicates stopwatch start,Red incdicates stop.There are lots of options, just develop one that works for you and the tools you have. Loops take a lot of time as well so make sure you account for the core (instruction set) level clock cycles needed for those as well.
I am surprised that documentation is not available for your question but it may be easier to measure. If you have enough program memory, you may be able to measure with a stopwatch to some reasonable level of accuracy. 5000 or 50000 ADC steps per LED toggle.
0.5 cycle and 1 peakDigitize a 500Hz square wave signal and see how many high samples you get in 1ms duration.
Wrong answer.0.5 cycle and 1 peak
by Duane Benson
by Duane Benson
by Jake Hertz