Why I can't recognise RF signal manually?

Before at all, sorry for my english (pending to improve) and the spanish comments on pictures.

Good morning. Im trying to develop a board that substitute the original garage door opener board, that works with a RF receiver. Now i'm working with that original RF received diswelded from the original board, and the original RF control, so the paire netween both emissor and receptor should be fine.

When I measure receiver signal with a arduino oscylloscope I obtain the followin signals:

When not preess the RF control
Image text: "Not keep pressing RF button data"

When keeps pressing RF control button
Image text: "Keep pressing RF data"

When stops pressing RF control button (Larger scale than both previous pictures)
Image text from lefft to right: "RF control data received", "Silent made by stop pushing RF control", "Random data when not pushing RF control"

I tried to use some examples and libraries seen in that forum and google-youtube searches (rc-switch, radiohead, some codes developed by another users, etc) but I cant recognise the original RF control and another two RF controls I've got in my house, so I dont know if the problem is i'm using a specific brand hardware (Avidsen). So I decided to obtain manually RF data developing this simple software:

uint32_t tiempo_inicio = 0; //this variable stores the initial micros() in a CHANGE interruption
uint32_t tiempo_fin = 0; //this variable stores the final micros() in a CHANGE interruption
uint32_t duracion_pulso = 0; //this variable will store the diff between both previous variables
bool valor = LOW; //this variable will store the value in pin 2
#include <stdlib.h>

void setup() {
  pinMode(2,INPUT);
  Serial.begin(9600);
  attachInterrupt(digitalPinToInterrupt(2),interrupcion,CHANGE); //define the interruption
}

void loop() {
}

void interrupcion(){
  valor = digitalRead(2); //read the pin 2
  tiempo_fin = micros(); //read the current time
  duracion_pulso = tiempo_fin-tiempo_inicio; //calculate the time betweeen last interruption and now
  tiempo_inicio = tiempo_fin; //store the new interruption time
  Serial.print("\nValor: ");
  Serial.print(valor);
  Serial.print(", duracion: ");
  Serial.print(duracion_pulso); //print all measures
}

But I cant recognise the large zero bade by the stop pushing RF controller, and the data dont have any sense. Serial:

