74HC165 and 74HC595 interface

try the datasheets and look for application notes on the same chips