Interrupts problem on arduino UNO

Hi
i have some problem with Interrupts
What its max Interrupts frequency ?? I want to use Interrupts for counting impulse and then show number on LCD code work when i manually touch Interrupts pin. But not working when connecting it to signal source that is max 25 Khz and 12 us minimum pulse width.
It's that mean that UNO is to slow for this ?? Is Due can handel this ??

#include <LiquidCrystal.h>
#include <SoftwareSerial.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
  int x,y,z,spindle ;
 
void setup() {
  // set up the LCD's number of columns and rows: 
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.setCursor(0,0);
  lcd.print("X=");
    lcd.setCursor(0,1);
  lcd.print("Y=");
     lcd.setCursor(8,0);
  lcd.print("Z=");
      lcd.setCursor(8,1);
  lcd.print("SPIN=");
  lcd.setCursor(13,1);
    lcd.print("OFF");

    int pin = 2;
    int pin2 = 3;
    pinMode(pin, OUTPUT);
    pinMode(pin2, OUTPUT);    
    attachInterrupt(digitalPinToInterrupt(pin), Interrupts1, RISING);
    attachInterrupt(digitalPinToInterrupt(pin2), Interrupts2, RISING);
}
void loop() {

lcd.setCursor(3,0);
lcd.print(x);
lcd.setCursor(3,1);
lcd.print(y);

    }    //

   
    
void Interrupts1(){
x++;
}

void Interrupts2(){
y++;
}

That task should be viable for an Uno, you've got 172 clock cycles just to increment a number, and enter and exit an interrupt routine. That should be doable.

What is it doing instead of working? Describe the symptoms.

That code is not going to work reliably because the interrupts and foreground code are both using x and y, neither of which is declared volatile, and neither of which is protected from being modified AS they are being read to be displayed. You need to disable interrupts when reading them, or make them 8-bit instead of 16-bit variables.

Regards,
Ray L.

When i manually connect interrupts pin to VCC value of X is increasing so code is working but when connect to signal source it's nothing happen and the value is not changing

this is screen showing how input signal looks

That says you're getting 359.9 pulses per second....

Regards,
Ray L.

it that to much for Uno ??

it that to much for Uno ??

No.

Are you really feeding 7V into your Uno?

so anyone can help me with this ??

But not working when connecting it to signal source that is max 25 Khz ...

Yes, I'm sure you can turn the dial up to 25 kHz. What is the current frequency?

so anyone can help me with this ??

You can start by replying to my question in reply #7. Do you really think you can ignore questions, and then post a reply demanding more help?

Could be a ringing artifact of 'scope probe ground lead...

Hi
sorry for that,
it's not 7V i think that was scope probe fault i have use another one please check photo.
I also connect 1khz signal from signal generator but still not working.

thank you all for help
the volatile not change anything, as there was error in code i have duble check every thing with Reference and i make a mistake

i need to change
pinMode(pin, OUTPUT); // in reference that was for LED pin not for Interrupts pin
to
pinMode(pin, INPUT_PULLUP);

and now it's seems that it work ok