Arduino Due problem/ Serial Monitor Takes amount but goes crazy!

Hi all

Here is the code for Arduino Due:

volatile boolean l;
//unsigned int integerValue=0;  // Max value is 65535
//char incomingByte;

void TC0_Handler()
{
  
    long dummy=REG_TC0_SR0; // vital - reading this clears some flag    --- Status REG
                            // otherwise you get infinite interrupts
    l= !l;
    //REG_TC0_CCR0=0b101; //Start counter
}


//void setFrequen


void setup(){
  Serial.begin(57600);
  pinMode(13,OUTPUT);
   
}


void loop(){
    
       digitalWrite(13,l);

          

 if (Serial.available() > 0) {   // something came across serial
 
   char buffer[] = {' NUL',' NUL',' NUL',' NUL',' NUL',' NUL',' NUL',' NUL',' NUL'}; 

 Serial.readBytesUntil('\n', buffer, 20);
int  incomingValue = atoi(buffer);

   Serial.println(incomingValue);
   pinMode(2,OUTPUT);    // port B pin 25  
  analogWrite(2,255); 
   REG_PIOB_PDR = 1<<25; // disable PIO, enable peripheral
  REG_PIOB_ABSR= 1<<25;
     REG_TC0_CMR0=0b00000000000010011100010000000000;
  REG_TC0_IER0=0b00010000; 
  
  REG_TC0_RC0 = incomingValue*1000000;
  NVIC_EnableIRQ(TC0_IRQn);
 }
  
 
    
    
       
}

When I change the amount of " REG_TC0_RC0" by increasing the number for example from 1 -20 it goes properly

but when I come back to the “1” for example

1
8
1

It takes time to change the blinking time.

What do you think?
Do I need to initialize any other REG to have this job done?

Is my Serial Monitor adjusted properly?

Thanks for your guide in advance.