The clock speed of the zero is 48 mhz 3 times faster than the uno
Does this mean it can count 3x more pulses per sec than an uno ?
Can the uno be overclocked so it can count more pukses per sec ?
I want to count approx 6000 pulses per second
The clock speed of the zero is 48 mhz 3 times faster than the uno
Does this mean it can count 3x more pulses per sec than an uno ?
Can the uno be overclocked so it can count more pukses per sec ?
I want to count approx 6000 pulses per second
Uh, you should be able to do 6k pulse per sec on a '328.... You may have to write your code carefully (direct port manipulation? Maybe), and probably use interrupts, in order to count 6000 pulses per second (I think you can take over a timer and count faster pulses still, but that's a bit more complicated) Hell, call it 8k, you're saying you can't count a pulse with two thousand clock cycles?! How much processing are you doing for each pulse?
Atmega328p can be run at 20mhz within spec, and IIRC 24mhz usually works (at least at typical conditions).
Anyway...
The speed is not directly comparable because they have different instruction set, though the zero should be faster. Be aware of some of the limitations on the Zero (output current limit, 3.3v etc).
Gadget999:
I want to count approx 6000 pulses per second
The Atmega328 at 16 MHz can easily handle 6000 hardware interrupts per second.
I think that even 40000 interrupts per second would be possible.
So if your task is just counting digital pulses, an Atmega328 based board can do it.
And if the only task is "counting pulses on a single pin", I think with some low-level programming you can count up to frequencies of 1 MHz using an Atmega328.
And if the only task is "counting pulses on a single pin", I think with some low-level programming you can count up to frequencies of 1 MHz using an Atmega328.
Using the external clock input mode of Timer0 or 1 on an ATmega328, you can count pulses up to about 6 MHz (Fclk_I/O/2.5).
This reminds me of the days when people compared the 3.79 MHz Z80 to the 1 MHz 6502 and thought it ran almost 4 times faster.
Those were the days.
Except that a 48MHz ARM probably is really 3x faster than a 16MHz AVR. More than that, for a lot of things (addition of two 32 bit numbers on the stack: about 20 clock cycles for AVR, 5 clock cycles for ARM M0.)
I want to count approx 6000 pulses per second
However, this may be a case where the ARM is NOT faster than the AVR. At least not without careful programming.
Checking an IO bit on AVR (best case): 2 cycles. On an ARM: 4 to 6 cycles. And interrupts on an ARM are potentially higher overhead (or lower, in other cases.) As people have said in this and other threads, it really depends on exactly what you mean by "count pulses", and you haven't really said. For high speed pulse counting, you can sometimes use the counter/timer peripherals (possibly interferes with other arduino functions, though.) The AVR has three counter/timers. The D21 has nine, sort-of...
Gadget999:
I want to count approx 6000 pulses per second
Cross-posted here: 80 mhz arduino ! - #24 by Gadgeroonie - Microcontrollers - Arduino Forum
Gadget999:
I want to count approx 6000 pulses per second
In the other thread I showed you can count 8 MHz, so yes, you can count 6 kHz.