Valor: 0, duracion: 380
Valor: 1, duracion: 4294966660
Valor: 0, duracion: 496
Valor: 0, duracion: 4294966652
Valor: 0, duracion: 500
Valor: 1, duracion: 384
Valor: 1, duracion: 4294966656
Valor: 1, duracion: 496
Valor: 0, duracion: 4294966656
Valor: 0, duracion: 496
Valor: 1, duracion: 4294966652
Valor: 0, duracion: 500
Valor: 0, duracion: 384
Valor: 0, duracion: 4294966656
Valor: 0, duracion: 496
Valor: 0, duracion: 4294966656
Valor: 0, duracion: 496
Valor: 0, duracion: 4294966652
Valor: 0, duracion: 500
Valor: 0, duracion: 384
Valor: 1, duracion: 4294966656
Valor: 0, duracion: 496
Valor: 0, duracion: 4294966656
Valor: 1, duracion: 496
Valor: 0, duracion: 380
Valor: 1, duracion: 4294966660
Valor: 0, duracion: 496
Valor: 0, duracion: 4294966652
Valor: 0, duracion: 496
Valor: 0, duracion: 4294966660
Valor: 1, duracion: 496
Valor: 1, duracion: 384
Valor: 0, duracion: 4294966656
Valor: 1, duracion: 496
Valor: 1, duracion: 4294966656
Valor: 0, duracion: 496
Valor: 0, duracion: 4294966656
Valor: 0, duracion: 496
Valor: 0, duracion: 384
Valor: 1, duracion: 4294966656
Valor: 0, duracion: 496
Valor: 0, duracion: 4294966656
Valor: 1, duracion: 496
Valor: 0, duracion: 380
Valor: 0, duracion: 4294966660
Valor: 0, duracion: 496
Valor: 1, duracion: 4294966656
Valor: 1, duracion: 492
Valor: 0, duracion: 4294966660
Valor: 0, duracion: 496
Valor: 0, duracion: 384
Valor: 0, duracion: 4294966656
Valor: 1, duracion: 496
Valor: 0, duracion: 4294966652
Valor: 0, duracion: 500
Valor: 1, duracion: 4294966656
Valor: 0, duracion: 496
Valor: 1, duracion: 384
Valor: 0, duracion: 4294966656
Valor: 1, duracion: 496
Valor: 1, duracion: 4294966652
Valor: 1, duracion: 500
Valor: 0, duracion: 384
Valor: 1, duracion: 4294966656
Valor: 0, duracion: 492
Valor: 1, duracion: 4294966660
Valor: 0, duracion: 496
Valor: 0, duracion: 4294966652
Valor: 1, duracion: 500
Valor: 0, duracion: 384
Valor: 0, duracion: 4294966656
Valor: 0, duracion: 492
Valor: 1, duracion: 4294966660
Valor: 0, duracion: 496
Valor: 0, duracion: 4294966652
Valor: 0, duracion: 500
Valor: 1, duracion: 384
Valor: 0, duracion: 4294966656
Valor: 1, duracion: 492
Valor: 0, duracion: 4294966660
Valor: 0, duracion: 496
Valor: 0, duracion: 380
Valor: 0, duracion: 4294966660
Valor: 0, duracion: 496
Valor: 1, duracion: 4294966652
Valor: 1, duracion: 500
Valor: 0, duracion: 4294966656
Valor: 0, duracion: 496
Valor: 0, duracion: 380
Valor: 0, duracion: 4294966660
Valor: 0, duracion: 496
Valor: 0, duracion: 4294966652
Valor: 0, duracion: 500
Valor: 1, duracion: 4294966656
Valor: 1, duracion: 496
Valor: 1, duracion: 380
Valor: 0, duracion: 4294966660
Valor: 1, duracion: 496
Valor: 1, duracion: 4294966652
Valor: 0, duracion: 500
Valor: 0, duracion: 384
Valor: 1, duracion: 4294966656
Valor: 0, duracion: 496
Valor: 1, duracion: 4294966656
Valor: 0, duracion: 496
Valor: 0, duracion: 4294966652
Valor: 1, duracion: 500
Valor: 0, duracion: 384
Valor: 0, duracion: 4294966656
Valor: 0, duracion: 496
Valor: 1, duracion: 4294966656
Valor: 0, duracion: 496
Valor: 1, duracion: 4294966652
Valor: 0, duracion: 500
Valor: 1, duracion: 384
Valor: 0, duracion: 4294966656
Valor: 0, duracion: 496
Valor: 0, duracion: 4294966656
Valor: 0, duracion: 496
Valor: 0, duracion: 380
Valor: 0, duracion: 4294966660
Valor: 0, duracion: 496
Valor: 1, duracion: 4294966652
Valor: 1, duracion: 496
Valor: 0, duracion: 4294966660
Valor: 0, duracion: 496
Valor: 0, duracion: 384
Valor: 1, duracion: 4294966656
Valor: 0, duracion: 496
Valor: 0, duracion: 4294966656
Valor: 0, duracion: 496
Valor: 0, duracion: 4294966656
Valor: 1, duracion: 496
Valor: 0, duracion: 384
Valor: 0, duracion: 4294966656
Valor: 1, duracion: 496
Valor: 1, duracion: 4294966656
Valor: 0, duracion: 496
Valor: 0, duracion: 380
Valor: 1, duracion: 4294966660
Valor: 0, duracion: 496
Valor: 1, duracion: 4294966656
Valor: 0, duracion: 492
Valor: 0, duracion: 4294966660
Valor: 1, duracion: 496
Valor: 1, duracion: 384
Valor: 0, duracion: 4294966656
Valor: 0, duracion: 496
Valor: 1, duracion: 4294966652
Valor: 1, duracion: 500
Valor: 0, duracion: 4294966656
Valor: 0, duracion: 496
Valor: 1, duracion: 384
Valor: 0, duracion: 4294966656
Valor: 0, duracion: 496
Valor: 0, duracion: 4294966652
Valor: 0, duracion: 500
Valor: 1, duracion: 384
Valor: 0, duracion: 4294966656
Valor: 0, duracion: 492
Valor: 1, duracion: 4294966660
Valor: 1, duracion: 496
Valor: 0, duracion: 4294966652
Valor: 0, duracion: 500
Valor: 0, duracion: 384
Valor: 1, duracion: 4294966656
Valor: 1, duracion: 492
Valor: 0, duracion: 4294966660
Valor: 0, duracion: 496
Valor: 0, duracion: 4294966652
Valor: 0, duracion: 500
Valor: 1, duracion: 384
Valor: 0, duracion: 4294966656
Valor: 1, duracion: 492
Valor: 1, duracion: 4294966660
Valor: 0, duracion: 496
Valor: 0, duracion: 380
Valor: 1, duracion: 4294966660
Valor: 0, duracion: 496
Valor: 1, duracion: 191308
Valor: 0, duracion: 484
Valor: 1, duracion: 13816
Valor: 0, duracion: 436
Valor: 0, duracion: 208
Valor: 1, duracion: 388
Valor: 1, duracion: 380
Valor: 1, duracion: 4294966660

