Counting PWM pulses

Hello .
I i need to count PWM pulses with Arduino. I need to know if i can count PWM pulses with Arduino from itself. I mean one of PWM output of Arduino produce pulses and another pin of Arduino count this pulses.
Picture below show the electrical connection between arduino pins.
For example PWM pin no 3 produce PWM pulses with a frequency and digital pin 12 count pulses from pin 3.
Another thing. How much is the maximal frequency of PWM pulses from Arduino?
Thank you

1 Like

The attached example will count pulses and duty cycle of PWM.

Frequency_Counter.ino (2.74 KB)

Riva thank you
so its possible to make the connection as in photo tha i sended to you?
Creating PWM pulses from arduino and then counting those pulses with arduino?
First i should activate the pwm from arduino and then counting those pwm pulses in another pin of arduino

see the attached picture

ArduinoUno_R3_Front_450px.jpg

Fation:
Riva thank you
so its possible to make the connection as in photo tha i sended to you?
Creating PWM pulses from arduino and then counting those pulses with arduino?
First i should activate the pwm from arduino and then counting those pwm pulses in another pin of arduino

With the code I supplied no it is not possible with those pins.
The code is written to read the signal on INT pins (pins 2 and 3 on an UNO) but it will not read on any other pins. Why those specific pins? Can you generate the PWM on pin 3 and read it on pin 2.

Hallo Fation..
you can check also my post, maybe it helps you a bit..

The answers after reply #10 are more relevant to what you are looking I think!
I used a jumper between pin 11(pwm) and pin2.