user58561: (I'm sorry for my bad English, but I will do my best)
I have a Chinese MUC which already programmed. It communicates with a LED driver chip using three wires (STB,CLK,DIN).
(LED driver controls 16 digit 7 Segment display)
After some research, I found that it can be talk to LED driver using shiftout function.
Now the main coal is to connect these 
 3 pins(STB,clk,din) to Arduino and read the incoming data and convert the data to numbers.
To test if this idea is working or not,
I came with two arduino (uno to send shiftout function  and mega to read it) after connect pin 2 of uno to pin 2 of mega and same 3 to 3, 4 to 4 and also Gnd of uno to Gnd of mega.
I wrote these codes:
arduino UNO side (to send shiftOut function)

    #define STB  4
#define clockPin  5
#define dataPin  6

void setup() {
  Serial.begin(9600);

  pinMode(STB, OUTPUT);
  pinMode(clockPin,  OUTPUT);
  pinMode(dataPin, OUTPUT);
}

void loop() {
 digitalWrite(STB, LOW);
    shiftOut(dataPin, clockPin, LSBFIRST, 0b10101010 ); // 1st digit   
   digitalWrite(STB, HIGH);
}


arduino mega side (to read shiftOut function)

    #define STB 4
#define clockPin  5
#define dataPin  6

 int R_STB[8]; 
 int R_clockPin ;
 int R_dataPin ; 
void setup() {
   Serial.begin(115200);

  pinMode(STB, INPUT);
  pinMode(clockPin,  INPUT);
  pinMode(dataPin, INPUT);
}

void loop() {

 R_STB = digitalRead(STB); 
 R_clockPin = digitalRead(clockPin);
 R_dataPin = digitalRead(dataPin);


   for(int i=0 ; i<8;i++){
  Serial.print(R_STB[i]-2);

  Serial.print(" ");
  Serial.print (R_clockPin[i]);

 Serial.print(" ");
  Serial.print(R_dataPin[i]+2);
Serial.println(" ");
   }
 }


But the digital read at arduino mega side can't read all data due to it fast switching between High LOW statement maybe? and I am stuck here. 
Please any one has any ideas?

user4143: You are right that you can't read the data fast enough with your method there. What you really need is the opposite of "shiftOut" - which happens to be called "shiftIn".  You use it just like shiftOut, but instead of you sending it a value to send it instead returns a value that it reads.
You trigger it using the "STB" pin:
if (digitalRead(STB) == LOW) {
    uint8_t val = shiftIn(dataPin, clockPin, LSBFIRST);
    Serial.println(val, HEX);
}

But the protocol you describe is simply SPI.  There is hardware within the Arduino to handle it for you.  A little harder to work with, but it's capable of working at much higher speeds and is more likely to be able to read your incoming data fast enough.
Resources:

https://www.arduino.cc/en/reference/SPI
http://www.gammon.com.au/spi

The latter includes how to configure an SPI "Slave" which is used for receiving data that is sent out from elsewhere.

58561: <p>(I'm sorry for my bad English, but I will do my best)</p>

<p>I have a Chinese MUC which already programmed. It communicates with a LED driver chip using three wires (STB,CLK,DIN).<br>
(LED driver controls 16 digit 7 Segment display)</p>

<p>After some research, I found that it can be talk to LED driver using shiftout function.</p>

<p>Now the main coal is to connect these 
 3 pins(STB,clk,din) to Arduino and read the incoming data and convert the data to numbers.</p>

<p>To test if this idea is working or not,
I came with two arduino (uno to send shiftout function  and mega to read it) after connect pin 2 of uno to pin 2 of mega and same 3 to 3, 4 to 4 and also Gnd of uno to Gnd of mega.<br>
I wrote these codes:</p>

<p>arduino UNO side (to send shiftOut function)</p>

<pre><code>
    #define STB  4
#define clockPin  5
#define dataPin  6

void setup() {
  Serial.begin(9600);

  pinMode(STB, OUTPUT);
  pinMode(clockPin,  OUTPUT);
  pinMode(dataPin, OUTPUT);
}

void loop() {
 digitalWrite(STB, LOW);
    shiftOut(dataPin, clockPin, LSBFIRST, 0b10101010 ); // 1st digit   
   digitalWrite(STB, HIGH);
}

</code></pre>

<p>arduino mega side (to read shiftOut function)</p>

<pre><code>
    #define STB 4
#define clockPin  5
#define dataPin  6

 int R_STB[8]; 
 int R_clockPin ;
 int R_dataPin ; 
void setup() {
   Serial.begin(115200);

  pinMode(STB, INPUT);
  pinMode(clockPin,  INPUT);
  pinMode(dataPin, INPUT);
}

void loop() {

 R_STB = digitalRead(STB); 
 R_clockPin = digitalRead(clockPin);
 R_dataPin = digitalRead(dataPin);


   for(int i=0 ; i&lt;8;i++){
  Serial.print(R_STB[i]-2);

  Serial.print(" ");
  Serial.print (R_clockPin[i]);

 Serial.print(" ");
  Serial.print(R_dataPin[i]+2);
Serial.println(" ");
   }
 }

</code></pre>

<p>But the digital read at arduino mega side can't read all data due to it fast switching between High LOW statement maybe? and I am stuck here. </p>

<p>Please any one has any ideas?</p>
 4143: <p>You are right that you can't read the data fast enough with your method there. What you really need is the opposite of "shiftOut" - which happens to be called "shiftIn".  You use it just like shiftOut, but instead of you sending it a value to send it instead returns a value that it reads.</p>

<p>You trigger it using the "STB" pin:</p>

<pre><code>if (digitalRead(STB) == LOW) {
    uint8_t val = shiftIn(dataPin, clockPin, LSBFIRST);
    Serial.println(val, HEX);
}
</code></pre>

<p>But the protocol you describe is simply SPI.  There is hardware within the Arduino to handle it for you.  A little harder to work with, but it's capable of working at much higher speeds and is more likely to be able to read your incoming data fast enough.</p>

<p>Resources:</p>

<ul>
<li><a href="https://www.arduino.cc/en/reference/SPI" rel="nofollow noreferrer">https://www.arduino.cc/en/reference/SPI</a></li>
<li><a href="http://www.gammon.com.au/spi" rel="nofollow noreferrer">http://www.gammon.com.au/spi</a></li>
</ul>

<p>The latter includes how to configure an SPI "Slave" which is used for receiving data that is sent out from elsewhere.</p>
