AtomSoft
Well-Known Member
Hey guys i know im a pain heh but i wrote this code and want some info... should i latch every byte or every 2 bytes? I have 2 daisy chained 74hc595's and want to get this right.
Code:
void shiftIt(REGT Data){
unsigned char REGCount = 2;
unsigned char reg;
unsigned char value;
unsigned char x;
Delay100TCYx(60); //15 magic #
LATCH = 0;
for (reg=0; reg<REGCount; reg++){
value = (char)(Data >>(8*reg));
for (x=0; x<8; x++){
CLK = 0;
//if(value&0x01)
if(value&0x80)
SDO = 1;
else
SDO = 0;
CLK = 1;
//value >>= 1;
value <<= 1;
}
}
LATCH = 1;
}