As you can see, I dont find in any row the large silent en the end of receiving RF control data, silent that I would use to recognise the data sent by the RF control (is the larger silent made by the receiver and I think is the key to decode the control). I ont know if I'm doing something wrong in the code (i'm very noob at programming Arduino, onli a few times in the university and some personal simple projects) but I can't see the mistake.

If you can help me, I wold be very grateful. Thanks in advance.

the interrupt service routine (ISR), interrupcion(), may miss events because you are doing serial prints from inside the ISR().

try using an array to capture timestamps (micros()) in the ISR(). loop() can monitor the index into the array to determine activity. possibly comparing the time of the last entry to the current time

gcjr:
the interrupt service routine (ISR), interrupcion(), may miss events because you are doing serial prints from inside the ISR().

try using an array to capture timestamps (micros()) in the ISR(). loop() can monitor the index into the array to determine activity. possibly comparing the time of the last entry to the current time

I don't understand the loop part you recommend me. I think you recommend me to save digital input and timestamp in two arrays and use loop to print in serial port the results. Can you confirm me? Tks

Instead of printing the intervals from the ISR, you must relay that work to the loop:

//Pseudocode

last_us = 0;
current_us = 0;

ISR {
  //Store us
  current_us = micros();
}

loop {
  //Copy current us
  cli();
  us = current_us;
  sei();

  //Print if changed and store
  if (us != last_us)
  {
    interval = us - last_us;
    last_us = us;
    Serial.println(interval);
  }
}

The code is not perfect, but it should give you an idea of how to make what you want.

you could do that.
since ISR is CHANGE, you know input toggles each ISR event.
presumably 1st event is a "1"

#define MAX_TS  100
unsigned long timeStamp [MAX_TS];


void ISR()  {
    timestamp [idx++] = micros();
}

void
loop (void)
{
     if (micros() - timestamp [idx-1] > TIMEOUT)  {
        // process
        idx = 0;
     }
}

gcjr:
you could do that.
since ISR is CHANGE, you know input toggles each ISR event.
presumably 1st event is a "1"

#define MAX_TS  100

unsigned long timeStamp [MAX_TS];

void ISR()  {
    timestamp [idx++] = micros();
}

void
loop (void)
{
    if (micros() - timestamp [idx-1] > TIMEOUT)  {
        // process
        idx = 0;
    }
}

Now i'm doing this, but still not storing the long LOW level from stop pushing.

#define L 600
int counter=0;
uint8_t last_time = micros();
uint8_t new_time;
uint8_t timestamps[L];
uint8_t max_time = 0;
bool inputs[L];
bool printing = LOW;

void setup() {
  Serial.begin(115200);
  attachInterrupt(digitalPinToInterrupt(2),interrupcion,CHANGE);
}

void loop() {
  if(printing==HIGH)
  {
    for(int i=0;i<L;i++)
    {
      //Serial.print("\nEstado: ");
      Serial.print(inputs[i]);
      Serial.print(",");
      Serial.print(timestamps[i]);
      if (timestamps[i]>max_time)
      {
        Serial.print(",maximo");
        max_time=timestamps[i];
      }
      Serial.print("\n");
      if (i==499) printing = LOW;
    }
  }
}

void interrupcion(){
  if (counter<L){
    inputs[counter]=digitalRead(2);
    new_time = micros();
    timestamps[counter]=new_time-last_time;
    last_time=new_time;
    counter++;
    if (counter==L) printing=HIGH;
  }

avoid any math in the ISR as well. just capture the timestamp

let loop figure things out

To reverse engineer wireless sensor and remote switch RF transmissions, it is much easier to use Audacity, as described in this tutorial.