1016 / 42 = 24.19
316 / 13 = 24.31
Pretty close.
Have you tried using the "LOAD" signal as a "ChipSelect", going low before clocking out the data, and then raising it afterwards?
Thus:
void clkIn(int x)
{
digitalWrite(8, LOW);
for (int i = 15; i>=0; i--)
{
digitalWrite(11, bitRead(x, i)); //D15 is shifted first
//------
digitalWrite(13, HIGH);//generating clock signal
// delayMicroseconds(1);
digitalWrite(13, LOW);
}
digitalWrite(8, HIGH);
}
That's how it works using SPI, if I'm reading the datasheet correctly.