Hi, in which order bites comes out from a 74HC165 daisy chain?
I guess D0 from the first chip (connected to the MCU) comes out first and the D7 of the last chip comes out last. I guess this is how it should be. (probably wrong, see EDIT)
Am I correct?
It spits out D0->D1->D2... and DS acts like a non latching "D8"? (probably wrong, see EDIT)
Also do I understand correctly that ~CE (CLK INH)... clock inhibit pin is useless when there is no central CLK signal? When I generate CLK with MCU only when needed, can I just ground the ~CE pin?
Thanks.
EDIT: WOW, everything I said was wrong I guess.
From what I see in the datasheet it looks the other way:
Okay, well I guess someone somewhere has a board with a boatload of 165's, but I think the clock inhibit pin is more general purpose than for selecting one or several SR's out of a set. A finer point, though... yes you can ground CLK INH.
Since they are cascaded, your "IN_SHIFT" can also be combined.
I know it will work one way or the other. Unfortunately I need to make a PCB and if I get this wrong I will have to make some SW correction, lookup table - I don't like SW corrections for a bad HW.
Can someone please confirm that the first out is D7? D7 (first chip) ->... -> D0 (first chip) -> D7 (second chip) -> ... -> D0 (second chip)...
I'd say that based on the data sheet extract in post #1 , it is this :
|chip1||chip2||chip3| out
ABCDEFGABCDEFGABCDEFG
111010110100000100110
11101011010000010011 0
1110101101000001001 1
111010110100000100 1
11101011010000010 0
etc.
etc.
How are you going to read the serial stream ? with shiftIn() ? If so, you have something else to consider and that is whether you read it in MSB first or LSB first (most/least significant bit).
If it is important, then try it first. I'd simply correct it in software if it turns out to be different.
I didn't compare it with your diagram but it would be:
your Last Chip is chip 1 in post #8
your middle Chip is chip 2 in post #8
your first Chip is chip 3 in post #8
You could call shiftIn() 3 times consecutively. There you can reverse the bit order within a byte if required. Reversing the byte order is also a simple change. So the risks of a big error are quite low.