micros and millis func

Hello everyone,

I have the controller ATTiny85 and I have a problem…

I use these commands (micros and millis func) to know how long the signal will be in logic 1, The signal is connected to PB0.

These functions do not count the time right , I stay maybe because I did not turn on zero timer or there is some OVERFLOW

As I understand it, the code does not pass Case 3 (attaching the code)

*It is important to note that the code has been tested in DUE and its works OK

#define DATA_TO_DISP   2
#define DATA_FROM_CON  0
#include <avr/io.h>
#include <avr/interrupt.h>

int val = 0;
int DATA_RESIVED[25] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
unsigned long start_time = 0;
unsigned long current_time = 0;
int state = 0;
int iindex = 0;

void setup() {

  pinMode(DATA_TO_DISP, OUTPUT);
  pinMode(DATA_FROM_CON, INPUT);
  pinMode(1, OUTPUT);
  // Serial.begin(9600);

}

void loop()
{

  READ_DATA_FROM_CON();

}


void READ_DATA_FROM_CON()
{

  switch (state) {

    case 0:

      delay(1000);
      state = 1;
      break;

    case 1:

      if (digitalRead(DATA_FROM_CON) == HIGH) {
        start_time = micros();
        state = 2;
      }
      else {
        state = 1;
      }
      break;

    case 2:

      if (digitalRead(DATA_FROM_CON) == LOW) {
        current_time = micros();
        state = 3;

      }
      else {
        state = 2;
      }
      break;


    case 3:
      if (current_time - start_time > 1500) {
        state = 4;

      } else {
        state = 1;

      }
      break;



    case 4:

      if (iindex == 26) {

        iindex = 0;
        state = 7;
      } else {

        if (digitalRead(DATA_FROM_CON) == HIGH) {
          start_time = micros();
          state = 5;
        }
        else {
          state = 4;
        }

      }

      break;

    case 5:

      if (digitalRead(DATA_FROM_CON) == LOW) {
        current_time = micros();
        state = 6;
      }
      else {
        state = 5;
      }
      break;


    case 6:

      if (current_time - start_time > 250) {
        DATA_RESIVED[iindex] = 1;
        iindex = iindex + 1;
        state = 4;
      }
      else {

        DATA_RESIVED[iindex] = 0;
        iindex = iindex + 1;
        state = 4;

      }
      break;


    case 7:
      digitalWrite(1, val);
      val = !val;
      state = 1;
      break;

  }
}

Someone who has works with the controller, and knows the problem?

Thanks in advance.