Does arduino have hardware counters?

I've worked directly with microprocessors before but lately moved to Arduino as it's so much easier, simpler and faster plus better library support. I was doing a project where I need to count 5V pulses. I was assuming Arduino would have hardware counters but I've done a bit of research and can't find anything. Do any Arduino devices support hardware counters? I'm specifically using Wemos d1 mini pro but have a few other Arduino boards I could use. Basically I'm open to anything that has hardware counters and Wifi. I just need a single digital input, count the pulses and send out the counter every 1 second.

Thanks

16 bit TIMER1 on the lowly Uno can count external pulses without CPU intervention, if that is what you are looking for.

You would be hard pressed to find a modern MCU without timer/counter registers. Do check the data sheets.

The Arduino Nano 33 IoT has WiFi, plenty of counters and lots of other goodies.

https://store.arduino.cc/arduino-nano-33-iot

[quote author=datasheet Microchip SAM D21 Family]
– Up to five 16-bit Timer/Counters (TC), configurable as either:
• One 16-bit TC with two compare/capture channels
• One 8-bit TC with two compare/capture channels
• One 32-bit TC with two compare/capture channels, by using two TCs
– Up to four 24-bit Timer/Counters for Control (TCC), with extended functions:[/quote]

What you need to understand is that the Arduino boards are just standard microcontrollers on a PCB with support components and accessories. Arduino code is just C++ with a high level library abstracting the code to make it easier for beginners and more portable to any platform. You can still do everything you would without Arduino. It's just wrapped up in a beginner-friendly package.

So don't feel the need to restrict all your searches with the "arduino" search term. You can get relevant information from non-Arduino-specific references such as the microcontroller datasheet and the toolchain documentation.

Thanks everyone for the replies.

jremington:
16 bit TIMER1 on the lowly Uno can count external pulses without CPU intervention, if that is what you are looking for.

You would be hard pressed to find a modern MCU without timer/counter registers. Do check the data sheets.

That was my thoughts too, somehow the pages I hit on when I searched no one seemed to know about counters. I did check the datasheet for the ESP-8266EX but it didn't even mention counters and it's only 30 pages long.

The ESP8266EX uses a proprietary 32 bit processor, with little to no information publicly available. Cadence Tensilica L106 - Everything ESP8266.

If you want to get into the details of hardware programming, obviously you are better off using MCUs with complete, publicly available documentation.

There is available a well documented ESP8266 API.

The ESP32, also with a well documented API, has WiFi and hardware counters

The pulse cpunter Pulse Counter - ESP32 - — ESP-IDF Programming Guide latest documentation for the ESP32:

The PCNT (Pulse Counter) module is designed to count the number of rising and/or falling edges of an input signal. Each pulse counter unit has a 16-bit signed counter register and two channels that can be configured to either increment or decrement the counter. Each channel has a signal input that accepts signal edges to be detected, as well as a control input that can be used to enable or disable the signal input. The inputs have optional filters that can be used to discard unwanted glitches in the signal.

Haven’t encountered counters in the ESP8266 yet… maybe they do exist but documentation is notoriously poor.

The Arduino (ATmega328p) has hardware counters. I think also timer0 and timer2 have external clock/counter inputs. Haven’t used those, have used Timer1 which I’ve had counting at speeds of up to about 6 MHz. The limit is fclk/2, so 8 MHz on a 16 MHz processor clock.

jremington:
The ESP8266EX uses a proprietary 32 bit processor, with little to no information publicly available. Cadence Tensilica L106 - Everything ESP8266.

If you want to get into the details of hardware programming, obviously you are better off using MCUs with complete, publicly available documentation.

Ah! So it's not just me. I've found another show stopper with the wemos in that the single analog input is completely useless. It's a good 8% out and wanders around like a drunk coming home from the pub.

MikeKulls:
It's a good 8% out and wanders around like a drunk coming home from the pub.

As it uses a fixed, internal reference you may have to calibrate it (like the Arduino's internal reference), and if you want to use it for ratiometric measurements you better make really sure Vcc is really constant as well or its readings will be unstable indeed.

Lets confine the discussion of the analog issue to the dedicated topic MikeKulls created about it:

Oh, great. So this hijack was actually a cross post.

Microprocessor: Single chip; it does not contain peripheral controllers and memory space; but, it can access a large space of external memory and IO space using bus lines.

Microcontroller: Single chip; it contains commonly used peripheral controllers and memory space.

Internal Counter Structure of ATmega328P MCU of Arduino UNO Board.