Analog read rate, TinyZero slower than TinyDuino ...??

Analog read rate, TinyZero slower than TinyDuino ...??
« on: November 14, 2019, 10:18:59 AM »
I'm doing some testing with a simple loop that reads an input and stores to an integer array. I use micros() before and after the loop of say 10 readings, then after the timing loop I print out the time and the readings for inspection.
I'm getting MUCH faster reading time on the TinyDuino than on the TinyZero, which seems odd because it seems the TinyZero would be faster if anything, or the same if it's just the Analog input speed limit.

I get about 120 microseconds per reading on the TinyDuino
I get about 420 microseconds per reading on the TinyZero
I suppose it could be something different in the analog hardware, but the clock speed should be 8x on the Zero. I'm using default clock speeds and haven't changed any other settings if there are any.

I've tried different loop counts with about the same result. It shouldn't be anything about the serial port because I don't print anything until after the reading loop.
Anyone else know anything about different Analog Input rates for these processors?
What kind of reading speed do you see?

Re: Analog read rate, TinyZero slower than TinyDuino ...??
« Reply #1 on: November 15, 2019, 04:40:01 PM »

The results you're getting are definitely aligned with the accurate speed settings. If you're looking to get faster readings from the SAMD21 (TinyZero) or the ATmega328P (TinyDuino) then you can try using the libraries mentioned in this blog: https://www.avdweb.nl/arduino/adc-dac/fast-10-bit-adc

I hope that helps with whatever you're building!



Re: Analog read rate, TinyZero slower than TinyDuino ...??
« Reply #2 on: November 19, 2019, 05:29:34 PM »
I discovered the difference (probably). The TinyZero ADC is 12 bit A/D and the other is 10 bit so there's probably a basic hardware speed difference.

I wasn't really trying to make it faster. I just didn't know why it was different. I haven't done regular Arduino, only the Tiny products, and I didn't realize before that one needed to go look up the different Arduino models to know the differences between the Tiny products. Makes sense now that I see it.