I'm using an Uno to count irregular pulses from an external source. Right now I'm limited to around 7us per pulse, but I'd like to go faster -- much faster. Are there any microcontrollers similar to the ATmega series capable of very high clock frequencies? 200MHz would not be too fast...
Are there any microcontrollers similar to the ATmega series capable of very high clock frequencies?
No there are lots of microcontrollers capable of 200MHz clocks but they are not similar to the arduino, nor do they have the nice arduino environment.
Try the LPC2000 series of microcontrollers.
Try the LPC2000 series of microcontrollers.
A fast CPU clock rate does not necessarily end up meaning the ability to examine (or output to) port pins at high rates. Some of the ARM chips in particular have been dissed as having particularly poor "pin toggle" capabilities.
I you're just COUNTING pulses, there are other ways to get high speeds (a high speed counter is "easy" external logic), and there are also the external clock input to the timer/counter units.
You should be able to do better than 7us pulses even on an Arduino, if you use direct port access rather than the digitalRead() functions. But less than about 2us would probably be tough.
There was a series of microcontrollers (Scenix/Ubicom) that explicitly attacked the "fast pin access" problem, with the aim of doing away with standard peripherals and implementing everything in software (IIRC, they ran 80 to 100MHz.) They failed to survive
An FPGA or CPLD might be applicable as well.
Thanks for the replies. I have tried pulse-counting via direct port access, in a tight loop inside loop()
(sorry, I don't have my code to hand). Even choosing the input-pins to minimise the logic, I can't seem to get much below 25us per pulse. Using interrupts to do the edge-detection gets me down to about 7us per pulse. Forum member Coding-Badly suggested using the timers as counters, and this will be my next line of enquiry (as soon as I can wrap my head around the Atmel docs).
You are much better off using an external TTL counter like a 74F193 and reading the pins on that. These chips can easily count in the hundreds of MHz. Then you only need to periodically sample the count you have.
How long of a burst of 200MHz pulses are you looking to capture?
That's 5 nS pulses, pretty darn quick.
The atmega need a couple of clock cycles to latch in an edge that has changed state - so you're limited to 130-193nS between pulses at best on 2 different pins.
Go to ti.com and search for 'counter', I think you'll have a hard time finding a part that will go that fast.
What are you trying to count?